3 Star 6 Fork 6

xyf007/namerena_scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
2_ordered_Chinese_characters.html 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
xyf007 提交于 2020-11-12 19:43 +08:00 . modify all the wrong 'for's.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>&#x4E24;&#x4F4D;&#x987A;&#x5E8F;&#x6C49;&#x5B57;&#x6A21;&#x5F0F;
</title>
</head>
<body>
<pre>
const prefix = '';
const team = '';
let cur = 0;
let names = '';
let result = '';
/**
* Get the character.
* @param {number} cur Current number.
* @return {String} The character.
*/
function getCharacter(cur) {
if (cur < 6582) {
return String.fromCharCode(0x3400 + cur);
} else {
return String.fromCharCode(0x4E00 + cur - 6582);
}
}
/**
* Reload names.
*/
function reload() {
names = team + '\n';
for (let i = 0; i < 10; i++) {
names += ` ${prefix}${getCharacter(cur / 27522)}` +
`${getCharacter(cur % 27522)}\n`;
cur++;
}
document.querySelector('div>textarea').value = names;
document.querySelector('.goBtn').click();
}
/**
* Search for the names with elites.
*/
function maint() {
if (cw().document.querySelectorAll('div.name').length < 10) {
setTimeout(function() {
maint();
}, 100);
return;
}
const a = cw().document.querySelectorAll('.s_elite3');
for (const name of a) {
result += name.parentElement.previousElementSibling.textContent.replace(
/^\s+|\s+$/g, '') + '\n';
}
document.querySelector('textarea#result').value = result;
reload();
setTimeout(function() {
maint();
}, 100);
}
const NW = document.createElement('textarea');
NW.id = 'result';
document.body.appendChild(NW);
NW.setAttribute('readonly', true);
document.getElementsByClassName('mdframe')[0].setAttribute('style',
'display:none;');
reload();
maint();
</pre>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/xyf0076/namerena_scripts.git
git@gitee.com:xyf0076/namerena_scripts.git
xyf0076
namerena_scripts
namerena_scripts
master

搜索帮助