- 修复了一些死链
- 添加了新的 otto 插图(没错作者又更了)并修改了更换逻辑
This commit is contained in:
+12
-20
@@ -4,6 +4,13 @@ var isHidingTips = false;
|
||||
var show = true;
|
||||
var anim;
|
||||
var tipTexts = [""];
|
||||
var ottos = [
|
||||
"/images/otto-wyym.png",
|
||||
"/images/otto-rd2.png",
|
||||
"/images/otto-rd2-xmas-compressed.png",
|
||||
"/images/otto-traditional.png",
|
||||
]
|
||||
var ottoIndex = 0;
|
||||
|
||||
function showOtto(callback) {
|
||||
node.style.opacity = 1;
|
||||
@@ -38,26 +45,18 @@ window.onload = function () {
|
||||
showOtto()
|
||||
}
|
||||
|
||||
window.$docsify.onLightDarkModeChange = function () {
|
||||
if (show) {
|
||||
if (anim.playState != "running")
|
||||
hideOtto(() => {
|
||||
image.src = getCurrentImage();
|
||||
showOtto();
|
||||
});
|
||||
}
|
||||
else
|
||||
image.src = getCurrentImage();
|
||||
}
|
||||
|
||||
window.$docsify.onOttoShow = function () {
|
||||
if (!anim.playState || anim.playState != "finished") {
|
||||
return;
|
||||
}
|
||||
show = !show;
|
||||
if (show) {
|
||||
image.src = getCurrentImage();
|
||||
showOtto();
|
||||
} else {
|
||||
hideOtto();
|
||||
ottoIndex++;
|
||||
}
|
||||
}
|
||||
function addOtto(document) {
|
||||
@@ -120,13 +119,6 @@ function randomTips() {
|
||||
}
|
||||
|
||||
function getCurrentImage() {
|
||||
currentImageIndex = window.$docsify.currentThemeModeIndex;
|
||||
switch (currentImageIndex) {
|
||||
case 0: //light
|
||||
return "/images/otto-rd2.png";
|
||||
case 1: //dark
|
||||
return "/images/otto-rd2-xmas-compressed.png";
|
||||
case 2: //default
|
||||
return "/images/otto-wyym.png";
|
||||
}
|
||||
ottoIndex = (ottoIndex) % ottos.length;
|
||||
return ottos[ottoIndex];
|
||||
}
|
||||
+1
-1
@@ -10,7 +10,7 @@ let positions = {
|
||||
"c4": { "x": 136, "name": "第四拍" },
|
||||
"c5": { "x": 160, "name": "第五拍" },
|
||||
"c6": { "x": 184, "name": "第六拍" },
|
||||
"c7": { "x": 249, "name": "第普通拍" },
|
||||
"c7": { "x": 249, "name": "第二拍" },
|
||||
"ccharacter": { "x": 35, "name": "角色" },
|
||||
"ccenter": { "x": 176, "name": "中心" },
|
||||
"cheart": { "x": 317, "name": "心" },
|
||||
|
||||
@@ -110,11 +110,12 @@ function plugin(hook, vm) {
|
||||
currentThemeModeIndex ++
|
||||
}
|
||||
window.$docsify.currentThemeModeIndex = currentThemeModeIndex
|
||||
window.$docsify.onLightDarkModeChange();
|
||||
setThemeMode(themeModes[currentThemeModeIndex])
|
||||
if (window.$docsify.onLightDarkModeChange) {
|
||||
window.$docsify.onLightDarkModeChange();
|
||||
}
|
||||
}
|
||||
|
||||
document.body.appendChild(switchSpan)
|
||||
|
||||
var zoomInSpan = document.createElement('span')
|
||||
zoomInSpan.id = 'zoomInSpan'
|
||||
@@ -175,6 +176,7 @@ function plugin(hook, vm) {
|
||||
showOtto()
|
||||
}
|
||||
|
||||
document.body.appendChild(switchSpan)
|
||||
document.body.appendChild(zoomInSpan)
|
||||
document.body.appendChild(zoomOutSpan)
|
||||
document.body.appendChild(zoomDefaultSpan)
|
||||
|
||||
Reference in New Issue
Block a user