diff --git a/src/app.css b/src/app.css index c730a8d..05539ad 100644 --- a/src/app.css +++ b/src/app.css @@ -55,13 +55,15 @@ /* Content */ main { - @apply max-w-full flex mb-2; + @apply max-w-full flex; } /* To scroll columns independently */ - main.publication { - /* max-height: calc(100vh - 130px); */ - } + main.publication.blog { + display: flex; + flex-direction: column; + max-height: calc(100vh - 76px); + } main.main-leather, article.article-leather { @@ -247,6 +249,17 @@ .link { @apply underline cursor-pointer hover:text-primary-400 dark:hover:text-primary-500; } + + /* Card with transition */ + .ArticleBox.grid .ArticleBoxImage { + @apply max-h-0; + transition: max-height 0.5s ease; + } + + .ArticleBox.grid.active .ArticleBoxImage { + @apply max-h-72; + } + } @layer components { diff --git a/src/lib/components/Publication.svelte b/src/lib/components/Publication.svelte index 369bec3..e1555cd 100644 --- a/src/lib/components/Publication.svelte +++ b/src/lib/components/Publication.svelte @@ -9,12 +9,14 @@ TextPlaceholder, Tooltip, } from "flowbite-svelte"; + import { CaretLeftOutline } from 'flowbite-svelte-icons'; import { getContext, onMount } from "svelte"; import type { NDKEvent } from "@nostr-dev-kit/ndk"; import PublicationSection from "./PublicationSection.svelte"; import type { PublicationTree } from "$lib/data_structures/publication_tree"; import Details from "$components/util/Details.svelte"; import { publicationColumnVisibility } from "$lib/stores"; + import BlogHeader from "$components/blog/BlogHeader.svelte"; let { rootAddress, publicationType, indexEvent } = $props<{ rootAddress: string, @@ -83,30 +85,15 @@ } $publicationColumnVisibility.inner = true; currentBlog = rootId; + // set current blog values for publication render + console.log(currentBlog); } - // #region ToC - - - function scrollToElementWithOffset() { - const hash = window.location.hash; - if (hash) { - const targetElement = document.querySelector(hash); - if (targetElement) { - const headerOffset = 80; - const elementPosition = targetElement.getBoundingClientRect().top; - const offsetPosition = elementPosition + window.scrollY - headerOffset; - - window.scrollTo({ - top: offsetPosition, - behavior: "auto", - }); - } - } + function backToMain() { + $publicationColumnVisibility.blog = true; + $publicationColumnVisibility.inner = false; } - // #endregion - onMount(() => { // Set up the intersection observer. observer = new IntersectionObserver((entries) => { @@ -134,28 +121,54 @@ {/if} {#if isDefaultVisible()} -
-
+
- {#each leaves as leaf, i} - setLastElementRef(el, i)} - /> - {/each} + + {#if publicationType === 'blog'} + + {#each leaves as leaf, i} + + {/each} + {:else} + {#each leaves as leaf, i} + setLastElementRef(el, i)} + /> + {/each} + {/if} +
{/if} {#if currentBlog !== null && $publicationColumnVisibility.inner } {#key currentBlog } -
- Todo... +
+
+ +
+ {#each leaves as leaf, i} + {#if leaf.tagAddress() === currentBlog} + setLastElementRef(el, i)} + /> + {/if} + {/each}
{/key} {/if} diff --git a/src/lib/components/blog/BlogHeader.svelte b/src/lib/components/blog/BlogHeader.svelte index 276b206..bfe5b6a 100644 --- a/src/lib/components/blog/BlogHeader.svelte +++ b/src/lib/components/blog/BlogHeader.svelte @@ -1,19 +1,18 @@ {#if title != null} - -
+ +
{publishedAt()}
- {#if image} -
- -
+ {#if image && active} +
+ +
{/if}
- + {#if active} + + {/if}
-
-
-
{likeCount}
-
{likeCount}
-
{likeCount}
-
{likeCount}
-
{likeCount}
- + {#if active} +
+
-
+ {/if}
{/if} diff --git a/src/lib/components/util/CardActions.svelte b/src/lib/components/util/CardActions.svelte index 177c8ee..c0d62d2 100644 --- a/src/lib/components/util/CardActions.svelte +++ b/src/lib/components/util/CardActions.svelte @@ -10,8 +10,7 @@ import { Button, Modal, Popover } from "flowbite-svelte"; import { standardRelays } from "$lib/consts"; import { neventEncode, naddrEncode } from "$lib/utils"; - import InlineProfile from "$components/util/InlineProfile.svelte"; - import Details from "./Details.svelte"; + import Details from "./Details.svelte"; let { event } = $props(); diff --git a/src/lib/components/util/Interactions.svelte b/src/lib/components/util/Interactions.svelte new file mode 100644 index 0000000..4263f05 --- /dev/null +++ b/src/lib/components/util/Interactions.svelte @@ -0,0 +1,62 @@ + + +
+
{likeCount}
+
{zapCount}
+
{highlightCount}
+
{commentCount}
+
\ No newline at end of file diff --git a/src/lib/components/util/ZapOutline.svelte b/src/lib/components/util/ZapOutline.svelte new file mode 100644 index 0000000..b5588c0 --- /dev/null +++ b/src/lib/components/util/ZapOutline.svelte @@ -0,0 +1,19 @@ + + + + + diff --git a/src/styles/publications.css b/src/styles/publications.css index 79cb2da..5616bd0 100644 --- a/src/styles/publications.css +++ b/src/styles/publications.css @@ -1,55 +1,55 @@ @layer components { /* AsciiDoc content */ - .note-leather p a { + .publication-leather p a { @apply underline hover:text-primary-500 dark:hover:text-primary-400; } - .note-leather section p { + .publication-leather section p { @apply w-full; } - .note-leather section p table { + .publication-leather section p table { @apply w-full table-fixed space-x-2 space-y-2; } - .note-leather section p table td { + .publication-leather section p table td { @apply p-2; } - .note-leather section p table td .content:has(> .imageblock) { + .publication-leather section p table td .content:has(> .imageblock) { @apply flex flex-col items-center; } - .note-leather .imageblock { + .publication-leather .imageblock { @apply flex flex-col space-y-2; } - .note-leather .imageblock .content { + .publication-leather .imageblock .content { @apply flex justify-center; } - .note-leather .imageblock .title { + .publication-leather .imageblock .title { @apply text-center; } - .note-leather .imageblock.left .content { + .publication-leather .imageblock.left .content { @apply justify-start; } - .note-leather .imageblock.left .title { + .publication-leather .imageblock.left .title { @apply text-left; } - .note-leather .imageblock.right .content { + .publication-leather .imageblock.right .content { @apply justify-end; } - .note-leather .imageblock.right .title { + .publication-leather .imageblock.right .title { @apply text-right; } - .note-leather section p table td .literalblock { + .publication-leather section p table td .literalblock { @apply my-2 p-2 border rounded border-gray-400 dark:border-gray-600; } - .note-leather .literalblock pre { + .publication-leather .literalblock pre { @apply p-3 text-wrap break-words; } @@ -58,7 +58,7 @@ } /* lists */ - .note-leather .ulist ul { + .publication-leather .ulist ul { @apply space-y-1 list-disc list-inside; } @@ -253,12 +253,8 @@ /** blog */ @screen lg { @media (hover: hover) { - .blog .discreet:not(:hover) .coverImage img { - @apply filter grayscale sepia brightness-75 opacity-50 transition duration-500 ease-in-out saturate-200 hue-rotate-20; - } - - .blog .discreet:not(:hover) .h-leather { - @apply filter grayscale sepia brightness-75 opacity-50 transition duration-500 ease-in-out saturate-200 hue-rotate-20; + .blog .discreet .card-leather:not(:hover) { + @apply bg-primary-50 opacity-75 transition duration-500 ease-in-out ; } } } diff --git a/src/styles/scrollbar.css b/src/styles/scrollbar.css index 568c1b9..8d2735d 100644 --- a/src/styles/scrollbar.css +++ b/src/styles/scrollbar.css @@ -1,13 +1,12 @@ @layer components { /* Global scrollbar styles */ * { - scrollbar-width: thin; /* Firefox */ scrollbar-color: rgba(87, 66, 41, 0.8) transparent; /* Transparent track, default scrollbar thumb */ } /* Webkit Browsers (Chrome, Safari, Edge) */ *::-webkit-scrollbar { - width: 8px; /* Thin scrollbar */ + width: 12px; /* Thin scrollbar */ } *::-webkit-scrollbar-track {