import React, {useMemo} from 'react'; import Layout from '@theme/Layout'; import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import {motion, type Variants, useReducedMotion} from 'framer-motion'; import {getHomepageContent} from '../i18n/homepage'; import gregImage from '../image.png'; import { FaArrowUpRightFromSquare, FaDiscord, FaDownload, FaGithub, FaLifeRing, FaShop, } from 'react-icons/fa6'; import {GregCoreRandomSnippet} from '../components/GregCoreRandomSnippet'; /** Always resolves to the newest GitHub release (redirect). */ const GREG_MODMANAGER_LATEST = 'https://github.com/mleem97/GregToolsModmanager/releases/latest'; const viewport = {once: true, margin: '-90px'}; /** Inline `greg_hooks.json` in copy when the string contains that token. */ function formatBulletWithOptionalCode(text: string): React.ReactNode { if (!text.includes('greg_hooks.json')) { return text; } const parts = text.split('greg_hooks.json'); return ( <> {parts.map((part, i) => ( {part} {i < parts.length - 1 ? ( greg_hooks.json ) : null} ))} ); } function buildVariants(reducedMotion: boolean) { const section: Variants = reducedMotion ? {hidden: {opacity: 0}, show: {opacity: 1}} : { hidden: {opacity: 0, y: 26}, show: { opacity: 1, y: 0, transition: {duration: 0.65, ease: [0.16, 1, 0.3, 1]}, }, }; const grid: Variants = { hidden: {}, show: { transition: { staggerChildren: reducedMotion ? 0 : 0.09, delayChildren: reducedMotion ? 0 : 0.06, }, }, }; const card: Variants = reducedMotion ? {hidden: {opacity: 0}, show: {opacity: 1}} : { hidden: {opacity: 0, y: 18, scale: 0.98}, show: { opacity: 1, y: 0, scale: 1, transition: {duration: 0.45, ease: [0.16, 1, 0.3, 1]}, }, }; const textReveal: Variants = reducedMotion ? {hidden: {opacity: 0}, show: {opacity: 1}} : { hidden: {opacity: 0, y: 18}, show: { opacity: 1, y: 0, transition: {duration: 0.5, ease: [0.16, 1, 0.3, 1]}, }, }; return {section, grid, card, textReveal}; } export default function HomePage(): JSX.Element { const { i18n: {currentLocale}, } = useDocusaurusContext(); const t = getHomepageContent(currentLocale); const reducedMotion = useReducedMotion(); const variants = useMemo(() => buildVariants(Boolean(reducedMotion)), [reducedMotion]); return (
layers

{t.featureTitles[0]}

{t.featureDescriptions[0]}

cable

{t.featureTitles[1]}

{t.featureDescriptions[1]}

menu_book

{t.featureTitles[2]}

{t.featureDescriptions[2]}

groups

{t.featureTitles[3]}

{t.featureDescriptions[3]}

download_for_offline

{t.modManagerSectionTitle}

{t.modManagerSectionBody}

{t.modManagerDownloadLabel}

{t.modManagerLatestHint}

{t.codeSectionTitle}

{t.codeSectionLead}

    {t.codeSectionBullets.map((line) => (
  • check_circle {formatBulletWithOptionalCode(line)}
  • ))}
{t.knowledgeSectionTitle} {t.knowledgeLinks.map((doc) => (
{doc.title}
{doc.description}
))}
{t.workflowSectionTitle} {t.workflowLinks.map((doc) => (
{doc.title}
{doc.description}
))}

{t.ctaDiscordTitle}

{t.ctaDiscordLead}

{t.ctaDiscordButton}

{t.gregTitle}

{t.gregText1}

{t.gregText2}

{t.gregQuote}

Greg
{t.comingSoon}
{t.comingSoonText}

{t.communityTitle}

{t.communityText}

frikadellental.de {t.availableModsLabel} {t.repositoryLabel} {t.joinLabel}

{t.supportTitle}

{t.supportText}

{t.supportCta}
); }