GrassClipper/resources/js/alerts.js

24 lines
511 B
JavaScript
Raw Normal View History

2022-05-04 04:08:12 +00:00
function displayAlert(message, clear = 4000) {
2022-05-04 04:06:01 +00:00
const alert = document.getElementById('alert')
const alertText = document.getElementById('alertText')
alert.classList.add('show')
alertText.innerText = message
2022-05-08 03:49:45 +00:00
debug.log('Displaying message: ' + message)
2022-05-04 04:06:01 +00:00
setTimeout(() => {
hideAlert()
}, clear)
}
function hideAlert() {
const alert = document.getElementById('alert')
const alertText = document.getElementById('alertText')
2022-05-08 03:49:45 +00:00
debug.log('Hiding alert')
2022-05-04 04:06:01 +00:00
alert.classList.remove('show')
}