Skip to content

Commit 1519078

Browse files
committed
finally!!!!i finished it question is the next do not change fonts url
1 parent bcdcf9d commit 1519078

37 files changed

+55
-64
lines changed

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ jobs:
3333
uses: JamesIves/github-pages-deploy-action@v4
3434
with:
3535
branch: build
36-
folder: dist
36+
folder: out

app/globals.css

+13-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
@font-face {
3232
font-family: SuperLobster;
33-
src: url(/fonts/SuperLobster.ttf);
33+
src: url(/fonts/SuperLobster.otf);
3434
font-weight: normal;
3535
font-style: normal;
3636
}
@@ -42,6 +42,18 @@
4242
font-style: normal;
4343
}
4444

45+
@keyframes fade-in {
46+
from {
47+
opacity: 0;
48+
}
49+
to {
50+
opacity: 1;
51+
}
52+
}
53+
54+
.animate-fade-in {
55+
animation: fade-in 0.5s ease forwards;
56+
}
4557

4658
body {
4759
background: var(--background);

app/layout.tsx

+25
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,31 @@ export default function RootLayout({
1414
return (
1515
<html lang="zh_cn">
1616
<body>
17+
<style>{`
18+
@font-face {
19+
font-family: Backso;
20+
src: url(./fonts/Backso.otf);
21+
font-weight: normal;
22+
font-style: normal;
23+
font-display: swap
24+
}
25+
26+
@font-face {
27+
font-family: SuperLobster;
28+
src: url(./fonts/SuperLobster.otf);
29+
font-weight: normal;
30+
font-style: normal;
31+
font-display: swap
32+
}
33+
34+
@font-face {
35+
font-family: KGPerfectPenmanship;
36+
src: url(./fonts/KGPerfectPenmanship.otf);
37+
font-weight: normal;
38+
font-style: normal;
39+
font-display: swap
40+
}
41+
`}</style>
1742
{children}
1843
</body>
1944
</html>

app/page.tsx

+16-16
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ const IndexBox = () =>{
66
const [visibleMainBox, setvisibleMianBox] = useState(false)
77
const boxWidthArr = Array.from({ length: 10 }, (_, index) => index / 2 + 0.5);
88
useEffect(() => {
9-
const promise = new Promise<void>((resolve) => {
9+
const animateBoxes = () => {
1010
boxWidthArr.forEach((_, index) => {
11-
setTimeout(() => {
12-
setVisibleBoxes((prev) => [...prev, index]);
13-
if(index === boxWidthArr.length-1)setTimeout(()=>resolve(),50)
14-
}, index * 150);
15-
})
16-
})
17-
promise.then(()=>{
18-
setvisibleMianBox(true)
19-
})
11+
requestAnimationFrame(() => {
12+
setVisibleBoxes((prev) => [...prev, index]);
13+
});
14+
});
15+
};
16+
17+
animateBoxes();
18+
setTimeout(() => setvisibleMianBox(true), 1500); // 延迟显示主盒子
2019
}, [boxWidthArr]);
2120
return (
2221
<div className="w-4/5 h-screen min-h-[600px] flex items-center">
@@ -26,12 +25,13 @@ const IndexBox = () =>{
2625
style={{
2726
width: `${item}%`,
2827
height: `${item * 14 + 5}%`,
29-
opacity: visibleBoxes.includes(index) ? 1 : 0,
28+
opacity: 0,
3029
transition: 'opacity 0.5s ease',
31-
background: `rgb(${-item*20+150},${-item*20+150},${-item*20+150})`,
32-
margin: `0 ${item+2}px 0 0`
30+
background: `rgb(${-item * 20 + 150}, ${-item * 20 + 150}, ${-item * 20 + 150})`,
31+
margin: `0 ${item + 2}px 0 0`,
32+
animationDelay: `${index * 0.15}s`, // 动画延迟
3333
}}
34-
className="rounded-l-3xl"
34+
className="rounded-l-3xl animate-fade-in"
3535
></div>
3636
))}
3737
{
@@ -69,7 +69,7 @@ const IndexBox = () =>{
6969
const BlogBox = () => {
7070
return (
7171
<div
72-
className="w-4/5 my-15 bg-[#a9a9a9] relative flex flex-wrap"
72+
className="w-4/5 my-[3rem] bg-[#a9a9a9] relative flex flex-wrap"
7373
>
7474
<div
7575
className='absolute top-[-6rem] left-2 text-[100px] font-bold'
@@ -96,7 +96,7 @@ const BlogBox = () => {
9696
const ProjectBox = () => {
9797
return (
9898
<div
99-
className="w-4/5 h-[700px] my-15 bg-[#a9a9a9] relative flex flex-wrap"
99+
className="w-4/5 h-[700px] my-[3rem] bg-[#a9a9a9] relative flex flex-wrap"
100100
>
101101
<div
102102
className='absolute top-[-6rem] left-2 text-[100px] font-bold'

dist/404.html

-1
This file was deleted.

dist/404/index.html

-1
This file was deleted.

dist/_next/static/-EkyvNV9lvqJpgNMtKsqE/_buildManifest.js

-1
This file was deleted.

dist/_next/static/-EkyvNV9lvqJpgNMtKsqE/_ssgManifest.js

-1
This file was deleted.

dist/_next/static/chunks/255-aeaac2ba63d923f3.js

-1
This file was deleted.

0 commit comments

Comments
 (0)