This commit is contained in:
Philippe Torrel
2026-09-23 10:47:07 +02:00
parent b16dd8458d
commit 082a9bd7b3
11 changed files with 209 additions and 18 deletions
@@ -72,6 +72,31 @@
</main>
<script>
'use strict';
const SETTINGS = {
countdown: 5, // Countdown in Sekunden
};
const button = document.querySelector('.button-send');
const buttonText = button.textContent;
const buttonCountdown = (countdown) => {
if (countdown === 0) {
button.textContent = buttonText;
button.disabled = false;
} else {
button.textContent = `${countdown}...`;
setTimeout(() => buttonCountdown(--countdown), 1000);
//
}
};
button.addEventListener('click', () => {
button.disabled = true;
buttonCountdown(SETTINGS.countdown);
});
</script>
</body>
</html>