diff --git a/components/HeaderView.component.jsx b/components/HeaderView.component.jsx index c974158..0dc5239 100644 --- a/components/HeaderView.component.jsx +++ b/components/HeaderView.component.jsx @@ -3,6 +3,7 @@ import Image from "next/legacy/image"; import config from '../config/constants'; import { song_list } from "../config/song_list"; import NumberTicker from "../components/NumberTicker.component"; +import BlurFade from './ui/blur-fade'; import { HiHeart @@ -24,13 +25,18 @@ const HomeList = () => { <>
{ config.HomeList.map((c, idx) => { return ( - + onClick={() => window.open(c.url)} + key={idx} + > + {c.name} src} + unoptimized + /> + {c.name} + + ); }) } @@ -119,17 +126,19 @@ const HeaderView = ({ props: [EffThis] }) => {
-
- liver-avatar src} - layout="fill" - objectFit="contain" - unoptimized - className="rounded-full" - /> -
+ +
+ liver-avatar src} + layout="fill" + objectFit="contain" + unoptimized + className="rounded-full" + /> +
+
@@ -145,79 +154,86 @@ const HeaderView = ({ props: [EffThis] }) => {
- {config.Name} - { - set_clicks(clicks + 1); - }} - /> + + {config.Name} + { + set_clicks(clicks + 1); + }} + /> + -
- - 已收录的歌曲 首 - - -
+ role="menuitem" + tabIndex="-1" + id="menu-item-3" + key={value} + > + + {value} +
+ ); + })} +
+ + ) : null} + +
+
diff --git a/components/ui/blur-fade.jsx b/components/ui/blur-fade.jsx new file mode 100644 index 0000000..d90d9b3 --- /dev/null +++ b/components/ui/blur-fade.jsx @@ -0,0 +1,42 @@ +"use client";; +import { useRef } from "react"; +import { AnimatePresence, motion, useInView } from "framer-motion"; + +export default function BlurFade({ + children, + className, + variant, + duration = 0.4, + delay = 0, + yOffset = 6, + inView = false, + inViewMargin = "-50px", + blur = "6px" +}) { + const ref = useRef(null); + const inViewResult = useInView(ref, { once: true, margin: inViewMargin }); + const isInView = !inView || inViewResult; + const defaultVariants = { + hidden: { y: yOffset, opacity: 0, filter: `blur(${blur})` }, + visible: { y: -yOffset, opacity: 1, filter: `blur(0px)` }, + }; + const combinedVariants = variant || defaultVariants; + return ( + ( + + {children} + + ) + ); +}