From 157e183776e617f510d96a9dab967fdd38c5c913 Mon Sep 17 00:00:00 2001 From: ejminguez Date: Fri, 11 Jul 2025 23:09:34 +0800 Subject: [PATCH] fix: changed background, more optimization --- frontend/src/App.tsx | 5 ++--- frontend/src/components/Home/Greetings.tsx | 8 ++++---- frontend/src/components/Home/Hero.tsx | 6 +++--- frontend/src/components/Home/HomeBucketList.tsx | 2 +- frontend/src/components/Home/Letters.tsx | 2 +- frontend/src/components/Home/MusicPlayer.tsx | 2 +- frontend/src/components/Letter/LetterList.tsx | 6 +----- frontend/src/index.css | 7 +------ frontend/src/pages/Home.tsx | 1 - frontend/src/pages/Playlist.tsx | 2 +- frontend/src/router/router.tsx | 3 ++- 11 files changed, 17 insertions(+), 27 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 0008712..80a0151 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -22,7 +22,6 @@ const App = () => { }, []); useGSAP(() => { - // Only load ScrollSmoother on desktop for better performance if (!isMobile) { import("gsap/ScrollSmoother").then(({ ScrollSmoother }) => { import("gsap/ScrollTrigger").then(({ ScrollTrigger }) => { @@ -31,9 +30,9 @@ const App = () => { ScrollSmoother.create({ wrapper: "#smooth-wrapper", content: "#smooth-content", - smooth: 1.5, // Reduced from 2 for better performance + smooth: 1.5, effects: true, - smoothTouch: 0.1, // Reduced for mobile performance + smoothTouch: 0.1, }); }); }); diff --git a/frontend/src/components/Home/Greetings.tsx b/frontend/src/components/Home/Greetings.tsx index f4b0cd0..757e008 100644 --- a/frontend/src/components/Home/Greetings.tsx +++ b/frontend/src/components/Home/Greetings.tsx @@ -32,8 +32,8 @@ const Greetings = () => { loopTyping(); }, []); return ( -
-
+
+

@@ -44,14 +44,14 @@ const Greetings = () => { diff --git a/frontend/src/components/Home/Hero.tsx b/frontend/src/components/Home/Hero.tsx index de58477..aa43663 100644 --- a/frontend/src/components/Home/Hero.tsx +++ b/frontend/src/components/Home/Hero.tsx @@ -16,9 +16,9 @@ const Hero = () => { { fetchList(); }, []); return ( -
+

pangarap

{loading ? (

Loading ...

diff --git a/frontend/src/components/Home/Letters.tsx b/frontend/src/components/Home/Letters.tsx index 033301f..cea1acf 100644 --- a/frontend/src/components/Home/Letters.tsx +++ b/frontend/src/components/Home/Letters.tsx @@ -33,7 +33,7 @@ const Letters = () => { }, []); return ( -
+

liham

{loading ? (
diff --git a/frontend/src/components/Home/MusicPlayer.tsx b/frontend/src/components/Home/MusicPlayer.tsx index 074bb11..7d06010 100644 --- a/frontend/src/components/Home/MusicPlayer.tsx +++ b/frontend/src/components/Home/MusicPlayer.tsx @@ -7,7 +7,7 @@ import { useGlobalAudioManager } from "@/hooks/useGlobalAudioManager"; const MusicPlayer = () => { const { currentSong } = useGlobalAudioManager(); return ( -
+
{ console.log("Found cards:", cards.length); // Debug log - cards.forEach((card, index) => { + cards.forEach((card) => { gsap.fromTo( card, { opacity: 0, y: 50 }, @@ -59,15 +59,11 @@ const LetterList = () => { start: "top 85%", end: "bottom 15%", toggleActions: "play reverse play reverse", - // markers: true, // enable this for scroll debug - onEnter: () => console.log(`Card ${index} entered`), // Debug log - onLeave: () => console.log(`Card ${index} left`), // Debug log }, }, ); }); - // Refresh ScrollTrigger to recalculate positions ScrollTrigger.refresh(); }, containerRef); diff --git a/frontend/src/index.css b/frontend/src/index.css index 03459bf..4a0fa6e 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -59,12 +59,7 @@ } body { - background-size: cover; - background-repeat: no-repeat; - background-position: center; - background-attachment: fixed; - background-color: #cbe87b; - background-image: url(http://www.transparenttextures.com/patterns/textured-paper.png); + background-color: #c1e1c1; } @theme inline { diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index cfbbb43..228b52d 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -12,7 +12,6 @@ const Home = () => { useGSAP(() => { gsap.registerPlugin(ScrollTrigger, ScrollSmoother); - // Create ScrollSmoother ScrollSmoother.create({ wrapper: "#smooth-wrapper", content: "#smooth-content", diff --git a/frontend/src/pages/Playlist.tsx b/frontend/src/pages/Playlist.tsx index 9f3dfcb..cb6c661 100644 --- a/frontend/src/pages/Playlist.tsx +++ b/frontend/src/pages/Playlist.tsx @@ -4,7 +4,7 @@ import Queue from "@/components/Playlist/Queue"; const Playlist = () => { return ( -
+
import("@/pages/Home.tsx")); @@ -13,7 +14,7 @@ const Pangarap = lazy(() => import("@/pages/Pangarap")); // Loading component const PageLoader = () => (
-
+
);