From 83e9dc915f3549cb98d797be441db24cd8a21f7e Mon Sep 17 00:00:00 2001 From: LufsX Date: Wed, 30 Apr 2025 02:09:12 +0800 Subject: [PATCH] feat: add animation effects and optimize homepage layout --- app/page.tsx | 115 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 96 insertions(+), 19 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index db94b79..a0f196d 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,34 +1,111 @@ +"use client"; import Image from "next/image"; import { websites } from "../data/urls"; import Header from "@/components/header"; import Footer from "@/components/footer"; +import { motion } from "framer-motion"; export default function Home() { + // 动画定义 + const containerVariants = { + hidden: { opacity: 0 }, + visible: { + opacity: 1, + transition: { + staggerChildren: 0.1, + }, + }, + }; + + const itemVariants = { + hidden: { y: 20, opacity: 0 }, + visible: { + y: 0, + opacity: 1, + transition: { type: "spring", stiffness: 100 }, + }, + }; + + const textVariants = { + hidden: { opacity: 0 }, + visible: { + opacity: 1, + transition: { duration: 0.3, ease: "easeInOut" }, + }, + }; + return (
-
-
-

智能计算实验室简介

-

- 在物理的世界里,粒子有形形色色的活法,有的粒子很轻,终生不为人所注意;有的粒子会一鸣惊人,在湮灭时释放出大量的光;有的粒子狡黠善变,一辈子不停地改变身份,时时刻刻要成为别的粒子;但有的粒子一生稳定,怀揣着出发时得到的巨大能量,一生孤独而平静地飞行,只活在自己的轨道里。(摘自《丁肇中 - 伟大的是物理》,作者:李斐然) -

-
-
+ + + + 智能计算实验室简介 + + + 在物理的世界里,粒子有形形色色的活法,有的粒子很轻,终生不为人所注意;有的粒子会一鸣惊人,在湮灭时释放出大量的光;有的粒子狡黠善变,一辈子不停地改变身份,时时刻刻要成为别的粒子;但有的粒子一生稳定,怀揣着出发时得到的巨大能量,一生孤独而平静地飞行,只活在自己的轨道里。 + + + ——摘自《丁肇中 伟大的是物理》,作者:李斐然 + + + + {websites.map((website, index) => ( - -
- {website.title} -
-

{website.title}

-
{website.description}
+ + +
+ + {website.title} + +

+ {website.title} +

-
-
+
{website.description}
+
+ 访问站点 + + + +
+ + ))} -
-
+ +
);