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

View file

@ -1,7 +1,7 @@
---
interface Props {
title: string;
description: string;
title: string;
description: string;
}
const { title, description } = Astro.props;
@ -10,62 +10,62 @@ import { ViewTransitions } from "astro:transitions";
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content={description} />
<meta name="viewport" content="width=device-width" /><meta
name="keywords"
content="Rython, student, developer, frontend, web developer, streamer, coworking"
/>
<meta name="author" content="RythonDev" />
<meta name="theme-color" content="#2B2D31" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body>
<slot />
<ViewTransitions />
</body>
<head>
<meta charset="UTF-8" />
<meta name="description" content={description} />
<meta name="viewport" content="width=device-width" /><meta
name="keywords"
content="Rython, student, developer, frontend, web developer, streamer, coworking"
/>
<meta name="author" content="RythonDev" />
<meta name="theme-color" content="#2B2D31" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body>
<slot />
<ViewTransitions />
</body>
</html>
<style is:global>
@font-face {
font-family: "Fredoka";
src: url("/fonts/Fredoka-Regular.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "Fredoka";
src: url("/fonts/Fredoka-Regular.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
/* Montserrat Fonts */
@font-face {
font-family: "Montserrat";
src: url("/fonts/Montserrat-Bold.ttf") format("truetype");
font-weight: bold;
font-style: normal;
}
/* Montserrat Fonts */
@font-face {
font-family: "Montserrat";
src: url("/fonts/Montserrat-Bold.ttf") format("truetype");
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: "Montserrat";
src: url("/fonts/Montserrat-Regular.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "Montserrat";
src: url("/fonts/Montserrat-Regular.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
html {
scroll-behavior: smooth;
}
html {
scroll-behavior: smooth;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Montserrat", sans-serif;
color: #fff;
background: radial-gradient(circle, #383838 1px, transparent 1px),
#202020;
background-size: 20px 20px;
}
body {
font-family: "Montserrat", sans-serif;
color: #fff;
background: radial-gradient(circle, #383838 1px, transparent 1px),
#202020;
background-size: 20px 20px;
}
</style>

View file

@ -19,7 +19,11 @@ import Footer from "../components/sections/FooterComponent.astro";
<NavBar />
<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]">
<Card bgColor="#252525" primaryColor="#BEADFA">
<Card
bgColor="#252525"
primaryColor="#BEADFA"
className="animate-fadeIn"
>
<Intro client:load />
</Card>
</div>

View file

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