From 6d7f4217eec11e0cf29d0dde7190665ae92d7502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Thu, 1 May 2025 16:01:22 +0200 Subject: [PATCH] Intermediate state where publications have 'covers' and columns are still all messed up --- src/app.css | 14 ++++- src/lib/components/Preview.svelte | 21 +++---- src/lib/components/Publication.svelte | 17 +++--- src/lib/components/blog/BlogHeader.svelte | 65 ++++++++++++++++++++ src/lib/components/util/ArticleNav.svelte | 74 +++++++++++++++-------- src/lib/components/util/Details.svelte | 6 +- src/routes/publication/+page.svelte | 4 +- 7 files changed, 149 insertions(+), 52 deletions(-) create mode 100644 src/lib/components/blog/BlogHeader.svelte diff --git a/src/app.css b/src/app.css index 8fea2b5..f7e32e3 100644 --- a/src/app.css +++ b/src/app.css @@ -55,11 +55,12 @@ /* Content */ main { - @apply max-w-full flex; + @apply max-w-full flex mb-2; } - main.blog { - max-height: calc(100vh - 130px); + /* To scroll columns independently */ + main.publication { + /* max-height: calc(100vh - 130px); */ } main.main-leather, @@ -219,3 +220,10 @@ @apply bg-primary-0 dark:bg-primary-1000 text-gray-800 dark:text-gray-300; } } + +.line-ellipsis { + max-width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} \ No newline at end of file diff --git a/src/lib/components/Preview.svelte b/src/lib/components/Preview.svelte index 093a640..b2ec5f4 100644 --- a/src/lib/components/Preview.svelte +++ b/src/lib/components/Preview.svelte @@ -4,6 +4,7 @@ import { CaretDownSolid, CaretUpSolid, EditOutline } from 'flowbite-svelte-icons'; import Self from './Preview.svelte'; import { contentParagraph, sectionHeading } from '$lib/snippets/PublicationSnippets.svelte'; + import BlogHeader from "./blog/BlogHeader.svelte"; // TODO: Fix move between parents. @@ -93,6 +94,10 @@ } }); + function getBlogEvent(index: number) { + return blogEntries[index][1]; + } + function byline(rootId: string, index: number) { console.log(rootId, index, blogEntries); const event = blogEntries[index][1]; @@ -198,7 +203,7 @@ {#snippet sectionHeading(title: string, depth: number)} {@const headingLevel = Math.min(depth + 1, 6)} {@const className = $pharosInstance.isFloatingTitle(rootId) ? 'discrete' : 'h-leather'} - + {title} @@ -221,12 +226,6 @@

{/snippet} -{#snippet readMoreLink(rootId: string, index: number)} -

- -

-{/snippet} - {#snippet contentParagraph(content: string, publicationType: string)} {#if publicationType === 'novel'}

@@ -294,17 +293,13 @@ {:else} - {#if publicationType === 'blog' && depth === 1} - {@render coverImage(rootId, index, depth)} - {@render sectionHeading(title!, depth)} - {@render blogMetadata(rootId, index)} - {:else} + {#if !(publicationType === 'blog' && depth === 1)} {@render sectionHeading(title!, depth)} {/if} {/if} {#if publicationType === 'blog' && depth === 1} - {@render readMoreLink(rootId, index)} + {:else } {#key subtreeUpdateCount} {#each orderedChildren as id, index} diff --git a/src/lib/components/Publication.svelte b/src/lib/components/Publication.svelte index e917ff1..8d62ac5 100644 --- a/src/lib/components/Publication.svelte +++ b/src/lib/components/Publication.svelte @@ -1,8 +1,6 @@ {#if $publicationColumnVisibility.details} -

-
+
+
+
+
{/if} @@ -50,6 +49,10 @@ {publicationType === 'blog' ? 'max-w-xl flex-grow-1' : 'max-w-2xl flex-grow-2' } {currentBlog !== null ? 'discreet' : ''} "> +
+
+
+
{/if} @@ -63,8 +66,8 @@ {/if} {#if $publicationColumnVisibility.social } -
-

Social column

+
+
{/if} diff --git a/src/lib/components/blog/BlogHeader.svelte b/src/lib/components/blog/BlogHeader.svelte new file mode 100644 index 0000000..276b206 --- /dev/null +++ b/src/lib/components/blog/BlogHeader.svelte @@ -0,0 +1,65 @@ + + +{#if title != null} + +
+
+ + {publishedAt()} +
+ {#if image} +
+ +
+ {/if} +
+ + +
+
+
+
{likeCount}
+
{likeCount}
+
{likeCount}
+
{likeCount}
+
{likeCount}
+ +
+
+
+
+{/if} diff --git a/src/lib/components/util/ArticleNav.svelte b/src/lib/components/util/ArticleNav.svelte index 5049c7e..f810d39 100644 --- a/src/lib/components/util/ArticleNav.svelte +++ b/src/lib/components/util/ArticleNav.svelte @@ -1,24 +1,42 @@ -
\ No newline at end of file diff --git a/src/lib/components/util/Details.svelte b/src/lib/components/util/Details.svelte index df12ee6..a1b4bb2 100644 --- a/src/lib/components/util/Details.svelte +++ b/src/lib/components/util/Details.svelte @@ -37,18 +37,18 @@ {#if summary} -
+

{summary}

{/if} -
+

Index author:

{#if source !== null} -
Source: {source}
+
Source: {source}
{/if} {#if type !== null}
Publication type: {type}
diff --git a/src/routes/publication/+page.svelte b/src/routes/publication/+page.svelte index 697ca4e..486a655 100644 --- a/src/routes/publication/+page.svelte +++ b/src/routes/publication/+page.svelte @@ -51,10 +51,10 @@ {#key data} - + {/key} -
+
{#await data.waitable} {:then}