diff --git a/app/(core)/components/Chapter.jsx b/app/(core)/components/Chapter.jsx index 1e28af2f..153e24f4 100644 --- a/app/(core)/components/Chapter.jsx +++ b/app/(core)/components/Chapter.jsx @@ -1,29 +1,59 @@ // app/components/Chapter.jsx import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faArrowRight } from "@fortawesome/free-solid-svg-icons"; +import { faArrowRight, faAtom } from "@fortawesome/free-solid-svg-icons"; import Tag from "./Tag.jsx"; import Link from "next/link.js"; -import Image from "next/image"; import useTranslation from "../hooks/useTranslation.ts"; +import { COLORS } from "../data/tags.js"; function Chapter(props) { const { t, meta } = useTranslation(); const isCompleted = meta?.completed || false; - console.log("Chapter props:", props); // Debug log to check props + const primaryTag = props.tags?.[0]; + const secondaryTag = props.tags?.[1]; + const primaryColor = COLORS[primaryTag?.color]?.primary || "#00e6e6"; + const secondaryColor = COLORS[secondaryTag?.color]?.secondary || "#7dd3fc"; + return (
{/* Hero thumbnail */} -
+
+
+
+
+ +
+ {t(primaryTag?.name || "Physics")} +
+
- {`${t(props.name)} + {props.thumbnail ? ( + // Cards can use local or arbitrary external article images. + // eslint-disable-next-line @next/next/no-img-element + {`${t(props.name)} { + event.currentTarget.style.display = "none"; + }} + /> + ) : null}
diff --git a/app/(core)/components/Hero.jsx b/app/(core)/components/Hero.jsx index 2283539a..80cdb2d8 100644 --- a/app/(core)/components/Hero.jsx +++ b/app/(core)/components/Hero.jsx @@ -1,7 +1,13 @@ import React from "react"; import Link from "next/link"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faArrowRight } from "@fortawesome/free-solid-svg-icons"; +import { + faArrowRight, + faAtom, + faBolt, + faPlay, + faWaveSquare, +} from "@fortawesome/free-solid-svg-icons"; import { faGithub } from "@fortawesome/free-brands-svg-icons"; import chaptersData from "../data/chapters.js"; import { motion, useReducedMotion } from "framer-motion"; @@ -105,58 +111,124 @@ export function Hero() { return ( - {/* Animated H1 with per-word glow on PhysicsHub */} - - {titleWords.map((word, idx) => { - const isHighlight = word.includes("PhysicsHub"); - return ( - + + + {t("Interactive physics learning")} + + + {/* Animated H1 with per-word glow on PhysicsHub */} + + {titleWords.map((word, idx) => { + const isHighlight = word.includes("PhysicsHub"); + return ( + + {word} + + ); + })} + + + {/* Subtitle */} + + {t( + "Experience physics in real time, uncover the concepts behind the formulas, and instantly see how they apply to the real world." + )} + + + {/* CTA buttons */} + + + - {word} - - ); - })} - - - {/* Subtitle */} - - {t( - "Experience physics in real time, uncover the concepts behind the formulas, and instantly see how they apply to the real world." - )} - - - {/* CTA buttons */} - - - - {t("Go to Simulations")} - - - - - - {t("Contribute")} - - + {t("Go to Simulations")} + + + + + + {t("Contribute")} + + + - - {/* Info text */} - - {t("Currently")} {chaptersCount} {t("chapters available.")} - + {/* Info text */} + + {t("Currently")} {chaptersCount} {t("chapters available.")} + +
+ + +
+ + + + {t("Live Simulation")} +
+