From aebf621a47e0db850648ecf5d111333dbab17c41 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Fri, 22 Apr 2022 15:35:37 -0700 Subject: [PATCH] fix darken --- resources/js/hoverEvt.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/resources/js/hoverEvt.js b/resources/js/hoverEvt.js index 7087793..47adb2c 100644 --- a/resources/js/hoverEvt.js +++ b/resources/js/hoverEvt.js @@ -1,21 +1,36 @@ document.addEventListener('DOMContentLoaded', async () => { const firstPanel = document.querySelector('#firstPanel') const secondPanel = document.querySelector('#secondPanel') + const thirdPanel = document.querySelector('#thirdPanel') // Listen to hovers firstPanel.addEventListener('mouseover', () => { secondPanel.classList.add('darken') + thirdPanel.classList.add('darken') }) firstPanel.addEventListener('mouseout', () => { secondPanel.classList.remove('darken') + thirdPanel.classList.remove('darken') }) secondPanel.addEventListener('mouseover', () => { firstPanel.classList.add('darken') + thirdPanel.classList.add('darken') }) secondPanel.addEventListener('mouseout', () => { firstPanel.classList.remove('darken') + 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') }) }) \ No newline at end of file