mirror of
https://codeberg.org/privacy1st/website
synced 2024-12-23 02:36:06 +01:00
16 lines
519 B
JavaScript
16 lines
519 B
JavaScript
/* Menu Active Codes */
|
|
|
|
let targets = document.querySelectorAll('[data-target]')
|
|
targets.forEach(element => {
|
|
element.addEventListener('click', () => {
|
|
var target = document.querySelector(element.dataset.target)
|
|
targets.forEach(element2 => {
|
|
var target2 = document.querySelector(element2.dataset.target)
|
|
element2.style.color = 'var(--menu_text_color)'
|
|
target2.style.display = 'none'
|
|
});
|
|
element.style.color = 'var(--menu_active_text_color)'
|
|
target.style.display= 'flex'
|
|
})
|
|
})
|