-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from selemondev/feat/add-blur-in-component
feat: add blur in component
- Loading branch information
Showing
5 changed files
with
93 additions
and
4 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,40 @@ | ||
<script setup lang='ts'> | ||
import { cn } from '../../../lib/utils' | ||
interface BlurIntProps { | ||
word: string | ||
class?: string | ||
variant?: { | ||
hidden: { filter: string, opacity: number } | ||
visible: { filter: string, opacity: number } | ||
} | ||
duration?: number | ||
}; | ||
const props = withDefaults(defineProps<BlurIntProps>(), { | ||
duration: 500, | ||
}) | ||
const defaultVariants = { | ||
hidden: { filter: 'blur(10px)', opacity: 0 }, | ||
visible: { | ||
filter: 'blur(0px)', | ||
opacity: 1, | ||
transition: { | ||
duration: props.duration, | ||
}, | ||
}, | ||
} | ||
const combinedVariants = props.variant || defaultVariants | ||
const className = cn( | ||
'font-display text-center text-4xl font-bold tracking-[-0.02em] drop-shadow-sm md:text-7xl md:leading-[5rem]', | ||
props.class, | ||
) | ||
</script> | ||
|
||
<template> | ||
<h1 v-motion :initial="combinedVariants.hidden" :visible="combinedVariants.visible" :class="className"> | ||
{{ props.word }} | ||
</h1> | ||
</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
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,40 @@ | ||
<script setup lang='ts'> | ||
import { cn } from '../../lib/utils' | ||
interface BlurIntProps { | ||
word: string | ||
class?: string | ||
variant?: { | ||
hidden: { filter: string, opacity: number } | ||
visible: { filter: string, opacity: number } | ||
} | ||
duration?: number | ||
}; | ||
const props = withDefaults(defineProps<BlurIntProps>(), { | ||
duration: 500, | ||
}) | ||
const defaultVariants = { | ||
hidden: { filter: 'blur(10px)', opacity: 0 }, | ||
visible: { | ||
filter: 'blur(0px)', | ||
opacity: 1, | ||
transition: { | ||
duration: props.duration, | ||
}, | ||
}, | ||
} | ||
const combinedVariants = props.variant || defaultVariants | ||
const className = cn( | ||
'font-display text-center text-4xl font-bold tracking-[-0.02em] drop-shadow-sm md:text-7xl md:leading-[5rem]', | ||
props.class, | ||
) | ||
</script> | ||
|
||
<template> | ||
<h1 v-motion :initial="combinedVariants.hidden" :visible="combinedVariants.visible" :class="className"> | ||
{{ props.word }} | ||
</h1> | ||
</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,7 @@ | ||
<script setup lang='ts'> | ||
import BlurIn from './BlurIn.vue' | ||
</script> | ||
|
||
<template> | ||
<BlurIn word="Spark UI ✨" class="font-bold text-black dark:text-white" /> | ||
</template> |