Skip to content

Commit

Permalink
upde: I messed up my commits
Browse files Browse the repository at this point in the history
  • Loading branch information
xonnu authored Sep 5, 2021
1 parent 8c41f27 commit 7cac624
Show file tree
Hide file tree
Showing 14 changed files with 1,349 additions and 1,305 deletions.
2 changes: 1 addition & 1 deletion design/app/build/style/main.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion design/app/build/style/main.min.css.map

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions design/app/dist/css/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion design/app/dist/css/main.css.map

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions design/app/dist/script/modal.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
const modalStorageName = 'chronobiks-modal-view';
const modal = document.querySelector("#modal");
const modalButton = document.querySelector("#understand");
const modalInnerElements = document.querySelectorAll('#modal > *');

if(localStorage.getItem(modalStorageName) == null) {
localStorage.setItem(modalStorageName, true);
}
console.log(localStorage.getItem(modalStorageName))
if(localStorage.getItem(modalStorageName) === 'false') {
modal.classList.add('modal--hide');
sidebarOverlay.classList.add('sidebar--overlay--close');
} else {
modal.classList.remove('modal--hide');
sidebarOverlay.classList.remove('sidebar--overlay--close');

gsap.from(modal, {
duration: 1,
y: 100,
opacity: 0,
ease: "bounce.out"
})

let delay = 0.3;
modalInnerElements.forEach(elements => {
delay += 0.1
gsap.from(elements, {
y: 30,
duration: 1,
delay: delay,
opacity: 0,
ease: "expo.out",
onComplete: () => {
delay = 0.3;
}
})
})

}

const userUnderstand = () => {
gsap.to(modal, {
duration: 0.3,
y: 50,
opacity: 0,
ease: "expo.out",
onComplete: () => {
localStorage.setItem(modalStorageName, false);
modal.classList.add('modal--hide')
sidebarOverlay.classList.add('sidebar--overlay--close');
}
})
}

const modalStorageName = 'chronobiks-modal-view';
const modal = document.querySelector("#modal");
const modalButton = document.querySelector("#understand");
const modalInnerElements = document.querySelectorAll('#modal > *');

if(localStorage.getItem(modalStorageName) == null) {
localStorage.setItem(modalStorageName, true);
}
console.log(localStorage.getItem(modalStorageName))
if(localStorage.getItem(modalStorageName) === 'false') {
modal.classList.add('modal--hide');
sidebarOverlay.classList.add('sidebar--overlay--close');
} else {
modal.classList.remove('modal--hide');
sidebarOverlay.classList.remove('sidebar--overlay--close');

gsap.from(modal, {
duration: 1,
y: 100,
opacity: 0,
ease: "bounce.out"
})

let delay = 0.3;
modalInnerElements.forEach(elements => {
delay += 0.1
gsap.from(elements, {
y: 30,
duration: 1,
delay: delay,
opacity: 0,
ease: "expo.out",
onComplete: () => {
delay = 0.3;
}
})
})

}

const userUnderstand = () => {
gsap.to(modal, {
duration: 0.3,
y: 50,
opacity: 0,
ease: "expo.out",
onComplete: () => {
localStorage.setItem(modalStorageName, false);
modal.classList.add('modal--hide')
sidebarOverlay.classList.add('sidebar--overlay--close');
}
})
}

modalButton.addEventListener('click', userUnderstand);
89 changes: 44 additions & 45 deletions design/app/dist/script/sidebar.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
/* inputs */
const openButton = document.querySelector('#open-button');
const closeButton = document.querySelector('#close-button');
/* design */
const sidebar = document.querySelector('.sidebar');
const sidebarOverlay = document.querySelector('.sidebar--overlay');
const timeGroup = document.querySelectorAll('.sidebar__timeGroup > *')

let delayAdded = 0.3;

const openSidebar = () => {
sidebarOverlay.classList.remove('sidebar--overlay--close');
setTimeout(() => {
sidebar.classList.add('sidebar--open')
timeGroup.forEach(time => {
delayAdded += 0.1
gsap.from(time, {
y: 30,
duration: .3,
delay: delayAdded,
opacity: 0,
ease: "expo.out",
onComplete: () => {
delayAdded = 0.3;
}
})
})
}, 250);
};

const closeSidebar = () => {
setTimeout(() => {
sidebarOverlay.classList.add('sidebar--overlay--close');
}, 400);

sidebar.classList.remove('sidebar--open');
};

sidebarOverlay.addEventListener('click', closeSidebar);
openButton.addEventListener('click', openSidebar);
closeButton.addEventListener('click', closeSidebar);


const navbar = document.querySelector('.navbar');
const goTriggered = document.querySelector('.go');
const openButton = document.querySelector('#open-button');
const closeButton = document.querySelector('#close-button');

const sidebar = document.querySelector('.sidebar');
const sidebarOverlay = document.querySelector('.sidebar--overlay');
const timeGroup = document.querySelectorAll('.sidebar__timeGroup > *')

let delayAdded = 0.3;

const openSidebar = () => {
sidebarOverlay.classList.remove('sidebar--overlay--close');
setTimeout(() => {
sidebar.classList.add('sidebar--open')
timeGroup.forEach(time => {
delayAdded += 0.1
gsap.from(time, {
y: 30,
duration: .3,
delay: delayAdded,
opacity: 0,
ease: "expo.out",
onComplete: () => {
delayAdded = 0.3;
}
})
})
}, 250);
};

const closeSidebar = () => {
if (!document.querySelector('#modal').classList.contains('modal--hide')) return;
setTimeout(() => {
sidebarOverlay.classList.add('sidebar--overlay--close');
}, 400);

sidebar.classList.remove('sidebar--open');
};

sidebarOverlay.addEventListener('click', closeSidebar);
openButton.addEventListener('click', openSidebar);
closeButton.addEventListener('click', closeSidebar);

const navbar = document.querySelector('.navbar');
const goTriggered = document.querySelector('.go');
const newestTime = document.querySelector('.timer__newest');
Loading

0 comments on commit 7cac624

Please sign in to comment.