-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(head): improve and added test pages
- Loading branch information
1 parent
ef9a49e
commit 2d4c28c
Showing
12 changed files
with
246 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
<template> | ||
<component | ||
:is="tag" | ||
v-font="$getFont('Quicksand', 700, 'normal')" | ||
class="element-headline" | ||
> | ||
<component :is="tag" v-font="preparedFont" class="element-headline"> | ||
<slot>{{ content }}</slot> | ||
</component> | ||
</template> | ||
|
||
<script setup> | ||
import { useBoosterFonts } from '#imports'; | ||
const { $getFont } = useBoosterFonts(); | ||
</script> | ||
<script> | ||
export default { | ||
props: { | ||
tag: { | ||
type: String, | ||
default: 'h1' | ||
}, | ||
content: { | ||
type: String, | ||
default: 'Headline' | ||
} | ||
const $props = defineProps({ | ||
tag: { | ||
type: String, | ||
default: 'h1' | ||
}, | ||
content: { | ||
type: String, | ||
default: 'Headline' | ||
}, | ||
font: { | ||
type: Object, | ||
default: undefined | ||
} | ||
}); | ||
const preparedFont = computed(() => { | ||
if ($props.font) { | ||
return $props.font; | ||
} | ||
}; | ||
return $getFont('Quicksand', 700, 'normal'); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<template> | ||
<base-headline :font="$getFont('Montserrat Alternates')"> | ||
<slot /> | ||
</base-headline> | ||
</template> | ||
|
||
<script setup> | ||
import BaseHeadline from '@/components/base/Headline'; | ||
const { $getFont } = useBoosterFonts(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<template> | ||
<base-headline :font="$getFont('Merriweather')"> | ||
<slot /> | ||
</base-headline> | ||
</template> | ||
|
||
<script setup> | ||
import BaseHeadline from '@/components/base/Headline'; | ||
const { $getFont } = useBoosterFonts(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<template> | ||
<base-headline :font="$getFont('Quicksand')"> | ||
<slot /> | ||
</base-headline> | ||
</template> | ||
|
||
<script setup> | ||
import BaseHeadline from '@/components/base/Headline'; | ||
const { $getFont } = useBoosterFonts(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<template> | ||
<div> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<style lang="postcss"> | ||
.page-enter-active, | ||
.page-leave-active { | ||
transition: all 0.8s; | ||
} | ||
.page-enter-from, | ||
.page-leave-to { | ||
opacity: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<div class="test-transition"> | ||
<nuxt-link to="/tests/useBoosterHead">Transition 1</nuxt-link> | | ||
<nuxt-link to="/tests/useBoosterHead/1">Transition 2</nuxt-link> | | ||
<nuxt-link to="/tests/useBoosterHead/2">Transition 3</nuxt-link> | ||
<div> | ||
<test-headline-b critical>Transition 2</test-headline-b> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import TestHeadlineB from '@/components/tests/TestHeadlineB'; | ||
definePageMeta({ | ||
layout: 'transition', | ||
pageTransition: { | ||
name: 'page', | ||
mode: 'out-in' | ||
} | ||
}); | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
.fade-enter-active { | ||
transition: opacity 0.5s ease; | ||
} | ||
.fade-leave-active { | ||
transition: opacity 2s ease; | ||
} | ||
.fade-enter-from, | ||
.fade-leave-to { | ||
opacity: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<div class="test-transition"> | ||
<nuxt-link to="/tests/useBoosterHead">Transition 1</nuxt-link> | | ||
<nuxt-link to="/tests/useBoosterHead/1">Transition 2</nuxt-link> | | ||
<nuxt-link to="/tests/useBoosterHead/2">Transition 3</nuxt-link> | ||
<div> | ||
<test-headline-c critical>Transition 3</test-headline-c> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import TestHeadlineC from '@/components/tests/TestHeadlineC'; | ||
definePageMeta({ | ||
layout: 'transition', | ||
pageTransition: { | ||
name: 'page', | ||
mode: 'out-in' | ||
} | ||
}); | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
.fade-enter-active { | ||
transition: opacity 0.5s ease; | ||
} | ||
.fade-leave-active { | ||
transition: opacity 2s ease; | ||
} | ||
.fade-enter-from, | ||
.fade-leave-to { | ||
opacity: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<div class="test-transition"> | ||
<nuxt-link to="/tests/useBoosterHead">Transition 1</nuxt-link> | | ||
<nuxt-link to="/tests/useBoosterHead/1">Transition 2</nuxt-link> | | ||
<nuxt-link to="/tests/useBoosterHead/2">Transition 3</nuxt-link> | ||
<div> | ||
<test-headline-a critical>Transition 1</test-headline-a> | ||
<Transition name="fade"> | ||
<test-headline-b v-if="show">Transition 1.1</test-headline-b> | ||
</Transition> | ||
<button @click="show = !show">Click here</button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import TestHeadlineA from '@/components/tests/TestHeadlineA'; | ||
import TestHeadlineB from '@/components/tests/TestHeadlineB'; | ||
const show = ref(false); | ||
definePageMeta({ | ||
layout: 'transition', | ||
pageTransition: { | ||
name: 'page', | ||
mode: 'out-in' | ||
} | ||
}); | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
.fade-enter-active, | ||
.fade-leave-active { | ||
transition: opacity 0.8s ease; | ||
} | ||
.fade-enter-from, | ||
.fade-leave-to { | ||
opacity: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.