refactor: ♻️ weaken the action buttons

This commit is contained in:
sevichecc 2023-01-30 17:28:52 +08:00
parent 3c28b61096
commit 1a32b7e9b8
5 changed files with 24 additions and 18 deletions

View 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>

View file

@ -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>

View file

@ -3,10 +3,12 @@
export let post: Urara.Post export let post: Urara.Post
</script> </script>
<a <button class="tooltip tooltip-left opacity-60 hover:opacity-100" data-tip="Translate">
<a
href={`https://translate.google.com/translate?sl=auto&tl=${ href={`https://translate.google.com/translate?sl=auto&tl=${
navigator.languages ? navigator.languages[0] : navigator.language navigator.languages ? navigator.languages[0] : navigator.language
}&u=${site.protocol + site.domain + post.path}`} }&u=${site.protocol + site.domain + post.path}`}
class="btn btn-lg btn-circle btn-ghost bg-base-100 shadow-lg hover:shadow-xl"> class="btn btn-circle btn-ghost">
<span class="i-heroicons-outline-translate" /> <span class="i-heroicons-outline-translate" />
</a> </a>
</button>

View file

@ -3,10 +3,12 @@
export let post: Urara.Post export let post: Urara.Post
</script> </script>
<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( href={`https://www.addtoany.com/share#url=${site.protocol + site.domain + post.path}&title=${encodeURI(
post.title ?? post.path.slice(1) post.title ?? post.path.slice(1)
)}`} )}`}
class="btn btn-lg btn-circle btn-ghost bg-base-100 shadow-lg hover:shadow-xl"> class="btn btn-circle btn-ghost">
<span class="i-heroicons-outline-share" /> <span class="i-heroicons-outline-share" />
</a> </a>
</button>

View file

@ -3,7 +3,7 @@
const actions = import.meta.glob<any>('/src/lib/components/actions/*.svelte', { eager: true, import: 'default' }) const actions = import.meta.glob<any>('/src/lib/components/actions/*.svelte', { eager: true, import: 'default' })
</script> </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} {#if Object.keys(actions).length}
{#each Object.values(actions) as action} {#each Object.values(actions) as action}
<svelte:component this={action} {post} /> <svelte:component this={action} {post} />