mirror of
https://github.com/mikkelsvartveit/astro-personal-website.git
synced 2025-12-22 11:12:38 +00:00
Fix view counter
This commit is contained in:
parent
6edd8ba2cf
commit
7caeb6a0c9
2 changed files with 22 additions and 19 deletions
|
|
@ -15,23 +15,24 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<span class="inline-flex items-center space-x-1">
|
{#if counter !== null}
|
||||||
<span class="px-1">⋅</span>
|
<span
|
||||||
|
class="inline-flex items-center space-x-1"
|
||||||
|
transition:fade={{ duration: 200, easing: expoIn }}
|
||||||
|
>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" height="12">
|
||||||
|
<!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
|
||||||
|
<style>
|
||||||
|
svg {
|
||||||
|
fill: currentColor;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" height="12">
|
<path
|
||||||
<!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
|
d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"
|
||||||
<style>
|
/>
|
||||||
svg {
|
</svg>
|
||||||
fill: currentColor;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<path
|
<span>{counter}</span>
|
||||||
d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"
|
</span>
|
||||||
/>
|
{/if}
|
||||||
</svg>
|
|
||||||
|
|
||||||
{#if counter !== null}
|
|
||||||
<span transition:fade={{ duration: 200, easing: expoIn }}>{counter}</span>
|
|
||||||
{/if}
|
|
||||||
</span>
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,9 @@ const title = headings[0].text;
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<ArticleViewCounter articleSlug={project.slug} client:load />
|
<span class="px-2">⋅</span>
|
||||||
|
|
||||||
|
<ArticleViewCounter articleSlug={project.slug} client:only="svelte" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ProseLayout>
|
<ProseLayout>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue