Linted code

This commit is contained in:
2025-07-29 15:24:29 +00:00
parent 8b4e8553a4
commit 4ab0dad6a0
11 changed files with 57 additions and 53 deletions

View File

@@ -1,12 +1,14 @@
<script lang="ts" setup>
import { navColors, type NavColor } from '~~/types'
import type { NavColor } from '~~/types'
import { navColors } from '~~/types'
const route = useRoute()
const colorMode = useColorMode()
const colors = computed((): NavColor[] => {
const navColor = navColors.find(nav => route.name === nav.name)
if (navColor?.colors) return navColor.colors
if (navColor?.colors)
return navColor.colors
const fallbackColor = colorMode.value === 'dark' ? '#000000' : '#ffffff'
const fallbackGradient = { color: fallbackColor, x: 0, y: 0, radius: 0 }
@@ -15,14 +17,14 @@ const colors = computed((): NavColor[] => {
const backgroundStyle = computed(() => {
const gradients = colors.value
.map(({ color, radius, x, y }) =>
`radial-gradient(circle ${radius}px at ${x}% ${y}%, ${color}4D, transparent)`
.map(({ color, radius, x, y }) =>
`radial-gradient(circle ${radius}px at ${x}% ${y}%, ${color}4D, transparent)`,
)
.join(', ')
return {
backgroundImage: gradients,
backgroundSize: Array(colors.value.length).fill('100% 100%').join(', ')
backgroundSize: Array.from({ length: colors.value.length }).fill('100% 100%').join(', '),
}
})
</script>

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup>
defineProps({
title: {
type: Object as PropType<{ en: string; fr: string; es: string }>,
type: Object as PropType<{ en: string, fr: string, es: string }>,
required: true,
},
})