Update tools.js

This commit is contained in:
510208 2023-07-14 10:04:45 +08:00 committed by GitHub
parent 1ac32abfd6
commit 7e6c374ce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ function showHitokoto() {
fetch("https://v1.hitokoto.cn") fetch("https://v1.hitokoto.cn")
.then(response => response.json()) .then(response => response.json())
.then(result => { .then(result => {
const text = `这句一言来自 <span>「${result.from}」</span>,是 <span>${result.creator}</span> 在 hitokoto.cn 投稿的。`; const text = `這句一言來自 <span>「${result.from}」</span>,是 <span>${result.creator}</span> 在 hitokoto.cn 投稿的。`;
showMessage(result.hitokoto, 6000, 9); showMessage(result.hitokoto, 6000, 9);
setTimeout(() => { setTimeout(() => {
showMessage(text, 4000, 9); showMessage(text, 4000, 9);
@ -50,7 +50,7 @@ const tools = {
"photo": { "photo": {
icon: fa_camera_retro, icon: fa_camera_retro,
callback: () => { callback: () => {
showMessage("照好了嘛,是不是很可呢?", 6000, 9); showMessage("照好了嘛,是不是很可呢?", 6000, 9);
Live2D.captureName = "photo.png"; Live2D.captureName = "photo.png";
Live2D.captureFrame = true; Live2D.captureFrame = true;
} }
@ -65,7 +65,7 @@ const tools = {
icon: fa_xmark, icon: fa_xmark,
callback: () => { callback: () => {
localStorage.setItem("waifu-display", Date.now()); localStorage.setItem("waifu-display", Date.now());
showMessage("愿你有一天能与重要的人重逢。", 2000, 11); showMessage("願你有一天能與心愛的人重逢。", 2000, 11);
document.getElementById("waifu").style.bottom = "-500px"; document.getElementById("waifu").style.bottom = "-500px";
setTimeout(() => { setTimeout(() => {
document.getElementById("waifu").style.display = "none"; document.getElementById("waifu").style.display = "none";