11<script setup lang="ts">
2- import { computed } from ' vue'
3- import { NuxtImg } from ' #components'
4-
52interface Props {
63 src: string
74 alt: string
@@ -10,22 +7,6 @@ interface Props {
107
118const props = defineProps <Props >()
129
13- const month = new Date ().getMonth () + 1
14-
15- const season = computed (() => {
16- if ([12 , 1 , 2 ].includes (month )) return ' winter'
17- if ([3 , 4 , 5 ].includes (month )) return ' spring'
18- if ([6 , 7 , 8 ].includes (month )) return ' summer'
19- return ' autumn'
20- })
21-
22- const seasonalHats: Record <string , string > = {
23- winter: ' /avatars/winter.png' ,
24- spring: ' /avatars/spring.png' ,
25- summer: ' /avatars/summer.png' ,
26- autumn: ' /avatars/autumn.png'
27- }
28-
2910const size = computed (() => props .size ?? 112 )
3011 </script >
3112
@@ -34,23 +15,13 @@ const size = computed(() => props.size ?? 112)
3415 :style =" { width: size + 'px', height: size + 'px' }"
3516 class =" relative"
3617 >
37- <!-- <NuxtImg -->
38- <!-- :src="props.src" -->
39- <!-- :alt="props.alt" -->
40- <!-- :width="size" -->
41- <!-- :height="size" -->
42- <!-- format="webp" -->
43- <!-- class="rounded-full border border-muted w-full h-full" -->
44- <!-- /> -->
45-
4618 <NuxtImg
47- v-if =" season"
48- :src =" seasonalHats[season]"
19+ :src =" props.src"
4920 :alt =" props.alt"
5021 :width =" size"
5122 :height =" size"
5223 format =" webp"
53- class =" rounded-full border border-muted w-full h-full pointer-events-none select-none "
24+ class =" rounded-full border border-muted w-full h-full"
5425 />
5526 </div >
5627</template >
0 commit comments