diff --git a/cmd/client/web/index.html b/cmd/client/web/index.html index 930e7bc..30b2236 100644 --- a/cmd/client/web/index.html +++ b/cmd/client/web/index.html @@ -296,6 +296,7 @@

Lade Escape From Teacher...

+
@@ -404,6 +405,28 @@ const SPRUECHE = [ { text: "„Mach nicht den Reda!“ = In einen Raum gehen, vor dem Schüler warten, und ihnen noch zurufen, dass da eine andere Klasse drin ist – in dem Moment hat er die Tür schon aufgemacht und blickt in die verwirrten Gesichter der fremden Klasse.", author: "Schulflur-Legende" }, ]; +function showLoadingQuote() { + const el = document.getElementById('loadingQuote'); + if (!el || !SPRUECHE.length) return; + const q = SPRUECHE[Math.floor(Math.random() * SPRUECHE.length)]; + const txt = q.text.replace(/&/g,'&').replace(//g,'>'); + const ctx = q.ctx ? q.ctx.replace(/&/g,'&').replace(//g,'>') : ''; + const auth = q.author.replace(/&/g,'&'); + el.innerHTML = '

\u201E' + txt + '\u201C

' + + (ctx ? '

' + ctx + '

' : '') + + '

\u2014 ' + auth + '

'; +} +showLoadingQuote(); + +// Wechsle Spruch alle 4 Sekunden während des Ladens +const _loadingQuoteInterval = setInterval(function() { + if (document.getElementById('loading') && !document.getElementById('loading').classList.contains('hidden')) { + showLoadingQuote(); + } else { + clearInterval(_loadingQuoteInterval); + } +}, 4000); + function showSprueche() { document.querySelectorAll('.overlay-screen').forEach(el => el.classList.add('hidden')); document.getElementById('spruecheMenu').classList.remove('hidden'); @@ -414,10 +437,10 @@ function showSprueche() { const txt = q.text.replace(/&/g,'&').replace(//g,'>'); const ctx = q.ctx ? q.ctx.replace(/&/g,'&').replace(//g,'>') : ''; const auth = q.author.replace(/&/g,'&'); - return '
' - + '

' + txt + '

' - + (ctx ? '

' + ctx + '

' : '') - + '

— ' + auth + '

' + return '
' + + '

' + txt + '

' + + (ctx ? '

' + ctx + '

' : '') + + '

— ' + auth + '

' + '
'; }).join(''); }