Make menu button slide up (experimental). Disable tabindex on overlay.

This commit is contained in:
Daniel Scalzi
2018-04-29 18:39:57 -04:00
parent 4106b2b069
commit 39fd7e19ef
4 changed files with 46 additions and 6 deletions

View File

@@ -127,6 +127,7 @@ server_selection_button.addEventListener('click', (e) => {
toggleServerSelection(true)
})
let menuActive = false
// Test menu transform.
function slide_(up){
const lCUpper = document.querySelector('#landingContainer > #upper')
@@ -141,13 +142,13 @@ function slide_(up){
lCLCenter.style.top = '-200vh'
lCLRight.style.top = '-200vh'
menuBtn.style.top = '130vh'
setTimeout(() => {
/*setTimeout(() => {
lCLCenter.style.transition = 'none'
menuBtn.style.transition = 'none'
}, 2000)
}, 2000)*/
} else {
lCLCenter.style.transition = null
menuBtn.style.transition = null
//lCLCenter.style.transition = null
//menuBtn.style.transition = null
lCUpper.style.top = '0px'
lCLLeft.style.top = '0px'
lCLCenter.style.top = '0px'
@@ -156,6 +157,11 @@ function slide_(up){
}
}
document.getElementById('menu_button').onclick = () => {
slide_(!menuActive)
menuActive = !menuActive
}
// Update Mojang Status Color
const refreshMojangStatuses = async function(){
console.log('Refreshing Mojang Statuses..')

View File

@@ -20,6 +20,8 @@ function toggleOverlay(toggleState, dismissable = false, content = 'overlayConte
}
if(toggleState){
document.getElementById('main').setAttribute('overlay', true)
// Make things tabbable.
$("#main *").attr('tabindex', '-1')
$('#' + content).parent().children().hide()
$('#' + content).show()
if(dismissable){
@@ -30,6 +32,8 @@ function toggleOverlay(toggleState, dismissable = false, content = 'overlayConte
$('#overlayContainer').fadeIn(250)
} else {
document.getElementById('main').removeAttribute('overlay')
// Make things tabbable.
$("#main *").removeAttr('tabindex')
$('#overlayContainer').fadeOut(250, () => {
$('#' + content).parent().children().hide()
$('#' + content).show()