diff --git a/config.ini b/config.ini index f8a090e..3398905 100644 --- a/config.ini +++ b/config.ini @@ -9,7 +9,7 @@ theme = dark [i18n] lang = de -more = Mehr Fragen +more = Weiter »»» title = A oder B separator = oder questions_prefix = Es gibt derzeit diff --git a/static/js/autoReload.js b/static/js/autoReload.js new file mode 100644 index 0000000..8627a69 --- /dev/null +++ b/static/js/autoReload.js @@ -0,0 +1,30 @@ +function autoReload() { + document.querySelectorAll('input[type="radio"]').forEach(function (el) { + el.addEventListener('change', checkForm, { once: true }); + }); + + const choices = []; + + function checkForm(e) { + item = e.target.id.charAt(1); + if (choices.indexOf(item) === -1) { + choices.push(item); + } + if (choices.length === 5) { + countdown(); + } + } + + function countdown() { + var timeleft = 3; + var reloadTimer = setInterval(function () { + if (timeleft <= 0) { + clearInterval(reloadTimer); + window.location.replace('/') + } else { + document.getElementById("next").innerHTML = timeleft; + } + timeleft -= 1; + }, 1000); + } +} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 84866c5..36fe93b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,6 +8,7 @@ {{ title }} + @@ -69,6 +70,7 @@