Skip to content

Commit

Permalink
feat: add side burguer menu to playground, matrixGenerator and matrix…
Browse files Browse the repository at this point in the history
…Playground pages
  • Loading branch information
Kywal committed Nov 28, 2023
1 parent 8ee31ab commit 0eef4ce
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions scripts/menuBurguer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

/**
*
*/
function showMenu(menuButton) {
let aside = document.querySelector("aside");
let asideDisplay = aside.style.display;
let buttonImg = document.querySelector("#menu-burguer > img");

if(asideDisplay == "") {
aside.style.display = "flex";
aside.style.justifyContent = "center";
menuButton.style.right = "10rem";
menuButton.style.borderColor = "white";

buttonImg.src = "../assets/imgs/menu-button-of-three-horizontal-lines-white.png"
} else if (asideDisplay != "") {
aside.style.display = "";
menuButton.style.right = "3rem";
menuButton.style.borderColor = "black";
buttonImg.src = "../assets/imgs/menu-button-of-three-horizontal-lines.png"
}
}

19 changes: 19 additions & 0 deletions src/matrixGenerator.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,25 @@ <h4></h4>

</main>

<div id="menu-burguer" onclick="showMenu(this)">
<img src="../assets/imgs/menu-button-of-three-horizontal-lines.png" alt="">
</div>

<aside>
<ul>
<li>
<a href="../index.html">menu</a>
</li>
<li>
<a href="playground.html">playground</a>
</li>
<li>
<a href="perfil.html">perfil</a>
</li>
</ul>
</aside>

<script src="../scripts/menuBurguer.js"></script>
<script src="../scripts/subtitleGenerator.js"></script>
<script src="../scripts/updateIcon.js"></script>
<script src="../scripts/matrixGenerator.js"></script>
Expand Down
20 changes: 20 additions & 0 deletions src/matrixPlayground.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@ <h1></h1>
</div>
</div>
</main>

<div id="menu-burguer" onclick="showMenu(this)">
<img src="../assets/imgs/menu-button-of-three-horizontal-lines.png" alt="">
</div>

<aside>
<ul>
<li>
<a href="../index.html">menu</a>
</li>
<li>
<a href="playground.html">playground</a>
</li>
<li>
<a href="perfil.html">perfil</a>
</li>
</ul>
</aside>

<script src="../scripts/menuBurguer.js"></script>
<script src="../scripts/titleGenerator.js"></script>
<script src="../scripts/matrixPlayground.js"></script>
<script src="../scripts/matrixGenerator.js"></script>
Expand Down
19 changes: 19 additions & 0 deletions src/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@ <h1>PLAYGROUND</h1>
</div>
</main>

<div id="menu-burguer" onclick="showMenu(this)">
<img src="../assets/imgs/menu-button-of-three-horizontal-lines.png" alt="">
</div>

<aside>
<ul>
<li>
<a href="../index.html">menu</a>
</li>
<li>
<a href="playground.html">playground</a>
</li>
<li>
<a href="perfil.html">perfil</a>
</li>
</ul>
</aside>

<script src="../scripts/menuBurguer.js"></script>
<script src="../scripts/saveTitle.js"></script>
</body>
</html>
64 changes: 64 additions & 0 deletions style/imports.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,69 @@
box-sizing: border-box;
}

body {
display: flex;
justify-content: flex-end;
align-items: start;
}

/* ------------ Menu Burguer ---------*/

aside {
display: none;

border-style: solid;
border-width: 0 0 0 0.2rem;
border-color: white;

position: absolute;
width: 15rem;
height: 100%;

padding: 2rem;

background-color: black;
z-index: 0;
}

#menu-burguer {
width: 3.5rem;
height: 3.5rem;

display: flex;
justify-content: center;
align-items: center;

border: 1px solid black;
border-radius: 3rem;

position: absolute;
top: 1.5rem;
right: 3rem;
z-index: 1;
}

ul {
display: flex;
flex-direction: column;
justify-content: center;
align-items: start;
gap: 1rem;

position: relative;
top: 2rem;

width: 10rem;
height: 10rem;

color: white;
text-align: start;

padding: 1rem 0;

list-style: none;
}

/* ------------ Main title -----------*/

.main-title {
Expand All @@ -37,6 +100,7 @@ h1 {

a {
text-decoration: none;
color: inherit;
}

/* ------------ Buttons ---------------*/
Expand Down

0 comments on commit 0eef4ce

Please sign in to comment.