Skip to content

Commit aa430ac

Browse files
ChengaDevclaude
andcommitted
Redesign content pages, add basketball loader, fix landscape nav, scroll to top
- Add DSEG14 digital basketball loader shown on every page transition (1s) - Add ScrollToTop component — scrolls to top on every navigation - Fix navigation hamburger missing in landscape mode (max-height: 500px) - Rewrite About, FAQ, Instructions, FIBA Resources to match home page design: - Gradient page titles (Poppins 900, titleColor→accent) - SVG icons replacing emoji - 22px border-radius cards with accent-tinted hover shadows - slideUp animation, · label · section headers, brand orange #E8761A - FIBA resource cards equal height via grid-auto-rows: 1fr - FAQ question text weight reduced to 400 - Landing page: feature cards wired to localization keys Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2001486 commit aa430ac

8 files changed

Lines changed: 694 additions & 458 deletions

File tree

src/App.tsx

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { BrowserRouter as Router, Routes, Route, useLocation, useParams, Outlet,
44
import styled, { ThemeProvider } from 'styled-components'
55
import LanguageProvider, { useLocalization } from './contexts/Language/LanguageProvider'
66
import Navigation from './components/Navigation'
7+
import BasketballLoader from './components/BasketballLoader'
78
import ShareButtons from './components/ShareButtons'
89
import Footer from './components/Footer'
910
import CookieBanner from './components/CookieBanner'
@@ -25,6 +26,30 @@ const PlayPage = lazy(() => import('./components/PlayPage'))
2526

2627
const NON_ENGLISH_LANGS = ['it', 'es', 'fr', 'el']
2728

29+
const ScrollToTop: React.FC = () => {
30+
const location = useLocation()
31+
useEffect(() => {
32+
window.scrollTo(0, 0)
33+
}, [location.pathname])
34+
return null
35+
}
36+
37+
const PageTransition: React.FC<{ children: React.ReactNode }> = ({ children }) => {
38+
const location = useLocation()
39+
const [loading, setLoading] = useState(false)
40+
const prevPath = React.useRef(location.pathname)
41+
42+
useEffect(() => {
43+
if (location.pathname === prevPath.current) return
44+
prevPath.current = location.pathname
45+
setLoading(true)
46+
const id = setTimeout(() => setLoading(false), 1000)
47+
return () => clearTimeout(id)
48+
}, [location.pathname])
49+
50+
return loading ? <BasketballLoader /> : <>{children}</>
51+
}
52+
2853
interface PageContentProps {
2954
children: React.ReactNode
3055
title: string
@@ -163,20 +188,23 @@ const App = () => {
163188
<Navigation currentTheme={selectedTheme} setTheme={handleSetTheme} />
164189
<PageWrapper>
165190
<MainContent>
166-
<Suspense fallback={null}>
167-
<Routes>
168-
{/* English — canonical URLs without lang prefix */}
169-
<Route path="/" element={<EnglishLayout />}>
170-
{pageRoutes}
171-
</Route>
172-
173-
{/* Non-English languages + /en/* redirect */}
174-
<Route path="/:lang" element={<LangLayout />}>
175-
{pageRoutes}
176-
</Route>
177-
178-
<Route path="*" element={<NotFound />} />
179-
</Routes>
191+
<Suspense fallback={<BasketballLoader />}>
192+
<ScrollToTop />
193+
<PageTransition>
194+
<Routes>
195+
{/* English — canonical URLs without lang prefix */}
196+
<Route path="/" element={<EnglishLayout />}>
197+
{pageRoutes}
198+
</Route>
199+
200+
{/* Non-English languages + /en/* redirect */}
201+
<Route path="/:lang" element={<LangLayout />}>
202+
{pageRoutes}
203+
</Route>
204+
205+
<Route path="*" element={<NotFound />} />
206+
</Routes>
207+
</PageTransition>
180208
</Suspense>
181209
</MainContent>
182210
<Footer />

0 commit comments

Comments
 (0)