From cb7254d9b0fb23250baa2484aeba7a0c8d396f0c Mon Sep 17 00:00:00 2001 From: flatplum Date: Mon, 15 Sep 2025 21:47:33 +1000 Subject: [PATCH 1/2] fix: refactor TitleHero widget to remove Tailwind Going forward, I'd like to phase out Tailwind usage. For explanations why, please refer to the following which can explain better than I ever will: https://gomakethings.com/tailwind-is-bad/ https://www.aleksandrhovhannisyan.com/blog/why-i-dont-like-tailwind-css/ I'm discussing this change with incoming/remaining members of the website team. This particular commit should be unnoticable and non-breaking. --- src/features/TitleHero/TitleHero.css | 73 ++++++++++++++++++++++++++++ src/features/TitleHero/TitleHero.tsx | 62 +++++++++++------------ src/layouts/Layout.tsx | 8 +-- 3 files changed, 106 insertions(+), 37 deletions(-) create mode 100644 src/features/TitleHero/TitleHero.css diff --git a/src/features/TitleHero/TitleHero.css b/src/features/TitleHero/TitleHero.css new file mode 100644 index 0000000..6b36574 --- /dev/null +++ b/src/features/TitleHero/TitleHero.css @@ -0,0 +1,73 @@ +.hero-container { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} + +.hero-bigtext { + /* position: relative; */ + display: flex; + flex-direction: column; + justify-content: flex-end; + flex-basis: auto +} + +.hero-background { + z-index: -10; + color: transparent; + -webkit-text-stroke: 1px #767676; + font-weight: 900; + font-size: 9rem; + white-space: nowrap; + line-height: 1; + margin-bottom: -100px; + /* padding-bottom: 5rem; */ +} + +@media (min-width: 768px) { + .hero-background { + font-size: 16rem; /* md:text-[256px] */ + } +} + +@media (min-width: 768px) { + .hero-content { + align-items: center; + gap: 1.25rem; + } +} + +.hero-title { + z-index: 1; + font-weight: 900; + font-size: 3rem; /* text-5xl */ + line-height: 1; + white-space: nowrap; + text-align: center; + /* position: absolute; + bottom: 5.5rem; */ +} + +@media (min-width: 768px) { + .hero-title { + font-size: 4.5rem; /* md:text-7xl */ + } +} + +@media (min-width: 1024px) { + .hero-title { + font-size: 6rem; /* lg:text-[96px] */ + } +} + +.hero-description { + max-width: 40%; + margin-top: 2rem; +} + +@media (max-width: 767px) { + .hero-description { + max-width: 100%; + } +} \ No newline at end of file diff --git a/src/features/TitleHero/TitleHero.tsx b/src/features/TitleHero/TitleHero.tsx index 42f65dd..ba07847 100644 --- a/src/features/TitleHero/TitleHero.tsx +++ b/src/features/TitleHero/TitleHero.tsx @@ -1,5 +1,6 @@ import { useEffect, useRef } from "react"; import { motion } from "framer-motion"; +import "./TitleHero.css"; interface PageHeader { pageTitle: string; @@ -10,44 +11,39 @@ const TitleHero = ({ pageTitle, pageDescription }: PageHeader) => { const ref = useRef(null); return ( -
- {/* Background */} -
+
+
+ {/* Background Text */} + viewport={{ once: true }} + > {pageTitle} + + {/* Foreground Content */} + +

{pageTitle}

+
- {/* Foreground */} -
-
- -

{pageTitle}

-
- -

{pageDescription}

-
-
-
+ + +

{pageDescription}

+
); }; diff --git a/src/layouts/Layout.tsx b/src/layouts/Layout.tsx index 38d24e9..19a6544 100644 --- a/src/layouts/Layout.tsx +++ b/src/layouts/Layout.tsx @@ -144,10 +144,10 @@ const Layout = () => { return ( <> -
- {isShowNavbar ? ( - - ) : null} + {isShowNavbar ? ( + + ) : null} +
{isShowFooter ?