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