2020-08-27 14:31:51 +00:00
|
|
|
const listenToWindowBtn = document.getElementById('listen-to-window')
|
|
|
|
const focusModalBtn = document.getElementById('focus-on-modal-window')
|
|
|
|
|
2020-09-14 17:36:54 +00:00
|
|
|
const hideFocusBtn = () => {
|
|
|
|
focusModalBtn.classList.add('disappear')
|
|
|
|
focusModalBtn.classList.remove('smooth-appear')
|
|
|
|
focusModalBtn.removeEventListener('click', focusWindow)
|
|
|
|
}
|
|
|
|
|
|
|
|
const showFocusBtn = (btn) => {
|
|
|
|
focusModalBtn.classList.add('smooth-appear')
|
|
|
|
focusModalBtn.classList.remove('disappear')
|
|
|
|
focusModalBtn.addEventListener('click', focusWindow)
|
|
|
|
}
|
|
|
|
const focusWindow = () => {
|
2023-08-29 19:52:16 +00:00
|
|
|
window.electronAPI.focusDemoWindow()
|
2020-09-14 17:36:54 +00:00
|
|
|
}
|
|
|
|
|
2023-08-29 19:52:16 +00:00
|
|
|
window.electronAPI.onWindowFocus(hideFocusBtn)
|
|
|
|
window.electronAPI.onWindowClose(hideFocusBtn)
|
|
|
|
window.electronAPI.onWindowBlur(showFocusBtn)
|
2020-08-27 14:31:51 +00:00
|
|
|
|
|
|
|
listenToWindowBtn.addEventListener('click', () => {
|
2023-08-29 19:52:16 +00:00
|
|
|
window.electronAPI.showDemoWindow()
|
2020-08-27 14:31:51 +00:00
|
|
|
})
|