Thomas G. Lopes
commited on
Commit
·
29a4c23
1
Parent(s):
a5619c2
quota modal styling
Browse files
src/lib/components/quota-modal.svelte
CHANGED
@@ -11,13 +11,14 @@
|
|
11 |
import IconCross from "~icons/carbon/close";
|
12 |
import IconCheck from "~icons/carbon/checkmark";
|
13 |
import IconExternal from "~icons/carbon/arrow-up-right";
|
|
|
14 |
let dialog: HTMLDialogElement | undefined = $state();
|
15 |
|
16 |
$effect(() => {
|
17 |
if (open) {
|
18 |
dialog?.showModal();
|
19 |
} else {
|
20 |
-
dialog?.close();
|
21 |
}
|
22 |
});
|
23 |
</script>
|
@@ -30,12 +31,16 @@
|
|
30 |
</span>
|
31 |
{/snippet}
|
32 |
|
33 |
-
<dialog bind:this={dialog} onclose={() => (open = false)}>
|
34 |
{#if open}
|
35 |
-
<div
|
|
|
|
|
|
|
36 |
<div
|
37 |
class="relative w-3xl rounded-lg bg-white shadow-sm dark:bg-gray-900"
|
38 |
use:clickOutside={() => (open = false)}
|
|
|
39 |
>
|
40 |
<div class="flex items-center justify-between rounded-t border-b p-4 md:px-5 md:py-4 dark:border-gray-800">
|
41 |
<h3 class="flex items-center gap-2.5 text-lg font-semibold text-gray-900 dark:text-white">
|
|
|
11 |
import IconCross from "~icons/carbon/close";
|
12 |
import IconCheck from "~icons/carbon/checkmark";
|
13 |
import IconExternal from "~icons/carbon/arrow-up-right";
|
14 |
+
import { fade, scale } from "svelte/transition";
|
15 |
let dialog: HTMLDialogElement | undefined = $state();
|
16 |
|
17 |
$effect(() => {
|
18 |
if (open) {
|
19 |
dialog?.showModal();
|
20 |
} else {
|
21 |
+
setTimeout(() => dialog?.close(), 250);
|
22 |
}
|
23 |
});
|
24 |
</script>
|
|
|
31 |
</span>
|
32 |
{/snippet}
|
33 |
|
34 |
+
<dialog class="backdrop:bg-transparent" bind:this={dialog} onclose={() => (open = false)}>
|
35 |
{#if open}
|
36 |
+
<div
|
37 |
+
class="fixed inset-0 z-50 flex items-center justify-center overflow-hidden bg-black/50 backdrop-blur-sm"
|
38 |
+
transition:fade={{ duration: 150 }}
|
39 |
+
>
|
40 |
<div
|
41 |
class="relative w-3xl rounded-lg bg-white shadow-sm dark:bg-gray-900"
|
42 |
use:clickOutside={() => (open = false)}
|
43 |
+
transition:scale={{ start: 0.975, duration: 250 }}
|
44 |
>
|
45 |
<div class="flex items-center justify-between rounded-t border-b p-4 md:px-5 md:py-4 dark:border-gray-800">
|
46 |
<h3 class="flex items-center gap-2.5 text-lg font-semibold text-gray-900 dark:text-white">
|
src/lib/components/toaster.svelte
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
</h3>
|
20 |
|
21 |
{#if toast.data.description}
|
22 |
-
<div {...toast.description} class="text-xs text-gray-700 dark:text-gray-300">
|
23 |
{toast.data.description}
|
24 |
</div>
|
25 |
{/if}
|
@@ -61,7 +61,7 @@
|
|
61 |
[data-melt-toaster-root] {
|
62 |
--gap: 0.75rem;
|
63 |
--hover-offset: 0rem;
|
64 |
-
--toast-height:
|
65 |
--hidden-offset: 0.75rem;
|
66 |
|
67 |
--hidden-toasts: calc(var(--toasts) - 1);
|
|
|
19 |
</h3>
|
20 |
|
21 |
{#if toast.data.description}
|
22 |
+
<div {...toast.description} class="max-w-[200px] text-xs text-gray-700 dark:text-gray-300">
|
23 |
{toast.data.description}
|
24 |
</div>
|
25 |
{/if}
|
|
|
61 |
[data-melt-toaster-root] {
|
62 |
--gap: 0.75rem;
|
63 |
--hover-offset: 0rem;
|
64 |
+
--toast-height: 4.5rem;
|
65 |
--hidden-offset: 0.75rem;
|
66 |
|
67 |
--hidden-toasts: calc(var(--toasts) - 1);
|