Skip to content

Commit

Permalink
Animation Modal: preview fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nirnejak committed May 15, 2024
1 parent 7883c36 commit 808daa6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/AnimationDetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const AnimationDetailsModal: React.FC<Props> = ({
<div className="flex gap-5">
<div className="flex-1">
<div className="rounded-xl bg-zinc-900 text-center px-18 pb-20 pt-24 relative">
<Button variant={color} className={animation.animationClass}>
<Button variant={color} className={animationClassName}>
Click Me
</Button>
<p className="text-zinc-600 absolute left-1/2 bottom-3 -translate-x-1/2 text-sm flex items-center gap-1">
Expand Down
14 changes: 13 additions & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const animationClasses = [
"animate-flash",
"animate-rubber-band",
"animate-shake",
"animate-shake",
"animate-shake",
"animate-swing",
"animate-scale",
"animate-rise",
Expand All @@ -47,14 +49,24 @@ const animationClasses = [
"animate-slide-right-and-fade",
]

const modifiers = ["hover", "focus", "active"]

const animationClassesWithModifier = animationClasses

animationClasses.forEach((cls) => {
modifiers.forEach((m) => {
animationClassesWithModifier.push(`${m}:${cls}`)
})
})

const config: Config = {
content: [
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
],
safelist: [
...animationClasses,
...animationClassesWithModifier,
...usedColors.map((c) => `text-${c}-50`),
...usedColors.map((c) => `text-${c}-100`),
...usedColors.map((c) => `text-${c}-200`),
Expand Down

0 comments on commit 808daa6

Please sign in to comment.