mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-04-30 18:59:31 +08:00
refactor: ♻️ weaken the action buttons
This commit is contained in:
parent
3b91c65936
commit
ea843494dd
5 changed files with 24 additions and 18 deletions
5
src/lib/components/actions/1-comment.svelte
Normal file
5
src/lib/components/actions/1-comment.svelte
Normal file
|
@ -0,0 +1,5 @@
|
|||
<button class="tooltip tooltip-left opacity-60 hover:opacity-100" data-tip="Jump to comments">
|
||||
<a href="#post-comment" class="btn btn-circle btn-ghost hover:bg-red-10">
|
||||
<span class="i-heroicons-outline-chat-alt-2" />
|
||||
</a>
|
||||
</button>
|
|
@ -1,3 +0,0 @@
|
|||
<a href="#post-comment" class="btn btn-lg btn-circle btn-ghost bg-base-100 shadow-lg hover:shadow-xl">
|
||||
<span class="i-heroicons-outline-chat-alt-2" />
|
||||
</a>
|
|
@ -3,10 +3,12 @@
|
|||
export let post: Urara.Post
|
||||
</script>
|
||||
|
||||
<a
|
||||
href={`https://translate.google.com/translate?sl=auto&tl=${
|
||||
navigator.languages ? navigator.languages[0] : navigator.language
|
||||
}&u=${site.protocol + site.domain + post.path}`}
|
||||
class="btn btn-lg btn-circle btn-ghost bg-base-100 shadow-lg hover:shadow-xl">
|
||||
<span class="i-heroicons-outline-translate" />
|
||||
</a>
|
||||
<button class="tooltip tooltip-left opacity-60 hover:opacity-100" data-tip="Translate">
|
||||
<a
|
||||
href={`https://translate.google.com/translate?sl=auto&tl=${
|
||||
navigator.languages ? navigator.languages[0] : navigator.language
|
||||
}&u=${site.protocol + site.domain + post.path}`}
|
||||
class="btn btn-circle btn-ghost">
|
||||
<span class="i-heroicons-outline-translate" />
|
||||
</a>
|
||||
</button>
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
export let post: Urara.Post
|
||||
</script>
|
||||
|
||||
<a
|
||||
href={`https://www.addtoany.com/share#url=${site.protocol + site.domain + post.path}&title=${encodeURI(
|
||||
post.title ?? post.path.slice(1)
|
||||
)}`}
|
||||
class="btn btn-lg btn-circle btn-ghost bg-base-100 shadow-lg hover:shadow-xl">
|
||||
<span class="i-heroicons-outline-share" />
|
||||
</a>
|
||||
<button class="tooltip tooltip-left opacity-60 hover:opacity-100" data-tip="Share">
|
||||
<a
|
||||
href={`https://www.addtoany.com/share#url=${site.protocol + site.domain + post.path}&title=${encodeURI(
|
||||
post.title ?? post.path.slice(1)
|
||||
)}`}
|
||||
class="btn btn-circle btn-ghost">
|
||||
<span class="i-heroicons-outline-share" />
|
||||
</a>
|
||||
</button>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const actions = import.meta.glob<any>('/src/lib/components/actions/*.svelte', { eager: true, import: 'default' })
|
||||
</script>
|
||||
|
||||
<div class="sticky top-24 hidden xl:flex flex-col gap-4 w-fit h-[calc(100vh-12rem)] ml-auto mr-8 my-8 justify-center">
|
||||
<div class="sticky top-24 hidden xl:flex flex-col gap-4 w-fit max-h-[calc(100vh-12rem)] ml-auto mr-6 my-8 justify-center ">
|
||||
{#if Object.keys(actions).length}
|
||||
{#each Object.values(actions) as action}
|
||||
<svelte:component this={action} {post} />
|
||||
|
|
Loading…
Reference in a new issue