diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2023-09-01 06:18:20 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2023-09-01 06:18:20 +0300 |
commit | 7eb510a56a0015ccd887b694bdb497309dc42f87 (patch) | |
tree | 94ad8d24f308c05ca782a8c6bca53e85a0929086 /src/js/menu-magic.js | |
parent | c03eac7b80432c79c01a744734d0a4d4e989f46f (diff) | |
download | arching-kaos-web-ui-7eb510a56a0015ccd887b694bdb497309dc42f87.tar.gz arching-kaos-web-ui-7eb510a56a0015ccd887b694bdb497309dc42f87.tar.bz2 arching-kaos-web-ui-7eb510a56a0015ccd887b694bdb497309dc42f87.zip |
Huge update, read description
- Bug fixes
- Splitted app.js to many files
- Gathered CSS to one place instead of layers
- Redesigned page layout
- Added settings so you can personalize them later
- Redesigned menu layout
- Added radio player for AKDR to connect there
Diffstat (limited to 'src/js/menu-magic.js')
-rw-r--r-- | src/js/menu-magic.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/js/menu-magic.js b/src/js/menu-magic.js new file mode 100644 index 0000000..8ab1bb8 --- /dev/null +++ b/src/js/menu-magic.js @@ -0,0 +1,48 @@ +/* + * Menu bar management + * + * We change the visible floor according to menu selection. + * + */ +var upperFloor = document.querySelector('.upper-floor'); +var lowerFloor = document.querySelector('.lower-floor'); +var modulesSubmenu = document.querySelector('#modules-submenu'); +modulesSubmenu.style.display = 'none'; +upperFloor.style.display = 'flex'; +lowerFloor.style.display = 'none'; +function modulesSubToggle(){ + modulesSubmenu.style.display = modulesSubmenu.style.display === 'none' ? 'flex' : 'none'; + upperFloor.style.display = upperFloor.style.display === 'none' ? 'flex' : 'none'; + lowerFloor.style.display = lowerFloor.style.display === 'none' ? 'flex' : 'none'; +} +var exploreSubmenu = document.querySelector('#explore-submenu'); +exploreSubmenu.style.display = 'none'; +function exploreSubToggle(){ + exploreSubmenu.style.display = exploreSubmenu.style.display === 'none' ? 'flex' : 'none'; + upperFloor.style.display = upperFloor.style.display === 'none' ? 'flex' : 'none'; + lowerFloor.style.display = lowerFloor.style.display === 'none' ? 'flex' : 'none'; +} +// Function to hide all the panes +function menuinit(){ + menuids.forEach(m=>document.querySelector(m).hidden=true); +} + +/* + * Function called on clicks on the menu bar + * Unhides the pane connected to the clicked menu entry + */ +function menusel(m){ + menuinit(); + document.querySelector(m.id.replace('/','')).hidden=false; + + mainContainer.style.display = 'block'; + if ( isMobile ) { + doubleFloorMenu.style.display = 'none'; + } +} + +//var doubleFloorMenuDisplay = doubleFloorMenu.style.display; +function toggleMenu(m){ + mainContainer.style.display = 'none'; + doubleFloorMenu.style.display = 'flex'; +} |