File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1
1
.next
2
2
node_modules
3
3
.env
4
+ .DS_Store
4
5
Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ import Image from 'next/image';
4
4
import Container from './Container' ;
5
5
import styles from '../styles/Nav.module.scss' ;
6
6
import { linksNav } from '../utils/links' ;
7
+ import { useRouter } from 'next/router' ;
7
8
8
9
export default function Nav ( ) {
10
+ const router = useRouter ( ) ;
9
11
const [ active , setActive ] = useState ( false ) ;
10
12
const headerRef = useRef ( ) ;
11
13
const containerRef = useRef ( ) ;
@@ -62,7 +64,12 @@ export default function Nav() {
62
64
return (
63
65
< li className = { styles . nav__item } key = { id } >
64
66
< Link href = { href } >
65
- < a className = { styles . nav__link } title = { text } >
67
+ < a
68
+ className = { `${ styles . nav__link } ${
69
+ router . pathname == href ? `${ styles . current } ` : ''
70
+ } `}
71
+ title = { text }
72
+ >
66
73
{ text }
67
74
</ a >
68
75
</ Link >
Original file line number Diff line number Diff line change 116
116
line-height : 2.5 ;
117
117
font-weight : 400 ;
118
118
display : block ;
119
+ @include transition (all 0.3s ease );
120
+
121
+ & :hover ,
122
+ & .current {
123
+ font-weight : 600 ;
124
+ }
125
+
126
+ & :before {
127
+ display : block ;
128
+ content : attr (title );
129
+ font-weight : bold ;
130
+ height : 1px ;
131
+ color : transparent ;
132
+ overflow : hidden ;
133
+ visibility : hidden ;
134
+ }
119
135
120
136
@include large-desktop {
121
137
font-size : 1.5rem ;
143
159
width : 25px ;
144
160
height : 2px ;
145
161
margin : 5px auto ;
146
- transition : all 0.3s ease-in-out ;
162
+ @include transition ( opacity 0.3s ease ) ;
147
163
background-color : $white ;
148
164
}
149
165
You can’t perform that action at this time.
0 commit comments