Merge pull request #136 from pheralb/next

⚙️ Add warning alert.
This commit is contained in:
Pablo Hdez 2023-12-18 02:02:37 +00:00 committed by GitHub
commit 2e7aa6ac81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 18 deletions

View File

@ -58,6 +58,9 @@
## 🚀 Getting Started
> [!IMPORTANT]
> Before submitting the SVG, **make sure that you have permission** or that the license of the SVG allows you to add it to svgl. If you are not sure, please contact the company or author.
You will need:
- [Node.js 16+ (recommended 18 LTS)](https://nodejs.org/en/).

View File

@ -1,16 +1,21 @@
<script lang="ts">
export let notFoundTerm: string;
import FileSearch from 'phosphor-svelte/lib/FileMagnifyingGlass';
import ArrowUpRight from 'phosphor-svelte/lib/ArrowUpRight';
import { PackageOpen, ArrowUpRight } from 'lucide-svelte';
</script>
<div
class="mt-6 flex w-full flex-col items-center justify-center space-y-2 text-gray-600 dark:text-gray-400"
<div class="mt-6 flex w-full flex-col items-center justify-center text-gray-600 dark:text-gray-400">
<PackageOpen size={40} class="mb-4" />
<p class="text-xl mb-1 font-medium">SVG not found</p>
<p class="text-md mb-4 font-mono">"{notFoundTerm}"</p>
<div class="flex items-center space-x-1">
<a
href="https://github.com/pheralb/svgl?tab=readme-ov-file#-getting-started"
target="_blank"
class="flex items-center space-x-2 rounded-md border border-neutral-300 p-2 duration-100 hover:bg-neutral-200 dark:border-neutral-700 dark:hover:bg-neutral-700/40"
>
<FileSearch size={40} />
<p class="mt-1 text-xl font-medium">SVG not found</p>
<p class="text-lg">"{notFoundTerm}"</p>
<span>Submit logo</span>
<ArrowUpRight size={16} />
</a>
<a
href="https://github.com/pheralb/svgl/issues/new"
target="_blank"
@ -20,3 +25,4 @@
<ArrowUpRight size={16} />
</a>
</div>
</div>

View File

@ -0,0 +1,34 @@
<script lang="ts">
import { AlertTriangleIcon } from 'lucide-svelte';
import { browser } from '$app/environment';
let warning = false;
const initialValue = browser ? window.localStorage.getItem('warning') : true;
</script>
{#if !warning && !initialValue}
<div
class="flex items-center md:flex-row flex-col md:space-x-2 space-x-0 p-3 bg-neutral-100 dark:bg-neutral-800/40 text-neutral-700 dark:text-neutral-300"
>
<AlertTriangleIcon size={18} strokeWidth={2} class="mr-2 text-yellow-500" />
<p>
Use each svg responsibly. The svgs provides the link to the product or company that owns it,
<strong>please contact them</strong> if you are going to use their logo. If you are the owner
of an svg and do not want it to appear here, please
<a
target="_blank"
class="underline underline-offset-2"
href="https://github.com/pheralb/svgl/issues/new">create an issue</a
> on Github.
</p>
<button
class="ml-auto flex items-center space-x-2 rounded-md p-2 duration-100 hover:bg-neutral-200 dark:hover:bg-neutral-700/40"
on:click={() => {
localStorage.setItem('warning', 'true');
warning = true;
}}
>
Accept
</button>
</div>
{/if}

View File

@ -20,6 +20,7 @@
// Components for all pages:
import Transition from '@/components/transition.svelte';
import Warning from '@/components/warning.svelte';
// Layout:
import Navbar from '@/components/navbar.svelte';
@ -65,7 +66,6 @@
</a>
{/each}
</nav>
<div></div>
<a
href="https://twitter.com/pheralb_"
target="_blank"
@ -83,6 +83,7 @@
</div>
</aside>
<div class="ml-0 md:ml-56 pb-6">
<Warning />
<Transition pathname={data.pathname}>
<slot />
</Transition>