Skip to content

Commit

Permalink
feat(wrapped): add 2024 wrapped
Browse files Browse the repository at this point in the history
  • Loading branch information
ashhhleyyy committed Dec 21, 2024
1 parent c236156 commit 0969784
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 85 deletions.
27 changes: 16 additions & 11 deletions components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,27 @@ import { useRouter } from 'next/router';
import { T } from './translations';

export default function Navbar() {
const router = useRouter();
const wrapped = router.pathname.startsWith('/players/') && router.pathname.includes('/wrapped');

return <nav className={styles.nav}>
<Link href='https://nucleoid.xyz/'>
<Image src={logo} alt="Nucleoid logo" priority />
</Link>

<NavLink href='/games'>
<T k='nucleoid.nav.recent_games' />
</NavLink>
<NavLink href='/leaderboards'>
<T k='nucleoid.nav.leaderboards' />
</NavLink>
<NavLink href='/wrapped'>
{/* From: https://icon-sets.iconify.design/basil/present-solid/ */}
<svg className={styles.wrappedIcon} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" fillRule="evenodd" d="M6.25 5.5A3.25 3.25 0 0 1 12 3.423A3.25 3.25 0 0 1 17.062 7.5H18a2.5 2.5 0 0 1 2.5 2.5v1.25a.75.75 0 0 1-.75.75h-6.7a.3.3 0 0 1-.3-.3V8.24a3.267 3.267 0 0 1-.75-.663a3.267 3.267 0 0 1-.75.662V11.7a.3.3 0 0 1-.3.3h-6.7a.75.75 0 0 1-.75-.75V10A2.5 2.5 0 0 1 6 7.5h.938a3.236 3.236 0 0 1-.688-2Zm5 0a1.75 1.75 0 1 0-3.5 0a1.75 1.75 0 0 0 3.5 0Zm1.5 0a1.75 1.75 0 1 0 3.5 0a1.75 1.75 0 0 0-3.5 0Z" clipRule="evenodd"/><path fill="currentColor" d="M11.25 13.65a.3.3 0 0 0-.3-.3H5.649a.833.833 0 0 0-.82.692a11.592 11.592 0 0 0 0 3.916l.224 1.309a2.008 2.008 0 0 0 1.755 1.656l1.065.119a37.15 37.15 0 0 0 3.071.215a.298.298 0 0 0 .306-.299V13.65Zm1.806 7.607a.298.298 0 0 1-.306-.299V13.65a.3.3 0 0 1 .3-.3h5.301c.406 0 .752.292.82.692c.223 1.296.223 2.62 0 3.916l-.223 1.309a2.008 2.008 0 0 1-1.756 1.656l-1.065.119a37.177 37.177 0 0 1-3.071.215Z"/></svg>
Wrapped
</NavLink>
{!wrapped && <>
<NavLink href='/games'>
<T k='nucleoid.nav.recent_games' />
</NavLink>
<NavLink href='/leaderboards'>
<T k='nucleoid.nav.leaderboards' />
</NavLink>
<NavLink href='/wrapped/2024'>
{/* From: https://icon-sets.iconify.design/basil/present-solid/ */}
<svg className={styles.wrappedIcon} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" fillRule="evenodd" d="M6.25 5.5A3.25 3.25 0 0 1 12 3.423A3.25 3.25 0 0 1 17.062 7.5H18a2.5 2.5 0 0 1 2.5 2.5v1.25a.75.75 0 0 1-.75.75h-6.7a.3.3 0 0 1-.3-.3V8.24a3.267 3.267 0 0 1-.75-.663a3.267 3.267 0 0 1-.75.662V11.7a.3.3 0 0 1-.3.3h-6.7a.75.75 0 0 1-.75-.75V10A2.5 2.5 0 0 1 6 7.5h.938a3.236 3.236 0 0 1-.688-2Zm5 0a1.75 1.75 0 1 0-3.5 0a1.75 1.75 0 0 0 3.5 0Zm1.5 0a1.75 1.75 0 1 0 3.5 0a1.75 1.75 0 0 0-3.5 0Z" clipRule="evenodd"/><path fill="currentColor" d="M11.25 13.65a.3.3 0 0 0-.3-.3H5.649a.833.833 0 0 0-.82.692a11.592 11.592 0 0 0 0 3.916l.224 1.309a2.008 2.008 0 0 0 1.755 1.656l1.065.119a37.15 37.15 0 0 0 3.071.215a.298.298 0 0 0 .306-.299V13.65Zm1.806 7.607a.298.298 0 0 1-.306-.299V13.65a.3.3 0 0 1 .3-.3h5.301c.406 0 .752.292.82.692c.223 1.296.223 2.62 0 3.916l-.223 1.309a2.008 2.008 0 0 1-1.756 1.656l-1.065.119a37.177 37.177 0 0 1-3.071.215Z"/></svg>
Wrapped
</NavLink>
</>}
</nav>
}

Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ module.exports = {
images: {
domains: ['api.nucleoid.xyz'],
},
async redirects() {
return [
{
source: '/wrapped',
destination: '/wrapped/2024',
permanent: false,
},
];
},
}
Loading

0 comments on commit 0969784

Please sign in to comment.