fix: Restore headline animation with DOMContentLoaded

This commit is contained in:
mhsanaei 2025-04-01 14:23:33 +02:00
parent 93a91571df
commit fe7fb3cc86
No known key found for this signature in database
GPG key ID: D875CD086CF668A0

View file

@ -488,12 +488,12 @@
<a-col :xs="22" :sm="20" :md="14" :lg="10" :xl="8" :xxl="6" id="login" style="margin: 3rem 0;"> <a-col :xs="22" :sm="20" :md="14" :lg="10" :xl="8" :xxl="6" id="login" style="margin: 3rem 0;">
<a-row type="flex" justify="center"> <a-row type="flex" justify="center">
<a-col style="width: 100%;"> <a-col style="width: 100%;">
<h1 class="title headline zoom"> <h2 class="title headline zoom">
<span class="words-wrapper"> <span class="words-wrapper">
<b class="is-visible">{{ i18n "pages.login.hello" }}</b> <b class="is-visible">{{ i18n "pages.login.hello" }}</b>
<b>{{ i18n "pages.login.title" }}</b> <b>{{ i18n "pages.login.title" }}</b>
</span> </span>
</h1> </h2>
</a-col> </a-col>
</a-row> </a-row>
<a-row type="flex" justify="center"> <a-row type="flex" justify="center">
@ -557,6 +557,27 @@
async mounted() { async mounted() {
this.lang = LanguageManager.getLanguage(); this.lang = LanguageManager.getLanguage();
this.secretEnable = await this.getSecretStatus(); this.secretEnable = await this.getSecretStatus();
},
methods: {
async login() {
this.loading = true;
const msg = await HttpUtil.post('/login', this.user);
this.loading = false;
if (msg.success) {
location.href = basePath + 'panel/';
}
},
async getSecretStatus() {
this.loading = true;
const msg = await HttpUtil.post('/getSecretStatus');
this.loading = false;
if (msg.success) {
this.secretEnable = msg.obj;
return msg.obj;
}
},
},
});
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
var animationDelay = 2000; var animationDelay = 2000;
@ -584,7 +605,7 @@
} }
function takeNext(word) { function takeNext(word) {
return (word.nextElementSibling) ? word.nextElementSibling : word.parentElement.firstElementChild; return word.nextElementSibling ? word.nextElementSibling : word.parentElement.firstElementChild;
} }
function switchWord(oldWord, newWord) { function switchWord(oldWord, newWord) {
@ -594,28 +615,6 @@
newWord.classList.add('is-visible'); newWord.classList.add('is-visible');
} }
}); });
},
methods: {
async login() {
this.loading = true;
const msg = await HttpUtil.post('/login', this.user);
this.loading = false;
if (msg.success) {
location.href = basePath + 'panel/';
}
},
async getSecretStatus() {
this.loading = true;
const msg = await HttpUtil.post('/getSecretStatus');
this.loading = false;
if (msg.success) {
this.secretEnable = msg.obj;
return msg.obj;
}
},
},
});
</script> </script>
</body> </body>
</html> </html>