mirror of https://github.com/VERT-sh/VERT.git
feat: file badge
This commit is contained in:
parent
df13147b3a
commit
74a8c1490a
|
@ -36,6 +36,7 @@
|
||||||
--fg: hsl(0, 0%, 0%);
|
--fg: hsl(0, 0%, 0%);
|
||||||
--fg-muted: hsl(0, 0%, 50%);
|
--fg-muted: hsl(0, 0%, 50%);
|
||||||
--fg-on-accent: hsl(0, 0%, 0%);
|
--fg-on-accent: hsl(0, 0%, 0%);
|
||||||
|
--fg-on-badge: hsl(0, 0%, 100%);
|
||||||
|
|
||||||
// backgrounds
|
// backgrounds
|
||||||
--bg: hsl(0, 0%, 95%);
|
--bg: hsl(0, 0%, 95%);
|
||||||
|
@ -59,6 +60,7 @@
|
||||||
--bg-panel-accented: hsl(300, 25%, 91%);
|
--bg-panel-accented: hsl(300, 25%, 91%);
|
||||||
--bg-separator: hsl(0, 0%, 88%);
|
--bg-separator: hsl(0, 0%, 88%);
|
||||||
--bg-button: var(--bg-panel-accented);
|
--bg-button: var(--bg-panel-accented);
|
||||||
|
--bg-badge: hsl(0, 0%, 0%);
|
||||||
|
|
||||||
--shadow-panel: 0 2px 4px 0 hsla(0, 0%, 0%, 0.15);
|
--shadow-panel: 0 2px 4px 0 hsla(0, 0%, 0%, 0.15);
|
||||||
}
|
}
|
||||||
|
@ -71,6 +73,7 @@
|
||||||
--fg: hsl(0, 0%, 100%);
|
--fg: hsl(0, 0%, 100%);
|
||||||
--fg-muted: hsl(0, 0%, 50%);
|
--fg-muted: hsl(0, 0%, 50%);
|
||||||
--fg-on-accent: hsl(0, 0%, 0%);
|
--fg-on-accent: hsl(0, 0%, 0%);
|
||||||
|
--fg-on-badge: hsl(0, 0%, 0%);
|
||||||
|
|
||||||
// backgrounds
|
// backgrounds
|
||||||
--bg: hsl(220, 5%, 12%);
|
--bg: hsl(220, 5%, 12%);
|
||||||
|
@ -93,6 +96,7 @@
|
||||||
--bg-panel-accented: color-mix(in srgb, var(--accent) 12%, transparent);
|
--bg-panel-accented: color-mix(in srgb, var(--accent) 12%, transparent);
|
||||||
--bg-panel-alt: hsl(220, 6%, 25%);
|
--bg-panel-alt: hsl(220, 6%, 25%);
|
||||||
--bg-separator: hsl(220, 4%, 28%);
|
--bg-separator: hsl(220, 4%, 28%);
|
||||||
|
--bg-badge: hsl(0, 0%, 100%);
|
||||||
|
|
||||||
--shadow-panel: 0 4px 6px 0 hsla(0, 0%, 0%, 0.15);
|
--shadow-panel: 0 4px 6px 0 hsla(0, 0%, 0%, 0.15);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount, type SvelteComponentTyped } from "svelte";
|
|
||||||
import Panel from "../visual/Panel.svelte";
|
import Panel from "../visual/Panel.svelte";
|
||||||
import Logo from "../visual/svg/Logo.svelte";
|
import Logo from "../visual/svg/Logo.svelte";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
@ -15,6 +14,7 @@
|
||||||
url: string;
|
url: string;
|
||||||
activeMatch: (pathname: string) => boolean;
|
activeMatch: (pathname: string) => boolean;
|
||||||
icon: any;
|
icon: any;
|
||||||
|
badge?: number;
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,11 +33,10 @@
|
||||||
},
|
},
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Icon />
|
|
||||||
<div class="grid grid-rows-1 grid-cols-1">
|
<div class="grid grid-rows-1 grid-cols-1">
|
||||||
{#key item.name}
|
{#key item.name}
|
||||||
<p
|
<div
|
||||||
class="row-start-1 col-start-1 font-medium"
|
class="w-full row-start-1 col-start-1 h-full flex items-center justify-center gap-3"
|
||||||
in:blur={{
|
in:blur={{
|
||||||
blurMultiplier: 6,
|
blurMultiplier: 6,
|
||||||
duration,
|
duration,
|
||||||
|
@ -57,8 +56,30 @@
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<div class="relative">
|
||||||
|
<Icon />
|
||||||
|
{#if item.badge}
|
||||||
|
<div
|
||||||
|
class="absolute -top-1 font-display -right-1 w-fit px-1.5 h-4 rounded-full bg-badge text-on-badge flex items-center justify-center font-medium"
|
||||||
|
style="font-size: 0.7rem;"
|
||||||
|
transition:blur={{
|
||||||
|
blurMultiplier: 4,
|
||||||
|
duration,
|
||||||
|
easing: quintOut,
|
||||||
|
scale: {
|
||||||
|
start: 0.5,
|
||||||
|
end: 1,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{item.badge}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
<p class=" font-medium">
|
||||||
{item.name}
|
{item.name}
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
{/key}
|
{/key}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
url: string;
|
url: string;
|
||||||
activeMatch: (pathname: string) => boolean;
|
activeMatch: (pathname: string) => boolean;
|
||||||
icon: any;
|
icon: any;
|
||||||
|
badge?: number;
|
||||||
}[]
|
}[]
|
||||||
>([
|
>([
|
||||||
{
|
{
|
||||||
|
@ -50,13 +51,11 @@
|
||||||
icon: UploadIcon,
|
icon: UploadIcon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:
|
name: "Convert",
|
||||||
files.files.length > 0
|
|
||||||
? `Convert (${files.files.length})`
|
|
||||||
: `Convert`,
|
|
||||||
url: "/convert",
|
url: "/convert",
|
||||||
activeMatch: (pathname) => pathname === "/convert",
|
activeMatch: (pathname) => pathname === "/convert",
|
||||||
icon: RefreshCw,
|
icon: RefreshCw,
|
||||||
|
badge: files.files.length,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Settings",
|
name: "Settings",
|
||||||
|
@ -105,7 +104,7 @@
|
||||||
></script>{/if}
|
></script>{/if}
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="absolute top-8 left-0 w-full flex justify-center">
|
<div class="absolute top-8 left-0 w-screen flex justify-center">
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<Navbar {items} />
|
<Navbar {items} />
|
||||||
{#if items
|
{#if items
|
||||||
|
|
|
@ -11,6 +11,7 @@ export default {
|
||||||
separator: "var(--bg-separator)",
|
separator: "var(--bg-separator)",
|
||||||
button: "var(--bg-button)",
|
button: "var(--bg-button)",
|
||||||
"panel-alt": "var(--bg-panel-alt)",
|
"panel-alt": "var(--bg-panel-alt)",
|
||||||
|
badge: "var(--bg-badge)",
|
||||||
},
|
},
|
||||||
borderColor: {
|
borderColor: {
|
||||||
separator: "var(--bg-separator)",
|
separator: "var(--bg-separator)",
|
||||||
|
@ -19,6 +20,7 @@ export default {
|
||||||
foreground: "var(--fg)",
|
foreground: "var(--fg)",
|
||||||
muted: "var(--fg-muted)",
|
muted: "var(--fg-muted)",
|
||||||
"on-accent": "var(--fg-on-accent)",
|
"on-accent": "var(--fg-on-accent)",
|
||||||
|
"on-badge": "var(--fg-on-badge)",
|
||||||
},
|
},
|
||||||
colors: {
|
colors: {
|
||||||
accent: "var(--accent)",
|
accent: "var(--accent)",
|
||||||
|
|
Loading…
Reference in New Issue