Toggle another transition using Javascript

I’m trying to trigger another transition on the second navigation bar after its first transition scrolling down 100 pixel. The next transition I want should toggle after the user scrolls back less than 100 pixel but I have not been able to find another way to trigger another transition to place the nav bar back into its original position where its not visible. The rest of the code is in the link. Any ideas how I can approach this? Should I add another class?

window.onload = function (){
var nav = document.getElementById(‘nav’)

window.addEventListener(‘scroll’, function () {
if (window.pageYOffset >= 100) {
// = ‘block’;


  if (window.pageYOffset <= 100)  {

//add another class?
// = ‘none’



//call function to move to the next image
var click = document.getElementById(‘gallery’);
click.addEventListener(“click”, push);