diff --git a/frontend/src/css/_app.css b/frontend/src/css/_app.css index affc655..36bd4a9 100644 --- a/frontend/src/css/_app.css +++ b/frontend/src/css/_app.css @@ -30,3 +30,22 @@ li.stack-item:not(:last-child):after { .main-navbar, .app-sidebar-brand { box-shadow: 0px -1px 40px rgba(112, 144, 176, 0.2); } + +@keyframes blob { + 0% { transform: translate(0px, 0px) scale(1); } + 33% { transform: translate(30px, -50px) scale(1.1); } + 66% { transform: translate(-20px, 20px) scale(0.9); } + 100% { transform: translate(0px, 0px) scale(1); } +} + +.animate-blob { + animation: blob 7s infinite; +} + +.animation-delay-2000 { + animation-delay: 2s; +} + +.animation-delay-4000 { + animation-delay: 4s; +} \ No newline at end of file diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index cba7592..c2f84ed 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import type { ReactElement } from 'react'; import Head from 'next/head'; import Link from 'next/link'; @@ -13,11 +13,21 @@ import { fetch as fetchCourses } from '../stores/courses/coursesSlice'; export default function Starter() { const dispatch = useAppDispatch(); const { courses, loading } = useAppSelector((state) => state.courses); + const [scrollY, setScrollY] = useState(0); useEffect(() => { dispatch(fetchCourses({ query: '?published=true&limit=6' })); }, [dispatch]); + useEffect(() => { + const handleScroll = () => { + setScrollY(window.scrollY); + }; + + window.addEventListener('scroll', handleScroll, { passive: true }); + return () => window.removeEventListener('scroll', handleScroll); + }, []); + const title = 'EduFlow LMS'; const features = [ @@ -46,17 +56,28 @@ export default function Starter() { }; return ( -