FIX: breaking tech list

Or rather non-breaking tech list
This commit is contained in:
webfussel 2025-06-06 07:24:07 +02:00
parent 2d65119e7e
commit 4726749456
4 changed files with 17 additions and 19 deletions

View file

@ -1,5 +1,5 @@
<template> <template>
<component :is="actualComponent" v-bind="actualProps()" class="Button" :class="[design]"> <component :is="actualComponent" v-bind="actualProps" class="Button" :class="[design]">
<slot /> <slot />
</component> </component>
</template> </template>
@ -7,31 +7,29 @@
<script setup lang="ts"> <script setup lang="ts">
type Props = { type Props = {
type ?: 'NuxtLink' | 'button'
href ?: string href ?: string
design ?: 'default' | 'dark' | 'white' design ?: 'default' | 'dark' | 'white'
} }
const { const {
type = 'NuxtLink', href,
href = '#',
design = 'default', design = 'default',
} = defineProps<Props>() } = defineProps<Props>()
const isExternal = href.startsWith('http') const isExternal = computed(() => href?.startsWith('http'))
const actualComponent = computed(() => { const actualComponent = computed(() => {
if (type === 'NuxtLink') return resolveComponent('NuxtLink') if (href) return resolveComponent('NuxtLink')
return type return 'button'
}) })
const actualProps = () => { const actualProps = computed(() => {
if (type === 'NuxtLink') { if (!href) return
return { return {
to: href, to: href,
target: isExternal ? '_blank' : undefined, target: isExternal.value ? '_blank' : undefined,
external: isExternal, external: isExternal.value,
}
}
} }
})
</script> </script>

View file

@ -13,7 +13,7 @@
</li> </li>
</ul> </ul>
<p v-for="d in desc">{{ d }}</p> <p v-for="d in desc">{{ d }}</p>
<a v-if="link" :href="link" target="_blank">Zur Seite</a> <NuxtLink v-if="link" :to="link" target="_blank" external>Zur Seite</NuxtLink>
</main> </main>
</div> </div>
</article> </article>

View file

@ -7,7 +7,7 @@
<p v-for="(t, i) in skill.text" :class="[i === skill.text.length - 1 && 'bold']">{{t}}</p> <p v-for="(t, i) in skill.text" :class="[i === skill.text.length - 1 && 'bold']">{{t}}</p>
</Card> </Card>
</div> </div>
<Card title="Technologien" titleTag="h3" class="margin-top"> <Card title="Technologien" titleTag="h3" class="margin-top tech-list">
<p>Neben den klassischen Webentwicklungsstandards JavaScript, HTML und CSS biete ich außerdem folgende Technologien.</p> <p>Neben den klassischen Webentwicklungsstandards JavaScript, HTML und CSS biete ich außerdem folgende Technologien.</p>
<ul class="gap-default margin-top-small"> <ul class="gap-default margin-top-small">
<li v-for="tech in technologies"> <li v-for="tech in technologies">

View file

@ -1,8 +1,8 @@
<template> <template>
<div class="Technology flex-col tip-container" :class="[size]"> <div class="Technology flex-col tip-container" :class="[size]">
<a v-if="link" :href="link" target="_blank" rel="noopener noreferrer"> <NuxtLink v-if="link" :to="link" external target="_blank" rel="noopener noreferrer">
<img loading="lazy" :src="img" :alt="altText()" :height="getPixelForSize()" :width="getWidth()" /> <img loading="lazy" :src="img" :alt="altText()" :height="getPixelForSize()" :width="getWidth()" />
</a> </NuxtLink>
<img v-else loading="lazy" :height="getPixelForSize()" :width="getWidth()" :src="img" :alt="altText()"/> <img v-else loading="lazy" :height="getPixelForSize()" :width="getWidth()" :src="img" :alt="altText()"/>
<span class="tip">{{name}}</span> <span class="tip">{{name}}</span>
</div> </div>