diff --git a/src/app.css b/src/app.css index fe0b865..1a86416 100644 --- a/src/app.css +++ b/src/app.css @@ -19,76 +19,76 @@ @custom-variant dark (&:where(.dark, .dark *)); @theme { - /* single color */ - --color-highlight: #f9f6f1; - - --color-border: var(--color-highlight); - --color-text-muted: var(--color-text-muted); - - /* success */ - --color-success-50: #e3f2e7; - --color-success-100: #c7e6cf; - --color-success-200: #a2d4ae; - --color-success-300: #7dbf8e; - --color-success-400: #5ea571; - --color-success-500: #4e8e5f; - --color-success-600: #3e744c; - --color-success-700: #305b3b; - --color-success-800: #22412a; - --color-success-900: #15281b; - - /* info */ - --color-info-50: #e7eff6; - --color-info-100: #c5d9ea; - --color-info-200: #9fbfdb; - --color-info-300: #7aa5cc; - --color-info-400: #5e90be; - --color-info-500: #4779a5; - --color-info-600: #365d80; - --color-info-700: #27445d; - --color-info-800: #192b3a; - --color-info-900: #0d161f; - - /* warning */ - --color-warning-50: #fef4e6; - --color-warning-100: #fde4bf; - --color-warning-200: #fcd18e; - --color-warning-300: #fbbc5c; - --color-warning-400: #f9aa33; - --color-warning-500: #f7971b; - --color-warning-600: #c97a14; - --color-warning-700: #9a5c0e; - --color-warning-800: #6c3e08; - --color-warning-900: #3e2404; - - /* danger */ - --color-danger-50: #fbeaea; - --color-danger-100: #f5cccc; - --color-danger-200: #eba5a5; - --color-danger-300: #e17e7e; - --color-danger-400: #d96060; - --color-danger-500: #c94848; - --color-danger-600: #a53939; - --color-danger-700: #7c2b2b; - --color-danger-800: #521c1c; - --color-danger-900: #2b0e0e; + /* single color */ + --color-highlight: #f9f6f1; + + --color-border: var(--color-highlight); + --color-text-muted: var(--color-text-muted); + + /* success */ + --color-success-50: #e3f2e7; + --color-success-100: #c7e6cf; + --color-success-200: #a2d4ae; + --color-success-300: #7dbf8e; + --color-success-400: #5ea571; + --color-success-500: #4e8e5f; + --color-success-600: #3e744c; + --color-success-700: #305b3b; + --color-success-800: #22412a; + --color-success-900: #15281b; + + /* info */ + --color-info-50: #e7eff6; + --color-info-100: #c5d9ea; + --color-info-200: #9fbfdb; + --color-info-300: #7aa5cc; + --color-info-400: #5e90be; + --color-info-500: #4779a5; + --color-info-600: #365d80; + --color-info-700: #27445d; + --color-info-800: #192b3a; + --color-info-900: #0d161f; + + /* warning */ + --color-warning-50: #fef4e6; + --color-warning-100: #fde4bf; + --color-warning-200: #fcd18e; + --color-warning-300: #fbbc5c; + --color-warning-400: #f9aa33; + --color-warning-500: #f7971b; + --color-warning-600: #c97a14; + --color-warning-700: #9a5c0e; + --color-warning-800: #6c3e08; + --color-warning-900: #3e2404; + + /* danger */ + --color-danger-50: #fbeaea; + --color-danger-100: #f5cccc; + --color-danger-200: #eba5a5; + --color-danger-300: #e17e7e; + --color-danger-400: #d96060; + --color-danger-500: #c94848; + --color-danger-600: #a53939; + --color-danger-700: #7c2b2b; + --color-danger-800: #521c1c; + --color-danger-900: #2b0e0e; } /* Map Tailwind utilities → theme tokens (PRIMARY ONLY) */ @theme inline { - --color-primary-0: var(--brand-primary-0); - --color-primary-50: var(--brand-primary-50); - --color-primary-100: var(--brand-primary-100); - --color-primary-200: var(--brand-primary-200); - --color-primary-300: var(--brand-primary-300); - --color-primary-400: var(--brand-primary-400); - --color-primary-500: var(--brand-primary-500); - --color-primary-600: var(--brand-primary-600); - --color-primary-700: var(--brand-primary-700); - --color-primary-800: var(--brand-primary-800); - --color-primary-900: var(--brand-primary-900); - --color-primary-950: var(--brand-primary-950); - --color-primary-1000: var(--brand-primary-1000); + --color-primary-0: var(--brand-primary-0); + --color-primary-50: var(--brand-primary-50); + --color-primary-100: var(--brand-primary-100); + --color-primary-200: var(--brand-primary-200); + --color-primary-300: var(--brand-primary-300); + --color-primary-400: var(--brand-primary-400); + --color-primary-500: var(--brand-primary-500); + --color-primary-600: var(--brand-primary-600); + --color-primary-700: var(--brand-primary-700); + --color-primary-800: var(--brand-primary-800); + --color-primary-900: var(--brand-primary-900); + --color-primary-950: var(--brand-primary-950); + --color-primary-1000: var(--brand-primary-1000); } @source "../node_modules/flowbite-svelte/dist"; @@ -97,33 +97,47 @@ /* @utility and @layer rules… */ /* .content-visibility-auto */ -@utility content-visibility-auto { content-visibility: auto; } +@utility content-visibility-auto { + content-visibility: auto; +} /* .contain-size */ -@utility contain-size { contain: size; } +@utility contain-size { + contain: size; +} /* numbers -> px (e.g. contain-intrinsic-w-[320] => width: 320px) */ @utility contain-intrinsic-w-* { - --tw-ciw: --value(number); - width: calc(var(--tw-ciw) * 1px); + --tw-ciw: --value(number); + width: calc(var(--tw-ciw) * 1px); } @utility contain-intrinsic-h-* { - --tw-cih: --value(number); - height: calc(var(--tw-cih) * 1px); + --tw-cih: --value(number); + height: calc(var(--tw-cih) * 1px); } /* percentages (e.g. contain-intrinsic-wp-[65%] => width: 65%) */ -@utility contain-intrinsic-wp-* { width: --value(percentage); } -@utility contain-intrinsic-hp-* { height: --value(percentage); } +@utility contain-intrinsic-wp-* { + width: --value(percentage); +} +@utility contain-intrinsic-hp-* { + height: --value(percentage); +} /* list-upper-alpha, list-lower-alpha (keep your old class names) Note: in v4 you can also write list-[upper-alpha] / list-[lower-alpha] inline. */ -@utility list-upper-alpha { list-style-type: upper-alpha; } -@utility list-lower-alpha { list-style-type: lower-alpha; } +@utility list-upper-alpha { + list-style-type: upper-alpha; +} +@utility list-lower-alpha { + list-style-type: lower-alpha; +} /* flexGrow 1/2/3 — unlock grow-2, grow-3 (and any number via brackets) */ -@utility grow-* { flex-grow: --value(integer); } +@utility grow-* { + flex-grow: --value(integer); +} /* Hue rotate: use arbitrary values directly, e.g. hue-rotate-[20deg] (no config needed). */ @@ -135,10 +149,11 @@ @layer base { /* disable chrome cancel button */ input[type="search"]::-webkit-search-cancel-button { - display: none; + display: none; } - .leather, .publication-leather { + .leather, + .publication-leather { @apply bg-primary-50 dark:bg-primary-1000 text-gray-900 dark:text-gray-100; } @@ -465,7 +480,6 @@ } @layer components { - nav a { text-decoration-line: none !important; } @@ -506,7 +520,12 @@ /* common heading base styles */ - h1, h2, h3, h4, h5, h6 { + h1, + h2, + h3, + h4, + h5, + h6 { @apply text-gray-900 dark:text-gray-100 pt-4; } diff --git a/src/app.html b/src/app.html index 33b6e90..c646c7a 100644 --- a/src/app.html +++ b/src/app.html @@ -1,4 +1,4 @@ - + @@ -8,7 +8,7 @@ - + - + %sveltekit.head% diff --git a/src/lib/a/README.md b/src/lib/a/README.md index 641f7b6..d2ea9e3 100644 --- a/src/lib/a/README.md +++ b/src/lib/a/README.md @@ -1,11 +1,10 @@ # Component Library -This folder contains a component library. -The idea is to have project-scoped reusable components that centralize theming and style rules, +This folder contains a component library. +The idea is to have project-scoped reusable components that centralize theming and style rules, so that main pages and layouts focus on the functionalities. All components are based on Flowbite Svelte components, -which are built on top of Tailwind CSS. +which are built on top of Tailwind CSS. Keeping all the styles in one place allows us to easily change the look and feel of the application by switching themes. - diff --git a/src/lib/a/cards/AEventPreview.svelte b/src/lib/a/cards/AEventPreview.svelte index 54f9ad7..03b3b5b 100644 --- a/src/lib/a/cards/AEventPreview.svelte +++ b/src/lib/a/cards/AEventPreview.svelte @@ -18,7 +18,7 @@ showContent = true, actions, onSelect, - onDeferralClick + onDeferralClick, }: { event: NDKEvent; label?: string; @@ -29,7 +29,11 @@ showDeferralNaddr?: boolean; showPublicationLink?: boolean; showContent?: boolean; - actions?: { label: string; onClick: (ev: NDKEvent) => void; variant?: "primary" | "light" | "alternative" }[]; + actions?: { + label: string; + onClick: (ev: NDKEvent) => void; + variant?: "primary" | "light" | "alternative"; + }[]; onSelect?: (ev: NDKEvent) => void; onDeferralClick?: (naddr: string, ev: NDKEvent) => void; } = $props(); @@ -98,12 +102,12 @@ const displayName: string | undefined = profileData?.display_name || profileData?.name; - const avatarFallback: string = - (displayName || event.pubkey || "?").slice(0, 1).toUpperCase(); - const createdDate: string = - event.created_at - ? new Date(event.created_at * 1000).toLocaleDateString() - : "Unknown date"; + const avatarFallback: string = (displayName || event.pubkey || "?") + .slice(0, 1) + .toUpperCase(); + const createdDate: string = event.created_at + ? new Date(event.created_at * 1000).toLocaleDateString() + : "Unknown date"; const computedActions = actions && actions.length > 0 @@ -112,8 +116,8 @@ { label: "Open", onClick: (ev: NDKEvent) => onSelect?.(ev), - variant: "light" as const - } + variant: "light" as const, + }, ]; @@ -131,31 +135,35 @@
{#if label} - - {label} - + + {label} + {/if} {#if showKind} - - Kind {event.kind} - + + Kind {event.kind} + {/if} {#if community} - - - - - Community - + + + + + Community + {/if} - {createdDate} - + {createdDate} +
@@ -171,7 +179,9 @@
{:else} {#if summary} -
+
{summary}
{/if} @@ -184,7 +194,7 @@ tabindex="0" onclick={handleDeferralClick} onkeydown={(e) => { - if (e.key === 'Enter' || e.key === ' ') { + if (e.key === "Enter" || e.key === " ") { e.preventDefault(); handleDeferralClick(e as unknown as MouseEvent); } @@ -196,7 +206,9 @@ {/if} {#if showContent && event.content} -
+
{clippedContent(event.content)}
{/if} @@ -205,7 +217,9 @@ {#if showPublicationLink && event.kind !== 0} -
+
{/if} diff --git a/src/lib/a/cards/AProfilePreview.svelte b/src/lib/a/cards/AProfilePreview.svelte index bf802fe..25dbdd5 100644 --- a/src/lib/a/cards/AProfilePreview.svelte +++ b/src/lib/a/cards/AProfilePreview.svelte @@ -1,21 +1,36 @@ - + {#if props.profile?.banner}
- +
{:else} -
+
{/if}
- - +
{displayName()} @@ -170,16 +235,39 @@ {#if props.event}
{#if props.profile?.nip05} - {props.profile.nip05} + {props.profile.nip05} {/if} {#if communityStatus === true} -
- +
+
{/if} {#if isInUserLists === true} -
- +
+
{/if}
@@ -187,31 +275,57 @@
{#if props.profile?.about} -
+
{@render basicMarkup(props.profile.about, ndk)}
{/if}
{#if props.profile?.website} - {props.profile.website} + {props.profile.website} {/if}
{#if props.profile?.lud16} - + {/if} - + {#each getIdentifiers(props.event, props.profile) as identifier} - + {/each} {#if props.isOwn} - - + + {/if}
@@ -225,13 +339,23 @@ {#if lnModalOpen} - + {#if props.profile?.lud16}
{@render userBadge( props.user?.npub ?? toNpub(props.event.pubkey), - props.profile?.displayName || props.profile?.display_name || props.profile?.name || (props.event?.pubkey || ''), + props.profile?.displayName || + props.profile?.display_name || + props.profile?.name || + props.event?.pubkey || + "", ndk, )}

{props.profile.lud16}

@@ -240,7 +364,8 @@

Scan the QR code or copy the address

{#if lnurl}

- +

{:else} diff --git a/src/lib/a/forms/ACommentForm.svelte b/src/lib/a/forms/ACommentForm.svelte index 846d8c4..ea1ed64 100644 --- a/src/lib/a/forms/ACommentForm.svelte +++ b/src/lib/a/forms/ACommentForm.svelte @@ -61,8 +61,15 @@
- - + +
+ +
{:else} - {@render content()} + {@render content()} {/if} diff --git a/src/lib/a/reader/ATechToggle.svelte b/src/lib/a/reader/ATechToggle.svelte index cabf420..e05a500 100644 --- a/src/lib/a/reader/ATechToggle.svelte +++ b/src/lib/a/reader/ATechToggle.svelte @@ -1,7 +1,7 @@
diff --git a/src/styles/a/primitives.css b/src/styles/a/primitives.css index e40a6e0..3d40526 100644 --- a/src/styles/a/primitives.css +++ b/src/styles/a/primitives.css @@ -1,5 +1,5 @@ @layer components { - .alert-leather { - @apply border border-s-4; - } -} \ No newline at end of file + .alert-leather { + @apply border border-s-4; + } +} diff --git a/src/styles/notifications.css b/src/styles/notifications.css index c11a0ea..8fcedca 100644 --- a/src/styles/notifications.css +++ b/src/styles/notifications.css @@ -107,11 +107,15 @@ } .message-container:hover { - box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + box-shadow: + 0 4px 6px -1px rgb(0 0 0 / 0.1), + 0 2px 4px -2px rgb(0 0 0 / 0.1); } .dark .message-container:hover { - box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2); + box-shadow: + 0 4px 6px -1px rgb(0 0 0 / 0.3), + 0 2px 4px -2px rgb(0 0 0 / 0.2); } /* Filter indicator styling */ diff --git a/src/styles/scrollbar.css b/src/styles/scrollbar.css index c337549..6fa2e85 100644 --- a/src/styles/scrollbar.css +++ b/src/styles/scrollbar.css @@ -1,8 +1,7 @@ @layer components { /* Global scrollbar styles */ * { - scrollbar-color: rgba(87, 66, 41, 0.8) - transparent; /* Transparent track, default scrollbar thumb */ + scrollbar-color: rgba(87, 66, 41, 0.8) transparent; /* Transparent track, default scrollbar thumb */ } /* Webkit Browsers (Chrome, Safari, Edge) */ diff --git a/src/theme-tokens.css b/src/theme-tokens.css index ce16508..4f97824 100644 --- a/src/theme-tokens.css +++ b/src/theme-tokens.css @@ -1,64 +1,64 @@ /* Default theme (your current palette) */ :root { - --brand-primary-0: #efe6dc; - --brand-primary-50: #decdb9; - --brand-primary-100: #d6c1a8; - --brand-primary-200: #c6a885; - --brand-primary-300: #b58f62; - --brand-primary-400: #ad8351; - --brand-primary-500: #c6a885; - --brand-primary-600: #795c39; - --brand-primary-700: #564a3e; - --brand-primary-800: #3c352c; - --brand-primary-900: #2a241c; - --brand-primary-950: #1d1812; - --brand-primary-1000: #15110d; + --brand-primary-0: #efe6dc; + --brand-primary-50: #decdb9; + --brand-primary-100: #d6c1a8; + --brand-primary-200: #c6a885; + --brand-primary-300: #b58f62; + --brand-primary-400: #ad8351; + --brand-primary-500: #c6a885; + --brand-primary-600: #795c39; + --brand-primary-700: #564a3e; + --brand-primary-800: #3c352c; + --brand-primary-900: #2a241c; + --brand-primary-950: #1d1812; + --brand-primary-1000: #15110d; } /* Example alternative theme: ocean */ :root[data-theme="ocean"] { - --brand-primary-0: #ecf8ff; - --brand-primary-50: #e6f3ff; - --brand-primary-100: #d9ecff; - --brand-primary-200: #b9ddff; - --brand-primary-300: #90cbff; - --brand-primary-400: #61b6fb; - --brand-primary-500: #0ea5e9; /* sky-500-ish */ - --brand-primary-600: #0284c7; - --brand-primary-700: #0369a1; - --brand-primary-800: #075985; - --brand-primary-900: #0c4a6e; - --brand-primary-950: #082f49; - --brand-primary-1000: #062233; + --brand-primary-0: #ecf8ff; + --brand-primary-50: #e6f3ff; + --brand-primary-100: #d9ecff; + --brand-primary-200: #b9ddff; + --brand-primary-300: #90cbff; + --brand-primary-400: #61b6fb; + --brand-primary-500: #0ea5e9; /* sky-500-ish */ + --brand-primary-600: #0284c7; + --brand-primary-700: #0369a1; + --brand-primary-800: #075985; + --brand-primary-900: #0c4a6e; + --brand-primary-950: #082f49; + --brand-primary-1000: #062233; } /* (Optional) per-theme dark tweaks — applied when is set */ :root.dark[data-theme="ocean"] { - /* nudge the mid tones brighter for contrast */ - --brand-primary-400: #7ccdfc; - --brand-primary-500: #38bdf8; + /* nudge the mid tones brighter for contrast */ + --brand-primary-400: #7ccdfc; + --brand-primary-500: #38bdf8; } /* Example alternative theme: forrest */ :root[data-theme="forrest"] { - --brand-primary-0: #eaf7ea; - --brand-primary-50: #d6eed6; - --brand-primary-100: #bfe3bf; - --brand-primary-200: #9fd49f; - --brand-primary-300: #7fc57f; - --brand-primary-400: #5fa65f; - --brand-primary-500: #3f863f; /* forest green */ - --brand-primary-600: #2e6b2e; - --brand-primary-700: #205120; - --brand-primary-800: #153a15; - --brand-primary-900: #0c230c; - --brand-primary-950: #071507; - --brand-primary-1000: #041004; + --brand-primary-0: #eaf7ea; + --brand-primary-50: #d6eed6; + --brand-primary-100: #bfe3bf; + --brand-primary-200: #9fd49f; + --brand-primary-300: #7fc57f; + --brand-primary-400: #5fa65f; + --brand-primary-500: #3f863f; /* forest green */ + --brand-primary-600: #2e6b2e; + --brand-primary-700: #205120; + --brand-primary-800: #153a15; + --brand-primary-900: #0c230c; + --brand-primary-950: #071507; + --brand-primary-1000: #041004; } /* (Optional) per-theme dark tweaks — applied when is set */ :root.dark[data-theme="forrest"] { - /* nudge the mid tones brighter for contrast */ - --brand-primary-400: #7fc97f; - --brand-primary-500: #4caf50; + /* nudge the mid tones brighter for contrast */ + --brand-primary-400: #7fc97f; + --brand-primary-500: #4caf50; }