-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e92ca32
commit 30b1d7d
Showing
9 changed files
with
799 additions
and
6 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
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,8 @@ | ||
<!-- components/content/Card.vue --> | ||
<template> | ||
<div | ||
class="pb-4 pt-4 mt-6 border-t-2 border-b-2 border-typography_primary_light dark:border-typography_primary_dark blog-content blog-post-text" | ||
> | ||
<slot /> | ||
</div> | ||
</template> |
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,77 @@ | ||
<!-- components/content/Card.vue --> | ||
<template> | ||
<div | ||
class="overflow-hidden border-t border-b mt-4 border-typography_primary_light dark:border-typography_primary_dark" | ||
> | ||
<div | ||
class="py-1 cursor-pointer select-none font-bold basic-expand-header flex no-anchor" | ||
@click="() => (open = !open)" | ||
> | ||
<span | ||
:class="[ | ||
'flex flex-shrink px-1 transition-transform duration-200 w-6 justify-center font-highlight text-lg', | ||
open ? 'rotate-180 mb-[2px]' : 'rotate-0', | ||
]" | ||
> | ||
{{ open ? '-' : '+' }} | ||
</span> | ||
<component | ||
:is="componentType" | ||
:id="id" | ||
class="flex flex-grow flex-shrink" | ||
> | ||
{{ heading }} | ||
</component> | ||
</div> | ||
|
||
<Transition name="expand"> | ||
<div class="basic-expand-content pb-2" ref="expanded" v-show="open"> | ||
<slot name="description" /> | ||
</div> | ||
</Transition> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
const open = ref(false); | ||
|
||
const props = withDefaults( | ||
defineProps<{ | ||
heading?: string; | ||
componentType?: string; | ||
}>(), | ||
{ heading: '', componentType: 'h3' } | ||
); | ||
|
||
const id = props.heading | ||
.toLowerCase() | ||
.replace(/\s+/g, ' ') | ||
.replace(/[^\s\w\d]/g, '') | ||
.replace(/[^\w\d]/g, '-'); | ||
</script> | ||
|
||
<style> | ||
.expand-enter-active { | ||
animation: expand reverse 200ms ease; | ||
} | ||
.expand-leave-active { | ||
animation: expand 200ms ease; | ||
} | ||
@keyframes expand { | ||
from { | ||
max-height: 600px; | ||
} | ||
to { | ||
max-height: 0px; | ||
} | ||
} | ||
|
||
.basic-expand-header > h1, | ||
.basic-expand-header > h2, | ||
.basic-expand-header > h3, | ||
.basic-expand-header > h4, | ||
.basic-expand-header > h5 { | ||
@apply mt-0 mb-0 text-lg; | ||
} | ||
</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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Binary file not shown.
Binary file not shown.
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