GrassClipper/resources/js/hoverEvt.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

document.addEventListener('DOMContentLoaded', async () => {
2022-04-22 22:34:24 +00:00
const firstPanel = document.querySelector('#firstPanel')
const secondPanel = document.querySelector('#secondPanel')
2022-04-22 22:35:37 +00:00
const thirdPanel = document.querySelector('#thirdPanel')
// Listen to hovers
2022-04-22 22:34:24 +00:00
firstPanel.addEventListener('mouseover', () => {
secondPanel.classList.add('darken')
2022-04-22 22:35:37 +00:00
thirdPanel.classList.add('darken')
})
2022-04-22 22:34:24 +00:00
firstPanel.addEventListener('mouseout', () => {
secondPanel.classList.remove('darken')
2022-04-22 22:35:37 +00:00
thirdPanel.classList.remove('darken')
})
2022-04-22 22:34:24 +00:00
secondPanel.addEventListener('mouseover', () => {
firstPanel.classList.add('darken')
2022-04-22 22:35:37 +00:00
thirdPanel.classList.add('darken')
})
2022-04-22 22:34:24 +00:00
secondPanel.addEventListener('mouseout', () => {
firstPanel.classList.remove('darken')
2022-04-22 22:35:37 +00:00
thirdPanel.classList.remove('darken')
})
thirdPanel.addEventListener('mouseover', () => {
firstPanel.classList.add('darken')
secondPanel.classList.add('darken')
})
thirdPanel.addEventListener('mouseout', () => {
firstPanel.classList.remove('darken')
secondPanel.classList.remove('darken')
})
})