add in fade in animation

This commit is contained in:
liyunze 2025-02-08 18:53:19 +08:00
parent 170a9b04b2
commit 80dbbc1d92
4 changed files with 69 additions and 58 deletions

View file

@ -1,9 +1,10 @@
--- ---
interface Props { interface Props {
primaryColor: string; primaryColor: string;
bgColor?: string | undefined; bgColor?: string;
scaleOnHover?: boolean | undefined; scaleOnHover?: boolean;
pixelHeight?: string | undefined; pixelHeight?: string;
className?: string;
} }
const { const {
@ -11,10 +12,11 @@ const {
bgColor = "#282828", bgColor = "#282828",
scaleOnHover = false, scaleOnHover = false,
pixelHeight = "70px", pixelHeight = "70px",
className = "",
} = Astro.props; } = Astro.props;
--- ---
<div class="card z-10" class:list={[{ scale: scaleOnHover }]}> <div class="card z-10" class:list={[{ scale: scaleOnHover }, className]}>
<slot /> <slot />
</div> </div>

View file

@ -19,7 +19,11 @@ import Footer from "../components/sections/FooterComponent.astro";
<NavBar /> <NavBar />
<div id="home" class="pt-20 flex justify-center items-center"> <div id="home" class="pt-20 flex justify-center items-center">
<div class="w-[90%] xl:w-1/2 lg:w-1/2 max-w-[1080px]"> <div class="w-[90%] xl:w-1/2 lg:w-1/2 max-w-[1080px]">
<Card bgColor="#252525" primaryColor="#BEADFA"> <Card
bgColor="#252525"
primaryColor="#BEADFA"
className="animate-fadeIn"
>
<Intro client:load /> <Intro client:load />
</Card> </Card>
</div> </div>

View file

@ -15,9 +15,14 @@ module.exports = {
"background-position": "0% 50%", "background-position": "0% 50%",
}, },
}, },
fadeIn: {
"0%": { opacity: 0 },
"100%": { opacity: 1 },
},
}, },
animation: { animation: {
gradient: "gradient 15s ease infinite", gradient: "gradient 15s ease infinite",
fadeIn: "fadeIn 1s ease",
}, },
}, },
}, },