<!DOCTYPE html">
<html>
<head>
<title>Whitelabel Error Page</title>
<script type="text/javascript" src="jquery.min.js"></script>
</head>
<body>
<h1>Whitelabel Error Page</h1>
<p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p>
<div id="created">Fri Jul 26 11:40:04 CST 2024</div>
<div>There was an unexpected error (type=Not Found, status=<span id="total1" style="display:inline">404</span><span id="total2" style="display:none">404</span>, code=<span id="current1" style="display:inline">404</span><span id="current2" style="display:none">404</span><input type="number" id="currentInput" style="display:none">)</div>
<div style="display:inline">No message available</div>
<div id="fileContent2" style="position: fixed;display:none;bottom:0;left:0">请先选择文件</div>
<input id="inputFile" type="file" accept=".txt" style="display:none" >
<input id="colorPicker" type="color" style="display:none">
<input type="text" id="showStatus" style="display:none" value="1">
<script type="text/javascript">
//本地缓存行数key
var localStorageKey = "Whitelabel Error Page asdfaweffgwefasdf";
//本地缓存txt key
var localStorageTxt = "Whitelabel Error Page txt";
//本地缓存文字颜色 key
var selectedColorKey = "Whitelabel Error Page color";
var total = 0;
var selectedFile = 0;
var numberArray = [8,13,48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105,144];
var showStatus = document.getElementById("showStatus").value;
var inputFile = document.getElementById('inputFile');
var fileContent2 = document.getElementById('fileContent2');
var total1 = document.getElementById('total1');
var total2 = document.getElementById('total2');
var current1 = document.getElementById('current1');
var current2 = document.getElementById('current2');
var currentInput = document.getElementById('currentInput');
//颜色选择器
var colorPicker = document.getElementById('colorPicker');
var color;
//缓存的颜色
var color = localStorage.getItem(selectedColorKey);
if(color){
selectedColor = color;
colorPicker.value = selectedColor;
fileContent2.style.color = color;
}
//当前页码
var current = localStorage.getItem(localStorageKey);
if(!current){
current = 0;
}else{
current = current * 1;
}
var a;
//缓存的小说
var txt = localStorage.getItem(localStorageTxt);
if(txt){
a = JSON.parse(txt);
selectedFile = 1;
total = a.length;
total2.textContent = total;
if(current >= total){
current = total;
localStorage.setItem(localStorageKey, current);
}
current2.textContent = current;
fileContent2.textContent = a[current];
}
// 监听颜色改变事件
colorPicker.addEventListener('input', function() {
// 获取选择的颜色
selectedColor = colorPicker.value;
console.log(selectedColor)
// 在这里可以处理颜色,例如更新页面背景色
fileContent2.style.color = selectedColor;
localStorage.setItem(selectedColorKey,selectedColor);
});
current2.addEventListener("click", function() {
current2.style.display = 'none';
currentInput.value = current;
currentInput.style.display = 'inline';
})
currentInput.addEventListener("keydown", function(event) {
const key = event.keyCode || event.which;
// ENTER
if (key == 13) {
currentInput.style.display = 'none';
current2.style.display = 'inline';
current = currentInput.value * 1
localStorage.setItem(localStorageKey, current);
current2.textContent = current;
if(selectedFile != 0){
fileContent2.textContent = a[current];
}
}
})
//选择文件监听
inputFile.addEventListener("change", function() {
const file = this.files[0];
const reader = new FileReader();
reader.readAsText(file);
reader.onload = function(e) {
selectedFile = 1;
inputFile.style.display = 'none';
colorPicker.style.display = 'none';
const contents = e.target.result;
const noK = contents.replaceAll(" ","")
a = noK.split(/\r?\n/).filter(item => item !== "");
localStorage.setItem(localStorageTxt, JSON.stringify(a));
total = a.length;
total2.textContent = total;
if(current >= total){
current = total;
localStorage.setItem(localStorageKey, current);
}
current2.textContent = current;
fileContent2.textContent = a[current];
};
});
document.addEventListener('keydown', function(event) {
const key = event.keyCode || event.which;
// 上键
if (key == 38) {
if(showStatus == 1){
// 隐藏元素
total1.style.display = 'none';
current1.style.display = 'none';
//显示元素
fileContent2.style.display = 'inline';
if(selectedFile != 1){
inputFile.style.display = 'block';
colorPicker.style.display = 'block';
}
total2.style.display = 'inline';
current2.style.display = 'inline';
current2.textContent = current;
}else{
// 显示元素
total1.style.display = 'inline';
current1.style.display = 'inline';
// 隐藏元素
fileContent2.style.display = 'none';
inputFile.style.display = 'none';
colorPicker.style.display = 'none';
total2.style.display = 'none';
current2.style.display = 'none';
}
showStatus = -showStatus;
}
// 下键
else if (key == 40) {
//隐藏文件上传标签
var fileShowStatus = inputFile.style.display
if(showStatus == -1){
if(fileShowStatus == "none"){
inputFile.style.display = 'block';
colorPicker.style.display = 'block';
}else{
inputFile.style.display = 'none';
colorPicker.style.display = 'none';
}
}
}
// 左键
else if (key == 37) {
if(selectedFile == 1){
current = current - 1;
if(current <= 0){
current = 0;
}
localStorage.setItem(localStorageKey, current);
fileContent2.textContent = a[current];
current2.textContent = current;
}else{
fileContent2.textContent = "请先选择文件";
}
}
// 右键
else if (key == 39) {
if(selectedFile == 1){
current = current + 1;
if(current >= total){
current = total;
}
localStorage.setItem(localStorageKey, current);
fileContent2.textContent = a[current];
current2.textContent = current;
}else{
fileContent2.textContent = "请先选择文件";
}
}
else{
//除上下左右、数字、小键盘数字、num lock、back、enter外的键均为老板键
if(numberArray.indexOf(key) != -1){
return;
}
// 显示元素
total1.style.display = 'inline';
current1.style.display = 'inline';
// 隐藏元素
fileContent2.style.display = 'none';
inputFile.style.display = 'none';
colorPicker.style.display = 'none';
total2.style.display = 'none';
current2.style.display = 'none';
showStatus = 1;
}
});
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
Whitelabel Error Page 看小说
共2个文件
js:1个
html:1个
需积分: 0 1 下载量 128 浏览量
2024-07-26
16:44:26
上传
评论
收藏 34KB RAR 举报
温馨提示
0、为了抹鱼做的页面,所以每次只显示一行,不容易被发现 1、需要自己下载小说文档,且必须为txt格式的,选择小说文件后,会使用浏览器缓存小说内容和看的行数,清理浏览器缓存后,需要重新选择文件。 2、下载压缩包,只有两个文件,一个html,一个js。用浏览器打开html页面 3、页面打开默认为正常页面状态:Whitelabel Error Page页面,网站常见的错误页。小说就在这个页面看 4、按 ↑ 键,来回切换看小说状态和正常页面状态 status=小说总行数, code=当前行数, 选择文件后,文件输入框自动隐藏,按 ↓ 可以显示文件选择框,重新选择文件 5、← → 换行,点击“code=”后面的数字,可以手动输入行数,按回车跳转 6、除上下左右、数字、小键盘数字、num lock、back、enter外的键均为老板键,按了页面就会切换回正常页面状态
资源推荐
资源详情
资源评论
收起资源包目录
web_novel.rar (2个子文件)
web_novel
web_novel.html 6KB
jquery.min.js 91KB
共 2 条
- 1
资源评论
(>_<)
- 粉丝: 41
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Java项目:婚品商城采购系统(java+Servlet+Jsp+Jdbc+jQuery+Ajax+MVC+mysql)
- DiscuzX3.5新秀网络验证管理系统-易语言模块-ver1.0
- DiscuzX3.5新秀网络验证管理系统-易语言模块-ver1.0
- Java项目:婚品商城采购系统(java+Servlet+Jsp+Jdbc+jQuery+Ajax+MVC+mysql)
- Java项目:婚品商城采购系统(java+Servlet+Jsp+Jdbc+jQuery+Ajax+MVC+mysql)
- 基于遗传算法原理系统代码.zip
- 模拟退火算法调度问题代码.zip
- algorithm-随机规划模型
- AnOs-keil5安装教程
- CUG人工智能作业-蒙特卡洛
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功