Files
ReZygisk/webroot/js/navbar.js
Alice w/🌧️ 4de1b443cf add: ReZygisk WebUI (#73)
This commit adds the ReZygisk WebUI to ReZygisk.

Signed-off-by: Emulond Argent <108662981+Emulond@users.noreply.github.com>
Signed-off-by: WinCS <94188592+Meltartica@users.noreply.github.com>
Signed-off-by: Pedro.js <pedroolimpioguerra@gmail.com>
Signed-off-by: unexpected unresolved <minh15052008@gmail.com>
Signed-off-by: SheepChef <50871867+SheepChef@users.noreply.github.com>
Signed-off-by: AJleKcAHgP68 <78802768+AJleKcAHgP68@users.noreply.github.com>
Signed-off-by: Blazzycrafter <39300111+Blazzycrafter@users.noreply.github.com>
Signed-off-by: Igor <sorocean.igor@gmail.com>
Signed-off-by: unexpected unresolved <xeondev@xeondex.onmicrosoft.com>
Signed-off-by: Kirill Kuznetsov <kdevlab@yandex.ru>
Signed-off-by: Lucky Kiddos <95188840+GuitarHeroStyles@users.noreply.github.com>
Signed-off-by: Kitty <73357005+Kittyskj@users.noreply.github.com>
Signed-off-by: GhostFRR <ghost.game.fr@gmail.com>
Signed-off-by: Alice w/🌧️ <rainyxeon@gmail.com>
Signed-off-by: ZGX089ッ <159061718+ZG089@users.noreply.github.com>
Signed-off-by: thasave14 <93542339+thasave14@users.noreply.github.com>
Co-authored-by: ThePedroo <pedroolimpioguerra@gmail.com>
Co-authored-by: ExtremeXT <75576145+ExtremeXT@users.noreply.github.com>
Co-authored-by: Emulond Argent <108662981+Emulond@users.noreply.github.com>
Co-authored-by: RainyXeon <xeondev@xeondex.onmicrosoft.com>
Co-authored-by: Fyphen <fyphensub@gmail.com>
Co-authored-by: WinCS <94188592+Meltartica@users.noreply.github.com>
Co-authored-by: CaptainThrowback <captainthrowback@hotmail.com>
Co-authored-by: Kirill Kuznetsov <kdevlab@yandex.ru>
Co-authored-by: SheepChef <50871867+SheepChef@users.noreply.github.com>
Co-authored-by: AJleKcAHgP68 <78802768+AJleKcAHgP68@users.noreply.github.com>
Co-authored-by: Blazzycrafter <39300111+Blazzycrafter@users.noreply.github.com>
Co-authored-by: Igor <sorocean.igor@gmail.com>
Co-authored-by: Berlian Panca <53902591+bpanca05@users.noreply.github.com>
Co-authored-by: Willow Hayley Lovelace <65596971+dyingwillow@users.noreply.github.com>
Co-authored-by: witch <witch@dyingwillow.dev>
Co-authored-by: Lucky Kiddos <95188840+GuitarHeroStyles@users.noreply.github.com>
Co-authored-by: Kitty <73357005+Kittyskj@users.noreply.github.com>
Co-authored-by: GhostFRR <ghost.game.fr@gmail.com>
Co-authored-by: ZGX089ッ <159061718+ZG089@users.noreply.github.com>
Co-authored-by: thasave14 <93542339+thasave14@users.noreply.github.com>
Co-authored-by: Flopster101 <nahuelgomez329@gmail.com>
Co-authored-by: Lxchoooo <155797099+Lxchoooo@users.noreply.github.com>
2025-05-18 13:14:42 -03:00

52 lines
1.8 KiB
JavaScript

const navbar_data_tag = document.getElementById('cache-navbar-previous')
const small_panel_data_tag = document.getElementById('cache-page-small-previous')
setData('home', navbar_data_tag)
document.getElementById('panel_home').classList.toggle('show')
document.getElementById(`nibg_home`).classList.toggle('show')
document.querySelectorAll('[name=navbutton]').forEach((element) => {
element.addEventListener('click', (event) => {
let smallPagePass = false
const value = event.target.value
const previous = !navbar_data_tag.getAttribute('content')
? setData('home', navbar_data_tag)
: navbar_data_tag.getAttribute('content')
const small_panel = small_panel_data_tag.getAttribute('content')
if (small_panel && small_panel.length !== 0) {
document.getElementById(`small_panel_${small_panel}`).classList.remove('show')
small_panel_data_tag.removeAttribute('content')
smallPagePass = true
}
if (previous === value && !smallPagePass) return;
/* INFO: Disable icon on old state */
const pre_input = document.getElementById(`n_${previous}`)
const pre_background = document.getElementById(`nibg_${previous}`)
document.getElementById(`panel_${previous}`).classList.remove('show')
pre_input.removeAttribute('checked')
pre_background.classList.remove('show')
/* INFO: Enable icon on new state */
const curr_input = document.getElementById(`n_${value}`)
const i_background = document.getElementById(`nibg_${value}`)
document.getElementById(`panel_${value}`).classList.toggle('show')
curr_input.setAttribute('checked', '')
i_background.classList.toggle('show')
setData(value, navbar_data_tag)
})
})
function setData(data, tag) {
tag.setAttribute('content', data)
return data
}