Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PT RMT 102024 TRIX MOSTERT #359

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<header>
<h1 class="newspaper-name">Ironhack News</h1>
<nav>
<ul class="navbar">
<div id="burger-menu" class="burger-menu"><img src="images/menu-icon.png" alt="burger-icon"/></div>
<ul id="nav-bar" class="navbar">
<li><a href="#">Home</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Tech</a></li>
Expand Down Expand Up @@ -76,5 +77,6 @@ <h2>Article 3</h2>
<span class="viewport-dimensions"></span>
<!-- DO NOT REMOVE - A simple JS script used to display the viewport width label -->
<script src="javascript/width-label.js"></script>
<script src="javascript/menu.js"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions javascript/menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
document.getElementById("burger-menu").addEventListener("click", () => {
console.log("click");
let elements = document.getElementsByClassName("navbar");
let elementss = [...elements];

elementss.forEach(element => {
if(element.style.display === "block"){
element.style.display = "none";
}else{
element.style.display = "block";
}
});
})
109 changes: 109 additions & 0 deletions styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,114 @@ header {
.btn-blue {
background-color: #007bff;
}

.burger-menu{
display: none;
}

/* Write your CSS below */

@media screen and (max-width: 1024px) and (min-width: 760px) {
.navbar {
justify-content: space-evenly;
}
.navbar li {
width: 256px;
}

.article {
width: calc(50% - 30px);
padding-right: 30px;
margin-bottom: 30px;
}
.burger-menu{
display: none;
}
}

/* mobile */
@media screen and (max-width: 761px) and (min-width: 480px) {
nav ul {
display: flex;
flex-direction: column;
}

.navbar li {
width: 100%;
justify-content: center;
border-bottom: 1px solid white;
border-right: none;
}
.main-article{
display: block;
}

.articles-container {
flex-direction: column;
width: 100%;
}

.main-article .image {
width: 100%;
}

.main-article .content {
width: 100%;
padding-top: 15px;
}

.article {
width: 100%;
margin-bottom: 30px;
}
.burger-menu{
display: none;
}
}

@media screen and (max-width: 481px){
.navbar {
display: none;
}
nav ul {
display: flex;
flex-direction: column;
}

.navbar li {
width: 100%;
justify-content: center;
border-bottom: 1px solid white;
border-right: none;
}

.burger-menu {
display: block;
}
.newspaper-name {
border-bottom: none;
}
.main-article{
display: block;
}

.articles-container {
flex-direction: column;
width: 100%;
}

.main-article .image {
width: 100%;
}

.main-article .content {
width: 100%;
padding-top: 15px;
}

.article {
width: 100%;
margin-bottom: 30px;
}
}