mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-02-02 21:31:32 +01:00
Add top and copy buttons
This commit is contained in:
@@ -12,6 +12,20 @@ useSeoMeta({
|
|||||||
description: project.value?.description,
|
description: project.value?.description,
|
||||||
author: 'Arthur Danjou',
|
author: 'Arthur Danjou',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function top() {
|
||||||
|
window.scrollTo({
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
behavior: 'smooth',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const { copy, copied } = useClipboard({
|
||||||
|
source: `https://arthurdanjou.fr/writings/${route.params.slug}`,
|
||||||
|
copiedDuring: 4000,
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -90,7 +104,37 @@ useSeoMeta({
|
|||||||
:value="project"
|
:value="project"
|
||||||
class="!max-w-none prose dark:prose-invert"
|
class="!max-w-none prose dark:prose-invert"
|
||||||
/>
|
/>
|
||||||
<PostFooter />
|
<div class="space-y-4 mt-16">
|
||||||
|
<PostFooter />
|
||||||
|
<div class="flex gap-4 items-center flex-wrap">
|
||||||
|
<UButton
|
||||||
|
color="neutral"
|
||||||
|
icon="i-ph-arrow-fat-lines-up-duotone"
|
||||||
|
:label="t('top')"
|
||||||
|
size="lg"
|
||||||
|
variant="outline"
|
||||||
|
@click.prevent="top()"
|
||||||
|
/>
|
||||||
|
<UButton
|
||||||
|
v-if="copied"
|
||||||
|
color="green"
|
||||||
|
icon="i-ph-check-square-duotone"
|
||||||
|
:label="t('link.copied')"
|
||||||
|
size="lg"
|
||||||
|
variant="outline"
|
||||||
|
@click.prevent="copy()"
|
||||||
|
/>
|
||||||
|
<UButton
|
||||||
|
v-else
|
||||||
|
color="neutral"
|
||||||
|
icon="i-ph-square-duotone"
|
||||||
|
:label="t('link.copy')"
|
||||||
|
size="lg"
|
||||||
|
variant="outline"
|
||||||
|
@click.prevent="copy()"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user