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>
相关推荐
土星云SaturnCloud1 天前
液冷“内卷”:在局部优化与系统重构之间,寻找第三条路
服务器·人工智能·ai·计算机外设
李斯维1 天前
MBR 和 GPT 区别
windows·嵌入式硬件·bootstrap·计算机外设
TESmart碲视1 天前
如何为超宽屏显示器选择 KVM 切换器?
计算机外设·kvm切换器·宽屏显示
ACP广源盛139246256731 天前
GSV1011@ACP#1011产品规格详解及产品应用分享
嵌入式硬件·计算机外设·音视频
liliangcsdn1 天前
如何在mac m1模拟鼠标与键盘的自动化操作
自动化·计算机外设
民乐团扒谱机2 天前
【微实验】基于Python实现的实时键盘鼠标触控板拾取检测(VS2019,附完整代码)
python·c#·计算机外设
码点3 天前
ShareMouse 在多台设备间共用一套鼠标键盘
计算机外设
私人珍藏库3 天前
[吾爱大神原创工具] FlowMouse - 心流鼠标手势 v1.0【Chrome浏览器插件】
前端·chrome·计算机外设
未知原色3 天前
阿里验证码Web和H5客户端V3架构接入鼠标拖拽滑块离开对话框释放鼠标时一直处于验证中问题
计算机外设
SamtecChina20233 天前
Electronica现场演示 | Samtec前面板解决方案
大数据·人工智能·算法·计算机外设