55 </div >
66 <div class =" navBar" :class =" { noShadow: !isShadow }" >
77 <div id =" nav" ref =" nav" >
8- <router-link class =" navLink" to =" /" >
9- <span class = " navLogo " ><img src =" ../../static/logo.png" height =" 50px" ></span >
8+ <router-link class =" navLink navLogo " to =" /" >
9+ <span ><img src =" ../../static/logo.png" height =" 50px" ></span >
1010 </router-link >
1111 <div id =" mobileNavHeading" >
12- <h1 id =" bio" >Bio</h1 ><h1 id =" js" >JS</h1 >
12+ <router-link to = " / " >< h1 id =" bio" >Bio</h1 ><h1 id =" js" >JS</h1 ></ router-link >
1313 </div >
14- <router-link class =" navLink" to =" /components" ><span >Components</span ></router-link >
15- <router-link class =" navLink" to =" /guide" ><span >Guide</span ></router-link >
16- <router-link class =" navLink" to =" /about" ><span >About</span ></router-link >
17- <router-link class =" navLink" to =" /contact" ><span >Contact Us</span ></router-link >
14+ <router-link class =" navLink" :class = " active=='components'?'active':'' " to =" /components" ><span >Components</span ></router-link >
15+ <router-link class =" navLink" :class = " active=='guide'?'active':'' " to =" /guide" ><span >Guide</span ></router-link >
16+ <router-link class =" navLink" :class = " active=='about'?'active':'' " to =" /about" ><span >About</span ></router-link >
17+ <router-link class =" navLink" :class = " active=='contact_us'?'active':'' " to =" /contact" ><span >Contact Us</span ></router-link >
1818 <div class =" close" >
1919 <img @click =" closeMenu()" src =" ../../static/close.png" alt =" Close menu" >
2020 </div >
3030 <div class =" hamburger" onclick =" " >
3131 <img src =" ../../static/hamburger.png" alt =" Open Menu" @click =" openMenu()" >
3232 </div >
33-
33+
3434 <router-link class =" navLink logoLink" to =" /" >
3535 <span ><img src =" ../../static/logo.png" height =" 44px" ></span >
3636 </router-link >
@@ -46,6 +46,11 @@ export default {
4646 description: ' The navigation bar is made up with pure CSS. Vue-Router <router-link> has been used for links to various pages.' ,
4747 token: ' <div class="navBar">\n\t <div id="nav">\n\t\t <router-link to="/"><span>..</span></router-link>\n\t </div>\n </div>' ,
4848 props: {
49+ active: {
50+ type: String ,
51+ required: false ,
52+ default: null
53+ },
4954 isShadow: {
5055 type: Boolean ,
5156 required: false ,
@@ -71,6 +76,10 @@ export default {
7176 </script >
7277
7378<style lang="scss" scoped>
79+ .active >span ::after {
80+ background : #007E3A ;
81+ width : 105% !important ;
82+ }
7483#nav-container {
7584 width : 100% ;
7685 display : flex ;
@@ -113,7 +122,7 @@ export default {
113122 width : 80% ;
114123 display : flex ;
115124 justify-content : space-around ;
116- background : #f7f9ff ;
125+ background : #fff ;
117126 span {
118127 font-size : 17px ;
119128 cursor : pointer ;
@@ -178,6 +187,7 @@ export default {
178187 }
179188}
180189.hamburger {
190+ cursor : pointer ;
181191 display : none ;
182192 height : 40px ;
183193 width : 40px ;
@@ -206,6 +216,15 @@ export default {
206216 Responsive design
207217*/
208218@media (max-width : 768px ) {
219+ .navLink {
220+ span ::after {
221+ content : none !important ;
222+ }
223+ padding : 30px 30px ;
224+ }
225+ .navLink.active {
226+ background-color : #efefef ;
227+ }
209228 .navBar {
210229 width : 100% ;
211230 height : 70px ;
@@ -236,15 +255,14 @@ export default {
236255 transition : 0.4s all cubic-bezier (1 ,0 ,0 ,1 );
237256 span {
238257 padding-left : 30px ;
239- line-height : 60px ;
240258 font-size : 20px ;
241259 cursor : pointer ;
242260 transition : 0.2s all ease-in-out ;
243261 }
244262 span :hover ::after {
245263 width : 0% ;
246264 }
247- .navlink :hover {
265+ .navLink :hover {
248266 background-color : #efefef ;
249267 }
250268 }
@@ -270,7 +288,6 @@ export default {
270288 #nav {
271289 span {
272290 font-size : 15px ;
273- line-height : 40px ;
274291 }
275292 }
276293}
0 commit comments