when-am-i / commit
linkify header, moved icon
src/App.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index c027562..ae21495 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -149,12 +149,18 @@ function App() { recentCalendars.current = [scene.calendar, ...recentCalendars.current].slice(0, SHUFFLE_RECENT_WINDOW); }; + const rootUrl = typeof window !== 'undefined' ? `${window.location.origin}${window.location.pathname}` : '/'; + console.log(`root URL: ${rootUrl}`); + return ( <div className="app"> - <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}> - <h1 style={{ margin: 0 }}>When am I?</h1> - <img src={calendar} alt="" style={{ width: 40, height: 40 }} /> - </div> + <a href={rootUrl} style={{ textDecoration: 'none', color: 'inherit' }}> + <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}> + <img src={calendar} alt="" style={{ width: 40, height: 40 }} /> + <h1 style={{ margin: 0 }}>When am I?</h1> + </div> + </a> + <p style={{ marginTop: 12 }}> You’re a time traveler who lands somewhere in history. You stop a local and ask: <em>“When am I?”</em> Their answer depends on where