-
-
Notifications
You must be signed in to change notification settings - Fork 427
Expand file tree
/
Copy pathLogoImg.vue
More file actions
47 lines (47 loc) · 980 Bytes
/
LogoImg.vue
File metadata and controls
47 lines (47 loc) · 980 Bytes
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
<script setup lang="ts">
const props = defineProps<{
src:
| string
| {
dark: string
light: string
}
alt: string
}>()
</script>
<template>
<div v-if="typeof src === 'string'" class="h-full">
<img
:src="src"
loading="lazy"
height="36"
class="h-full w-full object-contain block"
:alt="alt"
/>
</div>
<div v-else-if="src.light === 'auto'" class="h-full">
<img
:src="src.dark"
loading="lazy"
height="36"
class="h-full w-full object-contain block light:invert light:grayscale"
:alt="alt"
/>
</div>
<div v-else class="h-full">
<img
:src="src.dark"
loading="lazy"
height="36"
class="h-full w-full object-contain block light:hidden"
:alt="alt"
/>
<img
:src="src.light"
loading="lazy"
height="36"
class="h-full w-full object-contain block hidden light:block"
:alt="alt"
/>
</div>
</template>