Skip to content

Commit

Permalink
Started building the navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
ruta-is-coding committed Dec 2, 2023
1 parent 5ef3f5d commit 6a6c37c
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 41 deletions.
65 changes: 64 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ body {
width: 1.3rem;
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #55c57a;
opacity: 0;
Expand Down Expand Up @@ -540,6 +540,69 @@ body {
float: right;
letter-spacing: 0.15rem; }

.navigation__checkbox {
display: none; }

.navigation__button {
background-color: #fff;
height: 7rem;
width: 7rem;
border-radius: 50%;
position: fixed;
top: 6rem;
right: 6rem;
z-index: 200; }

.navigation__background {
height: 6rem;
width: 6rem;
border-radius: 50%;
position: fixed;
z-index: 100;
top: 6.5rem;
right: 6.5rem;
background-image: radial-gradient(#7ed56f, #28b485);
transform: scale(80); }

.navigation__nav {
height: 100vh;
width: 100vw;
position: fixed;
top: 0;
right: 0;
z-index: 150; }

.navigation__list {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
list-style-type: none;
text-align: center; }

.navigation__item {
margin: 1rem; }

.navigation__link:link, .navigation__link:visited {
display: inline-block;
font-size: 3rem;
padding: 0.5rem 1.5rem;
font-weight: 300;
color: #fff;
text-decoration: none;
text-transform: uppercase;
background-image: linear-gradient(120deg, transparent 0%, transparent 50%, #fff 50%);
background-size: 250%;
transition: all 0.6s; }
.navigation__link:link span, .navigation__link:visited span {
margin-right: 1.3rem;
display: inline-block; }

.navigation__link:hover, .navigation__link:active {
background-position: 100%;
color: #55c57a;
transform: translateX(1rem); }

.section-about {
background-color: #f7f7f7;
padding: 25rem 5rem;
Expand Down
64 changes: 32 additions & 32 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,37 @@
<title>Natours | Exciting tours for adventurous people</title>
</head>
<body>
<div class="navigation">
<input type="checkbox" class="navigation__checkbox" id="nav-toggle" />
<label for="nav-toggle" class="navigation__button">MENU</label>
<div class="navigation__background">&nbsp;</div>
<nav class="navigation__nav">
<ul class="navigation__list">
<li class="navigation__item">
<a href="#" class="navigation__link"
><span>01</span>About Natours</a
>
</li>
<li class="navigation__item">
<a href="#" class="navigation__link"
><span>02</span>Your benefits</a
>
</li>
<li class="navigation__item">
<a href="#" class="navigation__link"
><span>03</span>Popular tours</a
>
</li>
<li class="navigation__item">
<a href="#" class="navigation__link"><span>04</span>Stories</a>
</li>
<li class="navigation__item">
<a href="#" class="navigation__link"><span>05</span>Book now</a>
</li>
</ul>
</nav>
</div>

<header class="header">
<div class="header__logo-box">
<img src="img/logo-white.png" alt="logo" class="header__logo" />
Expand Down Expand Up @@ -399,36 +430,5 @@ <h2 class="heading-secondary">Start booking now!</h2>
</div>
</div>
</footer>
<!--
<section class="grid-test">
<div class="row">
<div class="col-1-of-2">Col 1 of 2</div>
<div class="col-1-of-2">Col 1 of 2</div>
</div>
<div class="row">
<div class="col-1-of-3">Col 1 of 3</div>
<div class="col-1-of-3">Col 1 of 3</div>
<div class="col-1-of-3">Col 1 of 3</div>
</div>
<div class="row">
<div class="col-1-of-3">Col 1 of 3</div>
<div class="col-2-of-3">Col 2 of 3</div>
</div>
<div class="row">
<div class="col-1-of-4">Col 1 of 4</div>
<div class="col-1-of-4">Col 1 of 4</div>
<div class="col-1-of-4">Col 1 of 4</div>
<div class="col-1-of-4">Col 1 of 4</div>
</div>
<div class="row">
<div class="col-1-of-4">Col 1 of 4</div>
<div class="col-1-of-4">Col 1 of 4</div>
<div class="col-2-of-4">Col 2 of 4</div>
</div>
<div class="row">
<div class="col-1-of-4">Col 1 of 4</div>
<div class="col-3-of-4">Col 3 of 4</div>
</div>
</section>
--></body>
</body>
</html>
7 changes: 7 additions & 0 deletions sass/abstracts/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@
clear: both;
}
}

@mixin centerAbsolute {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
5 changes: 1 addition & 4 deletions sass/components/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,7 @@

//BACK SIDE STYLING
&__cta {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
@include centerAbsolute;
width: 90%;
text-align: center;
}
Expand Down
5 changes: 1 addition & 4 deletions sass/components/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@
height: 1.3rem;
width: 1.3rem;
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
@include centerAbsolute;
background-color: $color-primary;
opacity: 0;
transition: opacity 0.2s;
Expand Down
84 changes: 84 additions & 0 deletions sass/layout/_navigation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
.navigation {
&__checkbox {
display: none;
}

&__button {
background-color: $color-white;
height: 7rem;
width: 7rem;
border-radius: 50%;
position: fixed;
top: 6rem;
right: 6rem;
z-index: 200;
}

&__background {
height: 6rem;
width: 6rem;
border-radius: 50%;
position: fixed;
z-index: 100;
top: 6.5rem;
right: 6.5rem;
background-image: radial-gradient(
$color-primary-light,
$color-primary-dark
);

transform: scale(80);
}

&__nav {
height: 100vh;
width: 100vw;
position: fixed;
top: 0;
right: 0;
z-index: 150;
}

&__list {
@include centerAbsolute;
list-style-type: none;
text-align: center;
}

&__item {
margin: 1rem;
}

&__link {
&:link,
&:visited {
display: inline-block;
font-size: 3rem;
padding: 0.5rem 1.5rem;
font-weight: 300;
color: $color-white;
text-decoration: none;
text-transform: uppercase;
background-image: linear-gradient(
120deg,
transparent 0%,
transparent 50%,
$color-white 50%
);
background-size: 250%;
transition: all 0.6s;

span {
margin-right: 1.3rem;
display: inline-block;
}
}

&:hover,
&:active {
background-position: 100%;
color: $color-primary;
transform: translateX(1rem);
}
}
}
1 change: 1 addition & 0 deletions sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
@import "layout/grid";
@import "layout/header";
@import "layout/footer";
@import "layout/navigation";

@import "pages/home";

0 comments on commit 6a6c37c

Please sign in to comment.