forked from labex-labs/python-cheatsheet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseTitle.vue
More file actions
60 lines (56 loc) · 1.55 KB
/
BaseTitle.vue
File metadata and controls
60 lines (56 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<script setup lang="ts">
const { share, isSupported } = useShare()
const props = defineProps<{
title: string
description: string
}>()
function startShare() {
share({
title: props.title,
text: props.description,
url: location.href,
})
}
</script>
<template>
<div
class="not-prose group mb-8 grid w-full grid-cols-12 content-center leading-[1.1111111]"
>
<h1
class="doc-title col-span-11 text-[2.25em] font-medium text-slate-900 dark:text-white"
>
<slot />
</h1>
<div
class="flex w-full justify-end text-slate-400 opacity-0 transition duration-200 group-hover:opacity-100"
>
<button
v-if="isSupported"
class="transition duration-200 hover:text-primary-500"
@click="startShare"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
class="h-5 w-5"
>
<path
fill-rule="evenodd"
d="M15.75 4.5a3 3 0 11.825 2.066l-8.421 4.679a3.002 3.002 0 010 1.51l8.421 4.679a3 3 0 11-.729 1.31l-8.421-4.678a3 3 0 110-4.132l8.421-4.679a3 3 0 01-.096-.755z"
clip-rule="evenodd"
/>
</svg>
<span class="sr-only">Share</span>
</button>
</div>
</div>
</template>
<style scoped>
.doc-title {
font-family: Lexend, ui-sans-serif, system-ui, -apple-system,
BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans,
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', Segoe UI Symbol,
'Noto Color Emoji';
}
</style>