File tree 7 files changed +32
-7
lines changed
7 files changed +32
-7
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import Timer from '@/app/(home)/Timer';
3
3
4
4
export default function Home ( ) {
5
5
return (
6
- < main className = "container py -24 flex flex-col items-center" >
6
+ < main className = "container pt-36 pb -24 flex flex-col items-center" >
7
7
< img src = "/assets/logo.svg" />
8
8
< Timer />
9
9
todo
Original file line number Diff line number Diff line change
1
+ 'use client'
2
+
3
+ import { useScroll } from '@/hooks/useScroll' ;
1
4
import NavLink from '@/app/NavLink' ;
2
5
3
6
4
7
export default function NavBar ( ) {
8
+ const scroll = useScroll ( ) ;
9
+
5
10
return (
6
- < nav className = " flex justify-center pt-2" >
11
+ < nav className = { ' flex justify-center pt-3 pb-2 fixed w-full top-0 transition duration-200' + ( scroll > 0 ? ' bg-black/30 backdrop-blur-md' : '' ) } >
7
12
< NavLink href = "/" > Home</ NavLink >
8
13
< NavLink href = "/scoreboard" > Scoreboard</ NavLink >
9
14
< NavLink href = "/challenges" > Challenges</ NavLink >
Original file line number Diff line number Diff line change 1
1
export default function Challenge ( ) {
2
2
return (
3
- < div className = "bg-black/30 px-6 py-4 rounded" >
3
+ < div className = "bg-black/50 px-6 py-4 rounded" >
4
4
< div className = "flex justify-between" >
5
5
< h3 className = "font-semibold" >
6
6
web/foo
Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ import Challenge from '@/app/challenges/Challenge';
3
3
4
4
export default function Challenges ( ) {
5
5
return (
6
- < div className = "flex-grow flex flex-col gap-2" >
6
+ < div className = "flex-grow flex flex-col gap-3" >
7
+ < Challenge />
8
+ < Challenge />
7
9
< Challenge />
8
10
< Challenge />
9
11
< Challenge />
Original file line number Diff line number Diff line change @@ -2,16 +2,19 @@ import type {ReactNode} from 'react';
2
2
3
3
export default function Filters ( ) {
4
4
return (
5
- < div className = "bg-black/20 px-6 py-4 rounded w-80 h-max" >
5
+ < div className = "bg-black/30 px-6 py-4 rounded w-80 h-max sticky top-32 " >
6
6
< h2 className = "font-semibold mb-1" > Filters</ h2 >
7
7
8
- < div className = "flex flex-col gap-1 pl-2" >
8
+ < div className = "flex flex-col gap-1 pl-2 mb-3 " >
9
9
< FilterOption > crypto</ FilterOption >
10
10
< FilterOption > misc</ FilterOption >
11
11
< FilterOption > pwn</ FilterOption >
12
12
< FilterOption > rev</ FilterOption >
13
13
< FilterOption > web</ FilterOption >
14
14
</ div >
15
+ < div className = "pl-2" >
16
+ < FilterOption > Show solved</ FilterOption >
17
+ </ div >
15
18
</ div >
16
19
)
17
20
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import Challenges from '@/app/challenges/Challenges';
4
4
5
5
export default function ChallengesPage ( ) {
6
6
return (
7
- < div className = "container py -24 flex gap-4" >
7
+ < div className = "container pt-32 pb -24 flex gap-4" >
8
8
< Filters />
9
9
< Challenges />
10
10
</ div >
Original file line number Diff line number Diff line change
1
+ import { useEffect , useState } from 'react' ;
2
+
3
+
4
+ // Returns the current vertical scroll of the window, in pixels.
5
+ export function useScroll ( ) {
6
+ const [ scroll , setScroll ] = useState ( 0 ) ;
7
+
8
+ useEffect ( ( ) => {
9
+ setScroll ( window . scrollY ) ;
10
+ document . addEventListener ( 'scroll' , ( ) => setScroll ( window . scrollY ) ) ;
11
+ return ( ) => document . removeEventListener ( 'scroll' , ( ) => setScroll ( window . scrollY ) ) ;
12
+ } , [ ] ) ;
13
+
14
+ return scroll ;
15
+ }
You can’t perform that action at this time.
0 commit comments