diff --git a/public/app.js b/public/app.js index ee8101f..9cb5436 100644 --- a/public/app.js +++ b/public/app.js @@ -94,6 +94,18 @@ new Vue({ }); } }, + toggleMenu: function () { + if (document.querySelector('.fullScreenMenu').style.display === "none") { + document.querySelector('.fullScreenMenu').style.display = ""; + this.animateCSS('.fullScreenMenu', 'rotateIn'); + } else { + Promise.all([ + this.animateCSS('.fullScreenMenu', 'rotateOut'), + ]).then(data => { + document.querySelector('.fullScreenMenu').style.display = "none" + }); + } + }, animateCSS: function (element, animation, prefix = 'animate__') { // We create a Promise and return it return new Promise((resolve, reject) => { @@ -112,6 +124,10 @@ new Vue({ node.addEventListener('animationend', handleAnimationEnd); }) + }, + interfaceClick: function () { + clearTimeout(this.controlsTimeout) + this.controlsTimeout = setTimeout(() => this.toggleControls(), 5000); } }, mounted() { diff --git a/public/index.css b/public/index.css index a3e3672..ea5dd2d 100644 --- a/public/index.css +++ b/public/index.css @@ -37,7 +37,7 @@ body { } #app .touchCanvas { - z-index: 9; + z-index: 5; } #app .content { @@ -123,3 +123,19 @@ body { text-align: center; margin-top: 48vh; } + +/* menu */ + +#app .fullScreenMenu { + width: 100vw; + height: 100vh; + z-index: 15; + background: white; + position: fixed; +} + +#app .fullScreenMenu .closeBtn { + position: fixed; + top: 10px; + right: 10px; +} diff --git a/public/index.html b/public/index.html index 6031e43..b04847d 100644 --- a/public/index.html +++ b/public/index.html @@ -16,23 +16,32 @@