-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from AzharAhmed-bot/Website-header
💄Website header-#1
- Loading branch information
Showing
3 changed files
with
162 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,118 @@ | ||
* { | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
*{ | ||
box-sizing: border-box; | ||
padding: 0; | ||
margin: 0; | ||
text-decoration: none; | ||
list-style: none; | ||
color: black; | ||
} | ||
body{ | ||
background-color:#F9F8F4; | ||
|
||
} | ||
nav{ | ||
height: 80px; | ||
width: 100%; | ||
justify-content: space-between; | ||
background-color:#F9F8F4; | ||
} | ||
label.logo{ | ||
font-size: 35px; | ||
font-weight: bold; | ||
color: black; | ||
padding: 0 100px; | ||
line-height: 80px; | ||
} | ||
.curved-line{ | ||
border-radius: 50%; | ||
border-bottom: 2px solid; | ||
} | ||
nav ul{ | ||
float: right; | ||
margin-right: 200px; | ||
} | ||
.nav-button { | ||
background:#2D2E52 0% 0% no-repeat padding-box; | ||
color: white; | ||
padding: 10px 30px; | ||
border: none; | ||
border-radius: 22px; | ||
font-size: 18px; | ||
margin-left: 150px; | ||
} | ||
|
||
|
||
nav li{ | ||
display: inline-block; | ||
margin: 0 8px; | ||
line-height: 80px; | ||
} | ||
nav a { | ||
color:black; | ||
font-size: 18px; | ||
padding: 7px 10px; | ||
} | ||
#icon{ | ||
color: black; | ||
font-size: 30px; | ||
line-height: 80px; | ||
float: right ; | ||
margin-right: 40px; | ||
cursor: pointer; | ||
display: none; | ||
} | ||
#icontwo{ | ||
color: black; | ||
font-size: 30px; | ||
line-height: 80px; | ||
float: right ; | ||
margin-right: 40px; | ||
cursor: pointer; | ||
display: none; | ||
} | ||
|
||
@media (max-width:909px){ | ||
label.logo{ | ||
font-size: 32px; | ||
padding-left: 60px; | ||
} | ||
nav ul{ | ||
margin-right:20px; | ||
} | ||
nav a{ | ||
font-size: 17px; | ||
} | ||
} | ||
@media (max-width:1181px){ | ||
#icon{ | ||
display: block; | ||
} | ||
nav ul{ | ||
position: fixed; | ||
width: 100%; | ||
height:100vh; | ||
background: #F9F8F4; | ||
top: 80px; | ||
left: -100%; | ||
text-align: center; | ||
transition:all .5s ; | ||
} | ||
nav li{ | ||
display: block ; | ||
margin: 10px 0; | ||
line-height: 30px; | ||
} | ||
.nav-button{ | ||
margin-left: 50px; | ||
} | ||
nav a{ | ||
font-size: 20px; | ||
} | ||
a.active,a:hover{ | ||
text-decoration: underline; | ||
} | ||
nav ul.show{ | ||
left: 0; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
document.addEventListener("DOMContentLoaded", () => { | ||
//Declare variables for the elements of the html | ||
const icon = document.getElementById("icon"); | ||
const iconTwo = document.getElementById("icontwo"); | ||
const ul = document.querySelector("ul"); | ||
//condition to check if the icon,icontwo and ul exist | ||
if (icon && iconTwo && ul) { | ||
//When fa-bars is clicked it adds the show class,then it's replaced with the fa-times | ||
icon.addEventListener("click", () => { | ||
ul.classList.add("show"); | ||
icon.style.display = "none"; | ||
iconTwo.style.display = "block"; | ||
}); | ||
//when fa-times is clicked it removes the .show class, then it's display is replaced with the fa-bars | ||
iconTwo.addEventListener("click", () => { | ||
ul.classList.remove("show"); | ||
icon.style.display = "block"; | ||
iconTwo.style.display = "none"; | ||
}); | ||
} | ||
}); | ||
|