styled navbar

This commit is contained in:
Yusuf Ipek
2021-05-09 12:37:40 +03:00
parent 42355f9430
commit e09f62bb39
4 changed files with 124 additions and 13 deletions
+1
View File
@@ -34,6 +34,7 @@ $color-black: #000;
$color-white: #fff; $color-white: #fff;
// FONT CONTROL // FONT CONTROL
$small-font-size: 1.2rem;
$default-font-size: 1.6rem; $default-font-size: 1.6rem;
$normal-font-size: 1.4rem; $normal-font-size: 1.4rem;
$medium-font-size: 3rem; $medium-font-size: 3rem;
+78
View File
@@ -1,4 +1,8 @@
.header { .header {
height: 7rem;
background-color: $color-white;
border-bottom: $color-grey-light-2;
display: flex; display: flex;
font-size: $normal-font-size; font-size: $normal-font-size;
@@ -119,3 +123,77 @@
} }
} }
} }
.sidebar {
background-color: $color-grey-dark-1;
flex: 0 0 18%;
display: flex;
flex-direction: column;
justify-content: space-between;
&__side-nav {
font-size: $small-font-size;
list-style: none;
margin-top: 3.5rem;
&--item {
position: relative;
&:not(:last-child) {
margin-bottom: 0.5rem;
}
&::before {
content: "";
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 3px;
background-color: $color-primary;
transform: scaleY(0);
transition: transform 0.2s, width 0.4s cubic-bezier(1, 0, 0, 1) 0.2s,
background-color 0.1s;
}
&:hover::before,
&--active::before {
transform: scaleY(1);
width: 100%;
}
&:active::before {
background-color: $color-primary-light;
}
}
&--link:link,
&--link:visited {
z-index: 1;
color: $color-grey-light-1;
text-decoration: none;
text-transform: uppercase;
display: block;
padding: 1.5rem 3rem;
position: relative;
display: flex;
align-items: center;
}
&--icon {
width: 1.75rem;
height: 1.75rem;
margin-right: 2rem;
fill: currentColor;
}
}
.legal {
font-size: $small-font-size;
color: $color-grey-light-4;
text-align: center;
padding: 2.5rem;
}
}
+1 -12
View File
@@ -7,24 +7,13 @@
min-height: 50rem; min-height: 50rem;
} }
.header {
height: 7rem;
background-color: $color-white;
border-bottom: $color-grey-light-2;
}
.content { .content {
display: flex; display: flex;
} }
.sidebar {
background-color: $color-grey-dark-1;
flex: 0 0 18%;
}
.hotel-view { .hotel-view {
background-color: $color-white; background-color: $color-white;
height: 80rem;
flex: 1; flex: 1;
} }
+44 -1
View File
@@ -1,5 +1,48 @@
import sprite from "../img/sprite.svg";
function Nav() { function Nav() {
return <nav className="sidebar">Navigation</nav>; return (
<nav className="sidebar">
<ul className="sidebar__side-nav">
<li className="sidebar__side-nav--item sidebar__side-nav--item--active">
<a href="#" className="sidebar__side-nav--link">
<svg className="sidebar__side-nav--icon">
<use href={`${sprite}#icon-home`}></use>
</svg>
<span>Hotel</span>
</a>
</li>
<li className="sidebar__side-nav--item">
<a href="#" className="sidebar__side-nav--link">
<svg className="sidebar__side-nav--icon">
<use href={`${sprite}#icon-aircraft-take-off`}></use>
</svg>
<span>Flight</span>
</a>
</li>
<li className="sidebar__side-nav--item">
<a href="#" className="sidebar__side-nav--link">
<svg className="sidebar__side-nav--icon">
<use href={`${sprite}#icon-key`}></use>
</svg>
<span>Car rental</span>
</a>
</li>
<li className="sidebar__side-nav--item">
<a href="#" className="sidebar__side-nav--link">
<svg className="sidebar__side-nav--icon">
<use href={`${sprite}#icon-map`}></use>
</svg>
<span>Tours</span>
</a>
</li>
</ul>
<div className="legal">&copy; 2017 by trillo. All rights reserved.</div>
</nav>
);
} }
export default Nav; export default Nav;