Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
qtail page v0520 / qtail.js v1.7.0 stable
Browse files Browse the repository at this point in the history
  • Loading branch information
LateDreamXD committed May 20, 2024
1 parent 8a4471c commit 64efd55
Show file tree
Hide file tree
Showing 13 changed files with 140 additions and 94 deletions.
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
qtail.xiaozhisans.blogu.tc
10 changes: 5 additions & 5 deletions help/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ <h4>目录</h4>
</div>
<div id="mainWindow">
<div class="tabPnl">
<p id="tabText">帮助</p>
<p id="tabText">帮助文档 (v0520)</p>
<div class="tabBtnPnl">
<tabBtn id="disabled"></tabBtn>
<tabBtn id="disabled"></tabBtn>
<tabBtn class="hide" id="hide" onclick="window.close();" tooltip="关闭"></tabBtn>
<tabBtn class="hide" id="hide" onclick="window.close();" tooltip="关闭"><img title="关闭" class="svg" src="../img/xmark-solid.svg"></tabBtn>
</div>
</div>
<div class="qtailBox" style="border-radius: 0 0 10px 10px;">
Expand Down Expand Up @@ -145,11 +145,11 @@ <h3 id="about">关于</h3>
<li>图标提供: <a class="github outlink" href="https://github.com/FortAwesome/Font-Awesome/">Font-Awesome</a></li>
<li>模块化加载: <a class="github outlink" href="https://github.com/XiaozhiSans/qtailLoader">qtailLoader</a></li>
<li>qt图标设计: <a class="outlink" href="https://www.logosc.cn/">标小智</a></li>
<li>以及参与 beta 测试的<a></a>!</li>
<li>以及使用 qtail 的<a></a>!</li>
</ul>
<p>
qtail page v0516 | <qtail.js></qtail.js> | 更新于 2024年5月16日 21点33分<br>
Copyright (c) 2024 <a class="github outlink href="https://github.com/XiaozhiSans">XiaozhiSans</a>
qtail page v0520 | <qtail.js></qtail.js> | 更新于 <i>2024年5月20日 23点40分</i><br>
Copyright (c) 2024 <a class="github outlink" href="https://github.com/XiaozhiSans">XiaozhiSans</a>
</p>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<meta name="theme-color" content="#ac9ece">
<meta name="msapplication-navbutton-color" content="#ac9ece">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="msapplication-starturl" content="/qtail/">
<meta name="msapplication-starturl" content="/">

<link rel="icon" type="image/png" sizes="192x192" href="img/qt.192.png">
<link rel="apple-touch-icon" type="image/png" sizes="192x192" href="img/qt.192.png">
Expand All @@ -52,7 +52,7 @@
<div id="mainWindow">
<div class="tabPnl">
<!-- 窗口顶栏 -->
<p id="tabText">qq昵称小尾巴生成器<span id="pageVer">(v0516)</span></p>
<p id="tabText">qq昵称小尾巴生成器<span id="pageVer">(v0520)</span></p>
<div class="tabBtnPnl">
<tabBtn class="share" onclick="qtailHtml.share();" tooltip="分享"><img title="分享" class="svg" src="img/share-from-square-solid.svg"></tabBtn>
<tabBtn class="donation" onclick="qtailHtml.donation();" tooltip="喜欢"><img title="喜欢" class="svg" src="img/heart-solid.svg"></tabBtn>
Expand All @@ -74,7 +74,7 @@
<input type="checkbox" id="rstr" name="rstr" value="true" hidden>
<label for="rstr" id="rstr" title="当生成的昵称中尾巴没有按预期显示时开启。">rstr 模式(仅支持半角符号)</label>
</div> -->
<succBtn onclick="qtailHtml.main();">生成</succBtn>
<succBtn onclick="qtail.html.main();">生成</succBtn>
</form><br>
<img id="visitor-counter" src="https://count.getloli.com/get/@qtail?theme=rule34" title="页面累计被访问次数" onerror="this.src = 'img/visitor-counter-404.webp';">
</div>
Expand All @@ -101,8 +101,8 @@
</div>
<div class="footerPnl" name="links">
<p>
<a class="github outlink" href="https://github.com/XiaozhiSans/qtail">开放源代码</a> | <a href="#" onclick="page.changeBoxAlpha();">窗口透明度</a><br>
<a class="github outlink" href="https://github.com/XiaozhiSans/qtail/issues">提个建议</a> | <a href="#" onclick="page.changeBg();">更改桌面壁纸</a><br>
<a class="github outlink" href="https://github.com/XiaozhiSans/qtail">开放源代码</a> | <a href="#changeAlpha" onclick="page.changeBoxAlpha();">窗口透明度</a><br>
<a class="github outlink" href="https://github.com/XiaozhiSans/qtail/issues">提个建议</a> | <a href="#changeBg" onclick="page.changeBg();">更改桌面壁纸</a><br>
<icp></icp><br>
Copyright (c) 2024 <a class="github outlink" href="https://github.com/XiaozhiSans">XiaozhiSans</a>
</p>
Expand Down
54 changes: 26 additions & 28 deletions js/page.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
console.log("page.js has been loaded.")
console.log("[page.js] page has been loaded.")

setTimeout(() => {
document.getElementById("verText").innerHTML = ("Running <a class=\"github outlink\" href=\"https://github.com/XiaozhiSans/qtail.js\">qtail.js</a> " + qtail.buildType + ' ' + qtail.version);
}, 2500);

const page = {
appName: "",
appNameShort: "",
version: "v1.0.1",
buildVer: "(20240425)",
appName: "page.js",
appNameShort: "page",
version: "v1.0.2",
buildVer: "(20240520)",
buildType: "",
license: "",
author: "XiaozhiSans",
url: "",
changeBg: () => {
var bgUrl = prompt("请输入图片url:", "https://eg.web/imgs/img0.jpg");
if((bgUrl != null)&&(bgUrl != "")) {
let bgUrl = prompt("请输入图片url:", "https://eg.web/imgs/img0.jpg");
(!bgUrl || bgUrl == '')? (() => {
console.error("[page.js] 背景url为空,取消更改背景");
return;
})(): (() => {
document.getElementById("body").style.backgroundImage = bgUrl;
document.getElementById("body").style.backgroundSize = auto;
}
else {
console.error("page.js: on changeBg, error code: -1");
return -1;
}
msg("更改成功 ( ̄﹃ ̄)", 3);
return 0;
})();
msg("更改成功 ( ̄﹃ ̄)");
return;
},
changeBoxAlpha: () => {
var alpha = prompt("请输入透明度(0 ~ 1.0):", "1.0");
if((alpha > 1.0)||(alpha < 0.0)||(alpha == NaN)) {
msg("更改失败 Σ(っ °Д °;)っ<br>无效的数值。", 3);
((alpha > 1.0)||(alpha < 0.0)||(isNaN(alpha)))? (() => {
msg("更改失败 Σ(っ °Д °;)っ<br>无效的数值。");
console.error("page.js: on changeBoxAlpha, error code: -1");
return -1;
}
})(): undefined;
if((typeof alpha) != "string") {
msg("更改失败 Σ(っ °Д °;)っ<br>输入的内容不合法。", 3);
msg("更改失败 Σ(っ °Д °;)っ<br>输入的内容不合法。");
console.error("page.js: on changeBoxAlpha, error code: -2");
return -2;
}
document.getElementById("mainWindow").style.opacity = alpha;
msg("更改成功 ( ̄﹃ ̄)", 3);
msg("更改成功 ( ̄﹃ ̄)");
return 0;
},/*
changeBoxBg: () => {
Expand Down Expand Up @@ -69,23 +68,22 @@ const page = {
hideBtn.setAttribute("tooltip", "收起");
hideBtn.innerHTML = "<img title=\"收起\" class=\"svg\" src=\"../img/minus-solid.svg\">";
return;
}
/*,
sentence: () => {
},
changeTip: target => {
target.innerHTML = tips[Math.floor(Math.random() * (tips.length - 1))];
}/*,
randBg: () => {
document.getElementById("customBg").style.background = bgUrl + bgList[Math.floor(Math.random() * 6)];
}*/
}
let tip = document.getElementById("tips");
$.get("../tips.txt", data => {
$.get("./tips.txt", data => {
globalThis.tips = data.split('\n');
tip.innerHTML = tips[Math.floor(Math.random() * (tips.length - 1))];
page.changeTip(tip);
});
setInterval(() => {
tip.innerHTML = tips[Math.floor(Math.random() * (tips.length - 1))];
}, 30000);
page.changeTip(tip);
}, 15000);

const msg = qtailHtml.meassage;
const msg = qtail.html.meassage;
icpCheck(1);
9 changes: 9 additions & 0 deletions js/ql.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#===== qtail.js 配置文件 =====

#== 文件名 - 模块名 - 版本号 - 模块别名 ==
qtail.js - qtail.js - v1.6.2 - qtail
qtail.html.js - qtail-html-module - v1.0.1 - qtailHtml

moe-icp-for-xsblog/icp.check.js - icp.check.js - - icp check

page.js - page.js - v1.0.1 - page
36 changes: 18 additions & 18 deletions js/qtail.html.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
// 热键绑定
document.addEventListener("keydown", event => {
(event.code == "Enter")? function() {
qtailHtml.main();
qtail.html.main();
}():
(event.code == "Escape")? function() {
qtailHtml.exit();
qtail.html.exit();
}():
(event.key == "F8")? function() {
qtailHtml.copy();
qtail.html.copy();
}(): function() {
return;
}();
});

const qtailHtml = {
qtail.html = {
appName: "qtail.js html module",
appNameShort: "qtail-html-module",
version: "v1.0.1",
buildVer: "(20240420)",
buildType: "Alpha-Stable",
buildType: "Stable",
license: "MIT",
author: "XiaozhiSans",
url: "",
main: () => {
console.log("开始生成新昵称 ( ̄﹃ ̄)");
console.log("获取表单内容 ( ̄﹃ ̄)");
console.log(`[${qtail.html.appName}] 开始生成新昵称 ( ̄﹃ ̄)`);
console.log(`[${qtail.html.appName}] 获取表单内容 ( ̄﹃ ̄)`);
const qtailForm = document.querySelector("#qtail");
const qtailData = new FormData(qtailForm);

let name = qtailData.get("name");
let tail = qtailData.get("tail");
if (name == "" || tail == "") {
qtailHtml.message("生成已取消 ( ̄﹃ ̄)<br>昵称或尾巴不能为空.", 3);
console.error("qtail.js: on main, error code: -1");
qtail.html.message("生成已取消 ( ̄﹃ ̄)<br>昵称或尾巴不能为空");
console.error(`[${qtail.html.appName}] 生成已取消 ( ̄﹃ ̄): 昵称或尾巴不能为空`);
return -1;
}
console.log("获取到昵称:" + name + " 获取到尾巴:" + tail);
console.log(`[${qtail.html.appName}] 获取到昵称:${name} 获取到尾巴:${tail}`);

let result = qtail.generation(name, tail);

console.log("将结果返回页面 ( ̄﹃ ̄)");
console.log(`[${qtail.html.appName}] 将结果返回页面 ( ̄﹃ ̄)`);
document.getElementById("result").innerHTML = result;
qtailHtml.message("生成完毕 ( ̄﹃ ̄)", 3);
qtail.html.message("生成完毕 ( ̄﹃ ̄)");
},
message: (content, time) => {
let target = document.getElementById("message"), box = document.querySelector("#messageBox");
Expand All @@ -53,23 +53,23 @@ const qtailHtml = {
let value = 100;
$("span#fg").cssText = ("max-width", `${value}%`);
setInterval(() => {
value >= 0? value -= 33: function() {return;}();
value >= 0? value -= 33: (() => {return;})();
$("span#fg").cssText = ("max-width", `${value}%`);
}, 1000);
},
copy: () => { // 复制结果 ( ̄﹃ ̄)
const result = document.querySelector("#result");
result.select();
document.execCommand("copy");
qtailHtml.message("复制成功 ( ̄﹃ ̄)<br>快去 qq 试试吧", 3);
qtail.html.message("复制成功 ( ̄﹃ ̄)<br>快去 qq 试试吧");
return 0;
},
share: () => {
(!navigator.share)? function() {qtailHtml.message("您的浏览器不支持分享功能! ( ̄﹃ ̄)", 3); return -1;}() :
function() {navigator.share({title: location.title, url: location.href, text: "hi,我发现了一个超有意思的昵称生成器 —— qtail"}); return 0;}();
(!navigator.share)? (() => {qtail.html.message("您的浏览器不支持分享功能! ( ̄﹃ ̄)"); return -1;})():
(() => {navigator.share({title: location.title, url: location.href, text: "hi,我发现了一个超有意思的昵称生成器 —— qtail"}); return 0;})();
},
donation: () => {
qtailHtml.message("感谢您的支持!! ✪ ω ✪", 3);
qtail.html.message("感谢您的支持!! ✪ ω ✪");
},
exit: () => {
window.close();
Expand All @@ -78,7 +78,7 @@ const qtailHtml = {

console.log(
"\n" +
" %c " + qtailHtml.appName + ' ' + qtailHtml.version + ' ' + qtailHtml.buildType + " by " + qtailHtml.author +
" %c " + `${qtail.html.appName} ${qtail.html.version} ${qtail.html.buildType} by ${qtail.html.author}` +
"\n" +
"\n",
"color: #fff; background: #fd79a8; padding: 5px 0;"
Expand Down
22 changes: 11 additions & 11 deletions js/qtail.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@ const qtail = {
appName: "qtail.js",
appNameShort: "qtail",
version: "v1.7.0",
buildVer: "(20240516)",
buildType: "Beta",
buildVer: "(20240520)",
buildType: "Stable",
license: "MIT",
author: "XiaozhiSans",
url: "https://github.com/XiaozhiSans/qtail",
getVer: function() {
console.log("qtail.js version: " + qtail.buildType + ' ' + qtail.version + qtail.buildVer);
getVer: () => {
console.log(`[qtail.js] version: ${qtail.buildType} ${qtail.version}${qtail.buildVer}`);
return qtail.version;
},
generation: function(name, tail) {
console.log("正在生成新的昵称 ( ̄﹃ ̄)");
console.log("[qtail.js] 正在生成新的昵称 ( ̄﹃ ̄)");
// tail = qtail.rstr(tail);
tail = this.retail(tail);
console.log("尾巴重整完毕 ( ̄﹃ ̄) 结果为: " + tail);
console.log("[qtail.js] 尾巴重整完毕 ( ̄﹃ ̄) 结果为: " + tail);
let result = name + String.fromCharCode(8295) + tail + String.fromCharCode(8294);

console.log("新昵称生成完毕 ( ̄﹃ ̄) 结果为: " + result);
console.log("[qtail.js] 新昵称生成完毕 ( ̄﹃ ̄) 结果为: " + result);

return result;
},
retail: tail => {
let symbols = tail.replace(/[\u4e00-\u9fa5]|[\u4e00-\u9fa5]|[a-zA-Z]|[0-9]/g, '');
if(!symbols && symbols == '') {return tail;}
if(!symbols || symbols == '') {return tail;}
let name = eval(`tail.replace(/${symbols}/g, '');`);
let result = symbols + name;
return result;
},
rstr: function(str) {
/* rstr: function(str) {
for (let i = 33; i <= 47; i++) { // ! - /
let symbol = String.fromCharCode(i);
if (str.endsWith(symbol)) {
Expand Down Expand Up @@ -60,12 +60,12 @@ const qtail = {
}
return str;
// return str.split('').reverse().join('');
}
} */
}

console.log(
"\n" +
" %c " + qtail.appName + ' ' + qtail.version + ' ' + qtail.buildType + " by " + qtail.author +
" %c " + `${qtail.appName} ${qtail.version} ${qtail.buildType} by ${qtail.author} `+
"\n" +
"\n",
"color: #fff; background: #fd79a8; padding: 5px 0;"
Expand Down
Loading

0 comments on commit 64efd55

Please sign in to comment.