"use client"; import "animate.css/animate.compat.css" import { useRef, useEffect, useState } from 'react'; import Link from "next/link"; const Hero1 = () => { const [paragraphOpacities, setParagraphOpacities] = useState([]); const scrollRef = useRef(null); useEffect(() => { const handleScroll = () => { if (scrollRef.current) { const container = scrollRef.current; const isAtBottom = Math.abs(container.scrollHeight - container.scrollTop - container.clientHeight) < 5; if (isAtBottom) { // Set all paragraphs to full opacity when at the bottom setParagraphOpacities(new Array(11).fill(1)); } else { const paragraphs = container.querySelectorAll('p'); const newOpacities = Array.from(paragraphs).map(p => { const rect = p.getBoundingClientRect(); const yPosition = rect.top - container.getBoundingClientRect().top; return yPosition > 30 ? 0 : 1; }); setParagraphOpacities(newOpacities); } } }; setParagraphOpacities(new Array(9).fill(0)); if (scrollRef.current) { scrollRef.current.addEventListener('scroll', handleScroll); setTimeout(handleScroll, 100); } return () => { if (scrollRef.current) { scrollRef.current.removeEventListener('scroll', handleScroll); } }; }, []); return (
{/* Existing content */}
發掘你的
音樂之路
{[ "學音樂能陶冶性情,專注,舒緩壓力,放鬆心情。實際上是否做到呢?", "我們認為音樂不單單是「睇五線譜」", "我們可以透過不同方式", "例如聆聽,唱歌,身體律動等學習音樂,令學習不再是沉悶艱難", "真正做到「陶冶性情」", "One & ALL Music 提供全面的音樂課程", "我們相信每位學生都各有天賦", "「誰都可發光 只要找對地方」", "只要運用合適的教學法,同學必定能發揮所長", " ", " ", ].map((text, index) => (

{text}

))}
我們認為

{"音樂不單單是「睇五線譜」,我們可以透過不同方式,例如聆聽唱歌,身體律動等學習音樂,令學習不再是沉悶艱難,真正做到「陶治性情」。"}

One & ALL Music 提供全面的音樂課程,我們相信每位學生都各有天赋,

「誰都可發光 只要找對地方」,只要運用合適的教學法,同學必定能發揮所長。

{/* { console.log('Button clicked'); }} /> */} {"關於我們更多"}
); } export default Hero1