-
-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathCommentAnnotationItem.vue
More file actions
87 lines (79 loc) · 1.98 KB
/
CommentAnnotationItem.vue
File metadata and controls
87 lines (79 loc) · 1.98 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<script setup lang="ts">
import { ref } from 'vue'
import FloatingUserAvatar from './FloatingUserAvatar.vue'
const props = defineProps<{
element: HTMLElement
}>()
const commentUsers = ref<{
id: number
avatarUrl: string
}[]>([
{
id: 1,
avatarUrl: 'https://source.unsplash.com/random',
},
{
id: 1,
avatarUrl: 'https://source.unsplash.com/random',
},
{
id: 1,
avatarUrl: 'https://source.unsplash.com/random',
},
])
</script>
<template>
<Teleport :to="props.element">
<button
class="sidecar-annotations-comments sidecar-annotations-comments-show-comment-btn"
:style="{
width: `${(commentUsers.length - 1) * 1 + 1.5}rem`,
}"
aria-hidden="true"
focusable="false"
absolute
rounded-full flex
h-5
>
<FloatingUserAvatar
v-for="(user, index) of commentUsers"
:key="index"
:src="user.avatarUrl"
:style="{
order: `${index + 1}`,
'margin-left': `${index === 0 ? 0 : -0.5}rem`,
}"
/>
</button>
<!-- <button
:style="boxStyles"
aria-hidden="true"
focusable="false"
fixed z-50
class="sidecar-annotations-controls"
p-1.5
rounded-full
shadow="md hover:lg active:sm"
bg="white"
border="1 solid zinc-100"
items-center justify-center
>
<div class="sidecar-annotations-control-comment i-tabler:message-circle-plus" w-5 h-5 />
</button> -->
</Teleport>
</template>
<style>
.VPDoc .container .content .content-container main .vp-doc > div > * {
position: relative;
}
.VPDoc .container .content .content-container main .vp-doc div[class*='language-'], .vp-block {
overflow-x: unset;
}
.VPDoc .container .content .content-container main .vp-doc > div .sidecar-annotations-comments-show-comment-btn {
top: 0;
left: -60px;
}
.VPDoc .container .content .content-container main .vp-doc > div > h2 .sidecar-annotations-comments-show-comment-btn {
top: 24px;
}
</style>