design: re-do menus, dynamic origin animations
This commit is contained in:
14 files changed
+91
-74
No files matched your search
@@ -24,7 +24,8 @@
|
||||
<div
|
||||
class={[
|
||||
toastColors[toast.type],
|
||||
'relative rounded-2xl overflow-hidden flex flex-row items-center gap-2 px-3 py-3 backdrop-blur-lg',
|
||||
'relative rounded-xl overflow-hidden flex flex-row items-center gap-2 px-3 py-3',
|
||||
'bg-white dark:bg-zinc-900 shadow-lg',
|
||||
toast.long ? 'w-full max-w-lg' : 'w-80',
|
||||
]}
|
||||
transition:fly={{
|
||||
@@ -42,16 +43,7 @@
|
||||
<Icon
|
||||
size="28"
|
||||
mini
|
||||
class={[
|
||||
'relative self-center shrink-0 p-1 rounded-lg',
|
||||
toast.type == 'info'
|
||||
? 'bg-slate-200 dark:bg-zinc-50 text-slate-700 dark:text-zinc-700'
|
||||
: toast.type == 'success'
|
||||
? 'bg-green-400 dark:bg-green-300 dark:text-green-900 text-green-50'
|
||||
: toast.type == 'warning'
|
||||
? 'bg-yellow-400 dark:bg-yellow-300 dark:text-yellow-900 text-yellow-50'
|
||||
: 'bg-red-400 dark:bg-red-300 dark:text-red-900 text-red-50',
|
||||
]}
|
||||
class={['relative self-center shrink-0 p-1 rounded-lg']}
|
||||
src={toast.type == 'info'
|
||||
? InformationCircle
|
||||
: toast.type == 'success'
|
||||
@@ -63,9 +55,7 @@
|
||||
: ExclamationCircle}
|
||||
/>
|
||||
{/if}
|
||||
<div
|
||||
class="flex flex-col break-words max-w-full text-slate-900 dark:text-zinc-50"
|
||||
>
|
||||
<div class="flex flex-col break-words max-w-full text-inherit">
|
||||
{#if toast.title}
|
||||
<h1 class="text-base font-semibold">{toast.title}</h1>
|
||||
{/if}
|
||||
@@ -90,9 +80,9 @@
|
||||
onclick={() => {
|
||||
toasts.update(toasts => toasts.filter(t => t.id != toast.id))
|
||||
}}
|
||||
class="rounded-lg w-max transition-colors hover:bg-slate-100 dark:hover:bg-zinc-800 p-1 cursor-pointer"
|
||||
class="rounded-lg w-max transition-colors hover:bg-slate-100 dark:hover:bg-zinc-800 p-1 cursor-pointer text-slate-600 dark:text-zinc-400"
|
||||
>
|
||||
<Icon src={XMark} size="20" micro />
|
||||
<Icon src={XMark} size="16" micro />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -11,7 +11,7 @@
|
||||
>
|
||||
{#each $toasts as toast (toast.id)}
|
||||
<div
|
||||
animate:flip={{ duration: 500, easing: expoOut }}
|
||||
animate:flip={{ duration: 300, easing: expoOut }}
|
||||
class="pointer-events-auto transition-all
|
||||
duration-300"
|
||||
>
|
||||
|
||||
@@ -3,10 +3,10 @@ import { writable } from 'svelte/store'
|
||||
type ToastType = keyof typeof toastColors
|
||||
|
||||
export const toastColors = {
|
||||
error: 'bg-red-100/50 dark:bg-red-900/20 border-red-300/40 border',
|
||||
warning: 'bg-yellow-100/50 dark:bg-yellow-500/5 border-yellow-500/40 border',
|
||||
success: 'bg-green-100/50 dark:bg-green-900/20 border-green-300/40 border',
|
||||
info: 'dark:bg-zinc-925/90 bg-white border border-slate-200 dark:border-zinc-800',
|
||||
error: 'text-red-600 dark:text-red-400',
|
||||
warning: 'text-yellow-600 dark:text-yellow-400',
|
||||
success: 'text-green-600 dark:text-green-400',
|
||||
info: '',
|
||||
}
|
||||
|
||||
export interface Toast {
|
||||
|
||||
Reference in new issue
Block a user