diff --git a/web/html/login.html b/web/html/login.html index b622a080..4605a4fd 100644 --- a/web/html/login.html +++ b/web/html/login.html @@ -2,9 +2,14 @@ {{template "head" .}} @@ -269,8 +393,13 @@ - -

{{ i18n "pages.login.title" }}

+ +

+ + {{ i18n "pages.login.title" }} + 3X-UI + +

@@ -377,6 +506,42 @@ }, }, }); + document.addEventListener("DOMContentLoaded", function() { + var animationDelay = 2000; + initHeadline(); + + function initHeadline() { + animateHeadline(document.querySelectorAll('.headline')); + } + + function animateHeadline(headlines) { + var duration = animationDelay; + headlines.forEach(function(headline) { + setTimeout(function() { + hideWord(headline.querySelector('.is-visible')); + }, duration); + }); + } + + function hideWord(word) { + var nextWord = takeNext(word); + switchWord(word, nextWord); + setTimeout(function() { + hideWord(nextWord); + }, animationDelay); + } + + function takeNext(word) { + return (word.nextElementSibling) ? word.nextElementSibling : word.parentElement.firstElementChild; + } + + function switchWord(oldWord, newWord) { + oldWord.classList.remove('is-visible'); + oldWord.classList.add('is-hidden'); + newWord.classList.remove('is-hidden'); + newWord.classList.add('is-visible'); + } + });