forked from hoppscotch/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImage.vue
63 lines (58 loc) · 1.09 KB
/
Image.vue
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
<script setup>
defineProps({
src: {
type: String,
required: true,
},
alt: {
type: String,
required: true,
},
extension: {
type: String,
required: true,
},
styles: {
type: String,
required: false,
default: "",
},
zoomable: {
type: Boolean,
required: false,
default: true,
},
mode: {
type: Boolean,
required: false,
default: true,
},
})
const colorMode = useColorMode()
</script>
<template>
<p style="margin: var(--prose-li-margin)">
<img
v-if="!colorMode.unknown"
:src="`/images/${
mode ? `${src}-${colorMode.value}.${extension}` : `${src}.${extension}`
}`"
:alt="alt"
:class="{ 'image-zoomable': zoomable }"
:style="styles"
>
</p>
</template>
<style>
.image-zoomable {
border: 1px solid var(--elements-border-secondary-static) !important;
border-radius: var(--radii-xs) !important;
}
.medium-zoom-overlay {
background-color: var(--docus-body-backgroundColor) !important;
z-index: 999 !important;
}
.medium-zoom-image--opened {
z-index: 1000 !important;
}
</style>