From 3972e1cebb004be59d82c2817ccffe3e015bb303 Mon Sep 17 00:00:00 2001 From: StevenJoeZhang <1119186082@qq.com> Date: Thu, 7 Feb 2019 18:40:57 +0800 Subject: [PATCH] remove feature: switch title automatically --- waifu-tips.js | 63 ++++++++++++--------------------------------------- 1 file changed, 15 insertions(+), 48 deletions(-) diff --git a/waifu-tips.js b/waifu-tips.js index f6e6bb3..0be2724 100755 --- a/waifu-tips.js +++ b/waifu-tips.js @@ -20,59 +20,14 @@ function initWidget(waifuPath, apiPath) { `); - var re = /x/, - OriginTitile = document.title, - titleTime = null, - titleIndex = 0, - title = [{ - blur: "(●—●) 哎呦,崩溃啦!", - focus: "o(≧∇≦o) 啊咧,又好了……" - }, { - blur: "(つェ⊂) 看不到我~", - focus: "(*´∇`*) 被发现啦~" - }, { - blur: "(>_<) 我藏好了哦", - focus: "(*´∇`*) 被发现啦~" - }]; - console.log(re); - re.toString = function() { - showMessage("哈哈,你打开了控制台,是想要看看我的秘密吗?", 6000, 9); - return ""; - }; - $(document).on("visibilitychange", function() { - if (document.hidden) { - titleIndex = Math.floor(Math.random() * 3); - document.title = title[titleIndex].blur; - if (titleTime) { - clearTimeout(titleTime); - titleTime = null; - } - } - else { - document.title = title[titleIndex].focus; - showMessage("哇,你又回来了~", 6000, 9); - titleTime = setTimeout(function() { - document.title = OriginTitile; - }, 3000); - } - }); - $(document).on("copy", function() { - showMessage("你都复制了些什么呀,转载要记得加上出处哦!", 6000, 9); - }); - $("#waifu-tool .fa-comment").click(function() { - showHitokoto(); - }); + $("#waifu-tool .fa-comment").click(showHitokoto); $("#waifu-tool .fa-paper-plane").click(function() { var s = document.createElement("script"); document.body.appendChild(s); s.src = "https://galaxymimi.com/js/asteroids.js"; }); - $("#waifu-tool .fa-user-circle").click(function() { - loadOtherModel(); - }); - $("#waifu-tool .fa-street-view").click(function() { - loadRandModel(); - }); + $("#waifu-tool .fa-user-circle").click(loadOtherModel); + $("#waifu-tool .fa-street-view").click(loadRandModel); $("#waifu-tool .fa-camera-retro").click(function() { showMessage("照好了嘛,是不是很可爱呢?", 6000, 9); window.Live2D.captureName = "photo.png"; @@ -88,6 +43,18 @@ function initWidget(waifuPath, apiPath) { $("#waifu").hide(); }); }); + var re = /x/; + console.log(re); + re.toString = function() { + showMessage("哈哈,你打开了控制台,是想要看看我的秘密吗?", 6000, 9); + return ""; + }; + $(document).on("copy", function() { + showMessage("你都复制了些什么呀,转载要记得加上出处哦!", 6000, 9); + }); + $(document).on("visibilitychange", function() { + if (!document.hidden) showMessage("哇,你又回来了~", 6000, 9); + }); (function() { var SiteIndexUrl = location.port ? `${location.protocol}//${location.hostname}:${location.port}/` : `${location.protocol}//${location.hostname}/`, text; //自动获取主页 //var SiteIndexUrl = "https://www.fghrsh.net/"; //手动指定主页