HTML 显示器纯色亮点检测工具

HTML 显示器纯色亮点检测工具

相关资源文件已经打包成html等文件,可双击直接运行程序,且文章末尾已附上相关源码,以供大家学习交流,博主主页还有更多Html相关程序案例,秉着开源精神的想法,望大家喜欢,点个关注不迷路!!!

1. 简介:

纯色循环显示HTML,家里经常买显示器,需要测试亮点坏点

这个是用浏览器技术做的纯色亮点测试网页工具。

用浏览器打开后按F11进全屏,一直换显示器。

使用方式:

拖进浏览器,按下F11快捷键进入全屏,退出也是F11。

闪烁时间更改:

html 复制代码
window.setInterval(swichcolor, 1000);

最后里两行 , 这里是毫秒. 1秒=1000毫秒

改好刷新就可以用了.

2. 运行效果:

3. 相关源码:

html 复制代码
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>显示器测试-每秒自动切换颜色</title>
</head>

<body style="height: 100%;width: 100%;"
  onLoad="javascript:window.resizeTo(screen.availWidth,screen.availHeight);window.moveTo(0,0)">

    <script>
        function formatDate(date) {
            var date = new Date(Date.now());
            var YY = date.getFullYear() + '-';
            var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
            var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
            var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
            var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
            var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
            return YY + MM + DD + " " + hh + mm + ss;
        }

        var color = 0;
        var ci = 0;

        function swichcolor() {
            switch (color) {
                case 0:
                    document.getElementsByTagName("body")[0].style.backgroundColor = '#000000';
                    color = 1;
                    console.log(`当前时间${formatDate()},脚本已经执行了${ci}次,当前:黑色`);
                    break;
                case 1:
                    document.getElementsByTagName("body")[0].style.backgroundColor = '#FF0000';
                    color = 2;
                    console.log(`当前时间${formatDate()},脚本已经执行了${ci}次,当前:红色`);
                    break;
                case 2:
                    document.getElementsByTagName("body")[0].style.backgroundColor = '#00FF00';
                    color = 3;
                    console.log(`当前时间${formatDate()},脚本已经执行了${ci}次,当前:绿色`);
                    break;
                case 3:
                    document.getElementsByTagName("body")[0].style.backgroundColor = '#0000FF';
                    color = 4;
                    console.log(`当前时间${formatDate()},脚本已经执行了${ci}次,当前:蓝色`);
                    break;
                case 4:
                    document.getElementsByTagName("body")[0].style.backgroundColor = '#FFFF00';
                    color = 5;
                    console.log(`当前时间${formatDate()},脚本已经执行了${ci}次,当前:黄色`);
                    break;
                case 5:
                    document.getElementsByTagName("body")[0].style.backgroundColor = '#00FFFF';
                    color = 6;
                    console.log(`当前时间${formatDate()},脚本已经执行了${ci}次,当前:青色`);
                    break;
                case 6:
                    document.getElementsByTagName("body")[0].style.backgroundColor = '#FF00FF';
                    color = 7;
                    console.log(`当前时间${formatDate()},脚本已经执行了${ci}次,当前:紫红色`);
                    break;
                case 7:
                    document.getElementsByTagName("body")[0].style.backgroundColor = '#C0C0C0';
                    color = 8;
                    console.log(`当前时间${formatDate()},脚本已经执行了${ci}次,当前:灰色`);
                    break;
                case 8:
                    document.getElementsByTagName("body")[0].style.backgroundColor = '#FFFFFF';
                    color = 0;
                    console.log(`当前时间${formatDate()},脚本已经执行了${ci}次,当前:白色`);
                    break;
                default:
                    break;
            }
            ci += 1;
        }

        window.setInterval(swichcolor, 1000);
    </script>
</body>
</html>
相关推荐
神奇程序员9 天前
不止高刷:明基 RD280UG 在编码场景下的表现如何
计算机外设
开开心心就好9 天前
安卓开源应用,超时提醒紧急人护独居安全
windows·决策树·计算机视觉·pdf·计算机外设·excel·动态规划
上海合宙LuatOS9 天前
LuatOS核心库API——【iotauth 】 IOT 鉴权库
java·单片机·嵌入式硬件·物联网·struts·计算机外设·硬件工程
谁刺我心10 天前
qml自定义鼠标
计算机外设
SamtecChina202310 天前
Samtec连接器设计研究 | 载流量:温升为什么重要?
大数据·网络·人工智能·算法·计算机外设
ACP广源盛1392462567310 天前
GSV6502与GSV2001应用场景相同点和差异点对比@ACP
单片机·计算机外设
凌云拓界11 天前
TypeWell全攻略(二):热力图渲染引擎,让键盘发光
前端·后端·python·计算机外设·交互·pyqt·数据可视化
南山十一少12 天前
cherry键盘组合MacBook使用
计算机外设
开开心心就好13 天前
免费音频转文字工具,绿色版离线多模型可用
人工智能·windows·计算机视觉·计算机外设·ocr·excel·语音识别
开开心心就好14 天前
实用系统备份还原,小巧免PE备份快镜像小
windows·计算机视觉·pdf·计算机外设·迭代器模式·excel·桥接模式