Skip to content

Commit

Permalink
fixed menu toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
MattRoweEAIF committed Mar 18, 2024
1 parent 931266a commit c1f16ad
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 29 deletions.
33 changes: 15 additions & 18 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ p {
flex-direction: column;
flex-shrink: 1;
flex-grow: 1;

flex-basis: 0;
/* width: 100%; */
/* overflow: hidden;
Expand All @@ -181,7 +181,7 @@ p {

.remove-column {
position: absolute;
transform: scale(0,1);
transform: scale(0, 1);
}

@media only screen and (min-width: 768px) {
Expand All @@ -193,7 +193,7 @@ p {
.landing-page-spacer {
height: 8vh;
}

.page-flex-column-right {
display: flex;
flex-direction: column;
Expand All @@ -203,6 +203,7 @@ p {
/* min-width: 100%; */
/* padding-left: 20%; */
}

.last-section-mobile {
position: absolute;
transform: scale(0);
Expand All @@ -226,7 +227,7 @@ p {
/* min-width: 100%; */
padding-left: 20%;
position: absolute;
transform: scale(0,0);
transform: scale(0, 0);
}

.last-section-desktop {
Expand Down Expand Up @@ -279,15 +280,16 @@ section p {

@supports (transition: initial) {

.transparent-transition {
opacity: 1.0;
transition: opacity 1s;
}
.transparent-transition {
opacity: 1.0;
transition: opacity 1s;
}

.transparent-transition-fast {
opacity: 1.0;
transition: opacity 0.8s;
}
.transparent-transition-fast {
opacity: 1.0;
transition: opacity 0.8s;
}

}

.opacity-full {
Expand Down Expand Up @@ -350,9 +352,4 @@ section p {
display: inline;
font-size: 1.5em;
margin-right: 1em;
}





}
1 change: 1 addition & 0 deletions css/nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ nav a {
order: 1;
font-size: 2em;
color: white;
cursor: pointer;
}

.item.button {
Expand Down
29 changes: 18 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,15 @@ <h2 class="text-left" style="color:white;display:inline;margin-right:2em;"><stro
var scrollLock = false;
var deltaY = 0;

addEventListener("wheel", (event) => { deltaY = event.deltaY });
addEventListener("wheel", (event) => {
deltaY = event.deltaY;
if (deltaY > 0) {
nav = document.getElementById("nav");
nav.classList.add('hidenav')
} else {
nav.classList.remove('hidenav')
}
});

// addEventListener("resize", (event) => { scrollLock = true; setTimeout(() => { scrollLock = false; }, 100) });

Expand Down Expand Up @@ -1064,14 +1072,14 @@ <h2 class="text-left" style="color:white;display:inline;margin-right:2em;"><stro
// }
// })

scroll.on('scroll', (args) => {
if (deltaY > 0) {
nav = document.getElementById("nav");
nav.classList.add('hidenav')
} else {
nav.classList.remove('hidenav')
}
})
// scroll.on('scroll', (args) => {
// if (deltaY > 0) {
// nav = document.getElementById("nav");
// nav.classList.add('hidenav')
// } else {
// nav.classList.remove('hidenav')
// }
// })

var touchMoveCounter = 0;

Expand Down Expand Up @@ -1140,12 +1148,11 @@ <h2 class="text-left" style="color:white;display:inline;margin-right:2em;"><stro
}

function toggleMenu() {
console.log('toggle')
if (menu.classList.contains("active")) {
addBurger();
} else {
addX();
setTimeout(addBurger, 3000);
setTimeout(addBurger, 4000);
}
}

Expand Down

0 comments on commit c1f16ad

Please sign in to comment.