Skip to content

Commit

Permalink
use plugin to declare timeline keyframes
Browse files Browse the repository at this point in the history
  • Loading branch information
Trombach committed Oct 5, 2024
1 parent 29287ee commit ade6495
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
14 changes: 0 additions & 14 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,6 @@ const { title, description = "Lukas' Homepage" } = Astro.props;
p {
@apply max-w-[70ch] text-pretty;
}

@keyframes slide-scale-in-bottom {
from {
transform: translateY(100px);
scale: 0.8;
opacity: 0;
}
,
to {
transform: translateY(0);
scale: 1;
opacity: 1;
}
}
}
</style>
</body>
Expand Down
17 changes: 16 additions & 1 deletion tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const animationDelay = plugin(({ matchUtilities, theme }) => {
);
});

const timelineAnimation = plugin(({ addComponents }) => {
const timelineAnimation = plugin(({ addComponents, addUtilities }) => {
addComponents({
".timeline-slide-in-bottom": {
"animation-timeline": "view()",
Expand All @@ -27,6 +27,21 @@ const timelineAnimation = plugin(({ addComponents }) => {
"animation-fill-mode": "both",
},
});

addUtilities({
"@keyframes slide-scale-in-bottom": {
from: {
transform: "translateY(100px)",
scale: "0.8",
opacity: "0",
},
to: {
transform: "translateY(0)",
scale: "1",
opacity: "1",
},
},
});
});

const textShadow = plugin(({ matchUtilities, theme }) => {
Expand Down

0 comments on commit ade6495

Please sign in to comment.