You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.3 KiB
41 lines
1.3 KiB
//Loading页面
|
|
document.onreadystatechange=function () {
|
|
if (document.readyState=="complete"){
|
|
loadingFade();
|
|
}
|
|
}
|
|
function loadingFade() {
|
|
var opacity=1;
|
|
const position = document.querySelector('#loading');
|
|
// var loadingPage=document.getElementById('loading');
|
|
var loadingBackground=document.getElementById('loading_bg');
|
|
var time=setInterval(function () {
|
|
if (opacity<=0){
|
|
clearInterval(time);
|
|
// loadingPage.remove();
|
|
// $('#loading').remove();
|
|
position.style.display = 'none';
|
|
}
|
|
|
|
loadingBackground.style.opacity=opacity;
|
|
opacity-=0.4;
|
|
},100);
|
|
}
|
|
function initTranslate() {
|
|
try{
|
|
translate.service.use('client.edge');
|
|
translate.listener.start();
|
|
translate.setAutoDiscriminateLocalLanguage();
|
|
translate.language.setUrlParamControl();
|
|
translate.ignore.class.push('notTranslate');
|
|
translate.nomenclature.append('chinese_simplified','english',`
|
|
刘甜=Liu Tian
|
|
主页=Home
|
|
友链=Links
|
|
`);
|
|
translate.execute();
|
|
}
|
|
catch(e){console.log('翻译系统出错:' + e);}
|
|
}
|
|
|
|
window.addEventListener('load', initTranslate); |