From f5e588cbad69066c54ef103538aa3a20dbdefbed Mon Sep 17 00:00:00 2001 From: Lex Lim Date: Sat, 30 Jul 2022 23:38:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=A0=E8=BD=BD=E5=8A=A8?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Isekai.class.php | 26 ++++++++- extension.json | 7 +-- i18n/en.json | 4 +- i18n/ja.json | 6 ++- i18n/zh-hans.json | 4 +- i18n/zh-hant.json | 19 ++++++- modules/ext.isekai.js | 60 +++++++++++++-------- modules/ext.isekai.less | 114 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 207 insertions(+), 33 deletions(-) diff --git a/Isekai.class.php b/Isekai.class.php index 072e64a..51a362b 100644 --- a/Isekai.class.php +++ b/Isekai.class.php @@ -39,11 +39,35 @@ class Isekai { $outputPage->addModules('ext.fontawesome'); //$outputPage->addModules('ext.treeview'); + // 加载动画,三秒内未加载完成则强制显示 + if ($outputPage->getSkin()->getSkinName() === 'timeless') { + $outputPage->addHeadItem( + 'loading-animate-script', + << + var c = document.documentElement.classList; + c.add('content-loading'); + setTimeout(function() { + c.remove('content-loading'); + c.add('content-loaded'); + }, 3000); + document.addEventListener('DOMContentLoaded', function() { + var b = getComputedStyle(document.body, null).backgroundColor; + var a = document.createElement('div'); + a.classList.add('page-loading-spinner'); + a.innerHTML = '
'; + document.body.appendChild(a); + }); + +HTML + ); + } + // 百度统计 $outputPage->addHeadItem( 'baiduhm', << +