├── public └── index.html ├── src ├── components │ ├── Home.js │ ├── Home.jsx │ ├── SectionTitle.js │ ├── Footer.js │ ├── Favourites.js │ ├── Blog.js │ ├── Hero.jsx │ ├── About.js │ ├── GalleryItem.js │ ├── Navbar.jsx │ ├── Navbar.js │ ├── Gallery.js │ ├── NotFound.js │ ├── Featured.js │ └── Hero.js ├── index.js ├── Hooks │ ├── useSmothScroll.js │ ├── useSmoothScroll.js │ └── gsap.js ├── App.js ├── data │ └── blogs.js └── index.css ├── .gitignore ├── package.json └── README.md /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Immorial Website 8 | 9 | 10 |
11 | 12 |
13 | 14 | -------------------------------------------------------------------------------- /src/components/Home.js: -------------------------------------------------------------------------------- 1 | import Hero from "./Hero"; 2 | import Featured from "./Featured"; 3 | import About from "./About"; 4 | import Gallery from "./Gallery"; 5 | 6 | const Home = () => { 7 | return ( 8 | <> 9 | 10 | 11 | 12 | 13 | 14 | ); 15 | }; 16 | 17 | export default Home; 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom/client"; 3 | import { BrowserRouter } from "react-router-dom"; 4 | import App from "./App"; 5 | import "./index.css"; 6 | 7 | const root = ReactDOM.createRoot(document.getElementById("root")); 8 | root.render( 9 | 10 | 11 | 12 | 13 | 14 | ); 15 | -------------------------------------------------------------------------------- /src/components/Home.jsx: -------------------------------------------------------------------------------- 1 | import Hero from './Hero'; 2 | import Navbar from './Navbar'; 3 | 4 | const Home = () => { 5 | return ( 6 |
7 | 8 | 9 |
10 | ); 11 | }; 12 | 13 | export default Home; -------------------------------------------------------------------------------- /src/Hooks/useSmothScroll.js: -------------------------------------------------------------------------------- 1 | import { useEffect } from "react"; 2 | import Lenis from '@studio-freight/lenis' 3 | 4 | export const useSmothScroll = () => { 5 | const lenis = new Lenis({ 6 | duration: 1.2, 7 | easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), 8 | direction: 'vertical', 9 | smooth: true, 10 | }) 11 | useEffect(() => { 12 | function raf(time) { 13 | lenis.raf(time) 14 | requestAnimationFrame(raf) 15 | } 16 | requestAnimationFrame(raf) 17 | }, []) 18 | } -------------------------------------------------------------------------------- /src/Hooks/useSmoothScroll.js: -------------------------------------------------------------------------------- 1 | import { useEffect } from "react"; 2 | import Lenis from "@studio-freight/lenis"; 3 | 4 | export const useSmoothScroll = () => { 5 | const lenis = new Lenis({ 6 | duration: 1.5, 7 | easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), 8 | direction: "vertical", 9 | smooth: true, 10 | }); 11 | 12 | useEffect(() => { 13 | function raf(time) { 14 | lenis.raf(time); 15 | requestAnimationFrame(raf); 16 | } 17 | 18 | requestAnimationFrame(raf); 19 | }, []); 20 | }; 21 | -------------------------------------------------------------------------------- /src/components/SectionTitle.js: -------------------------------------------------------------------------------- 1 | import { useRef } from "react"; 2 | import { useGsapLeftWalking } from "../hooks/gsap"; 3 | 4 | const SectionTitle = ({ title, needMargin = false }) => { 5 | const secTitle = useRef(null); 6 | 7 | useGsapLeftWalking(secTitle); 8 | 9 | const optionalMarginStyles = { 10 | margin: needMargin ? "0 5vw" : null, 11 | }; 12 | 13 | return ( 14 |
15 | {title} 16 |
17 | ); 18 | }; 19 | 20 | export default SectionTitle; 21 | -------------------------------------------------------------------------------- /src/components/Footer.js: -------------------------------------------------------------------------------- 1 | import { useRef } from "react"; 2 | import { useGsapFooterHeadline } from "../hooks/gsap"; 3 | 4 | const Footer = () => { 5 | const footerRef = useRef(null); 6 | const footerHeadline = useRef(null); 7 | 8 | useGsapFooterHeadline(footerHeadline, footerRef); 9 | 10 | return ( 11 |
12 |

Bonjour

13 |

14 | © {new Date().getFullYear()} Immemorial. Crafted by yours truly 15 |

16 |
17 | ); 18 | }; 19 | 20 | export default Footer; 21 | -------------------------------------------------------------------------------- /src/components/Favourites.js: -------------------------------------------------------------------------------- 1 | import SectionTitle from "./SectionTitle"; 2 | import Blog from "./Blog"; 3 | import { blogsArr } from "../data/blogs"; 4 | 5 | const Favourites = ({ minHeight }) => { 6 | return ( 7 |
11 | 12 |
13 | {blogsArr.map((blog) => ( 14 | 15 | ))} 16 |
17 |
18 | ); 19 | }; 20 | 21 | export default Favourites; 22 | -------------------------------------------------------------------------------- /src/components/Blog.js: -------------------------------------------------------------------------------- 1 | const Blog = ({ blog }) => { 2 | return ( 3 |
4 |
5 | {blog.title} 6 |
7 |
8 |

{blog.title}

9 |

10 | Published by {blog.author} on{" "} 11 | {blog.date} 12 |

13 |

{blog.body}

14 | 15 |
16 |
17 | ); 18 | }; 19 | 20 | export default Blog; 21 | -------------------------------------------------------------------------------- /src/components/Hero.jsx: -------------------------------------------------------------------------------- 1 | import React, { useRef } from 'react'; 2 | import { useGsapHeroTextUpStagger } from '../Hooks/gsap'; 3 | 4 | const Hero = () => { 5 | const heroRef = useRef(null); 6 | const heroText1Ref = useRef(null); 7 | const heroText2Ref = useRef(null); 8 | const heroBtnRef = useRef(null); 9 | const heroTextArr = [heroText1Ref, heroText2Ref, heroBtnRef]; 10 | 11 | useGsapHeroTextUpStagger(heroTextArr, 1.5); 12 | 13 | return ( 14 |
15 |
16 |

17 | war is 18 |

19 |

20 | Coming ! 21 |

22 | 23 |
24 |
25 | ); 26 | }; 27 | 28 | export default Hero; -------------------------------------------------------------------------------- /src/components/About.js: -------------------------------------------------------------------------------- 1 | import SectionTitle from "./SectionTitle"; 2 | 3 | const About = ({ minHeight }) => { 4 | return ( 5 |
9 | 10 |

11 | Explore the lost treasures and shining stars of the 1990s! Find your 12 | favorite cartoons, TV shows, music albums, & more with easy filtering 13 | functionality. With Immemorial, stay up-to-date with all your 90s 14 | favorites while turning back time. 15 |

16 |

17 | What's the only era that never seems to end? The 90s! Journey through 18 | appreciating items from 90s TV, music, and art. See if you remember old 19 | toys, cartoons, or prints of such. Indulge in some nostalgia before our 20 | world falls back into the dark ages. 21 |

22 |
23 | ); 24 | }; 25 | 26 | export default About; 27 | -------------------------------------------------------------------------------- /src/components/GalleryItem.js: -------------------------------------------------------------------------------- 1 | import { useRef } from "react"; 2 | import { 3 | useGsapGalleryImg, 4 | useGsapGalleryTitle, 5 | useGsapGalleryCategory, 6 | } from "../hooks/gsap"; 7 | 8 | const GalleryItem = ({ src, title, category }) => { 9 | const galleryImg = useRef(null); 10 | const galleryTitle = useRef(null); 11 | const galleryCategory = useRef(null); 12 | 13 | useGsapGalleryImg(galleryImg); 14 | useGsapGalleryTitle(galleryTitle, galleryImg); 15 | useGsapGalleryCategory(galleryCategory, galleryImg); 16 | 17 | return ( 18 |
19 |

20 | {title} 21 |

22 |

23 | {category} 24 |

25 |
30 |
31 | ); 32 | }; 33 | 34 | export default GalleryItem; 35 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "immorial-react", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@studio-freight/lenis": "^0.2.26", 7 | "@testing-library/jest-dom": "^5.16.5", 8 | "@testing-library/react": "^13.4.0", 9 | "@testing-library/user-event": "^13.5.0", 10 | "gsap": "^3.11.3", 11 | "react": "^18.2.0", 12 | "react-dom": "^18.2.0", 13 | "react-router-dom": "^6.4.5", 14 | "react-scripts": "5.0.1", 15 | "web-vitals": "^2.1.4" 16 | }, 17 | "scripts": { 18 | "start": "react-scripts start", 19 | "build": "react-scripts build", 20 | "test": "react-scripts test", 21 | "eject": "react-scripts eject" 22 | }, 23 | "eslintConfig": { 24 | "extends": [ 25 | "react-app", 26 | "react-app/jest" 27 | ] 28 | }, 29 | "browserslist": { 30 | "production": [ 31 | ">0.2%", 32 | "not dead", 33 | "not op_mini all" 34 | ], 35 | "development": [ 36 | "last 1 chrome version", 37 | "last 1 firefox version", 38 | "last 1 safari version" 39 | ] 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/components/Navbar.jsx: -------------------------------------------------------------------------------- 1 | import {useRef} from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | import { useGsapDownStagger } from '../Hooks/gsap' 4 | 5 | const Navbar = () => { 6 | const li1 = useRef(null); 7 | const li2 = useRef(null); 8 | const li3 = useRef(null); 9 | const logoRef = useRef(null); 10 | 11 | const liArr = [li1, li2, li3]; 12 | const logoArr = [logoRef]; 13 | 14 | useGsapDownStagger(liArr, 0.8); 15 | useGsapDownStagger(logoArr, 1.5); 16 | 17 | return ( 18 |
19 | 38 |
39 | ); 40 | }; 41 | 42 | export default Navbar; -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import { Route, Routes } from "react-router-dom"; 2 | import { useSmoothScroll } from "./hooks/useSmoothScroll"; 3 | import Navbar from "./components/Navbar"; 4 | import Home from "./components/Home"; 5 | import Featured from "./components/Featured"; 6 | import About from "./components/About"; 7 | import Gallery from "./components/Gallery"; 8 | import Favourites from "./components/Favourites"; 9 | import NotFound from "./components/NotFound"; 10 | import Footer from "./components/Footer"; 11 | 12 | const App = () => { 13 | const minHeight = true; 14 | useSmoothScroll(); 15 | 16 | return ( 17 | <> 18 | 19 | 20 | } /> 21 | } /> 22 | } /> 23 | } /> 24 | } 27 | /> 28 | } /> 29 | 30 |