火绒安全软件

标题: 壁纸 [打印本页]

作者: hdxzd    时间: 2023-6-29 13:14
标题: 壁纸
本帖最后由 hdxzd 于 2023-6-29 13:15 编辑
  1. <html>
  2.         <head>
  3.                 <canvas id="canvas" style="background:black" width="620" height="340"></canvas>
  4.                
  5.                 <script type="text/javascript">
  6.                         
  7.                         window.onload = function(){
  8.                                 //获取图形对象
  9.                                 var canvas = document.getElementById("canvas");
  10.                                 //获取图形的上下文
  11.                                 var context = canvas.getContext("2d");
  12.                                 //获取浏览器屏幕的宽度和高度
  13.                                 var W = window.innerWidth;
  14.                                 var H = window.innerHeight;
  15.                                 //设置canvas的宽度和高度
  16.                                 canvas.width = W;
  17.                                 canvas.height = H;
  18.                                 //每个文字的字体大小
  19.                                 var fontSize = 24;
  20.                                 //计算列
  21.                                 var colunms = Math.floor(W /fontSize);        
  22.                                 //记录每列文字的y轴坐标
  23.                                 var drops = [];
  24.                                 //给每一个文字初始化一个起始点的位置
  25.                                 for(var i=0;i<colunms;i++){
  26.                                         drops.push(0);
  27.                                 }

  28.                                 //运动的文字
  29.                                 var str ="⠳⠁⠍⠼⠆⠡⠄⠚⠯⠄⠱⠦⠙⠥⠂⠚⠡⠁⠊⠂⠙⠲⠁⠂⠅⠊⠱⠴⠂⠌⠻⠁⠑⠰⠙⠥⠂⠱⠄⠊⠂⠓⠫⠂⠅⠊⠱⠂⠚⠳⠄⠑⠰⠙⠥⠂⠌⠥⠁⠵⠄⠊⠂⠅⠳⠁⠂⠅⠊⠌⠃⠑⠂⠑⠰⠙⠥⠂⠌⠥⠁⠚⠊⠂⠊⠂⠟⠒⠁⠂⠅⠊⠚⠊⠁⠟⠦⠆⠑⠲⠚⠡⠁⠌⠻⠊⠂⠙⠥⠂⠵⠕⠙⠥⠂⠰⠱⠄⠚⠩⠊⠂⠬⠄⠳⠚⠲⠙⠥⠂⠲⠥⠂⠱⠧⠥⠂⠢⠆⠱⠱⠼⠚⠴⠰⠱⠧⠙⠕⠁⠢⠆⠱⠖⠱⠓⠩⠂⠌⠢⠄⠰⠱⠧⠱⠖⠄⠢⠆⠙⠕⠁⠱⠹⠁⠚⠴⠰⠳⠢⠆⠥⠂⠱⠧⠱⠓⠜⠄⠚⠴⠰⠳⠱⠧⠥⠂⠢⠆⠱⠓⠩⠁⠋⠢⠂⠲⠞⠩⠁⠓⠫⠳⠊⠚⠴⠌⠁⠚⠊⠄⠂⠅⠢⠄⠊⠄⠃⠥⠓⠴⠆⠲⠃⠥⠙⠥⠂⠚⠴⠑⠂⠥⠊⠆⠳⠌⠁⠲⠚⠥⠚⠬⠂⠊⠄⠯⠁⠍⠡⠺⠌⠁⠚⠊⠄⠰⠍⠮⠊⠄⠓⠢⠚⠡⠺⠌⠁⠚⠊⠄⠰⠌⠥⠂⠊⠄⠵⠄⠳⠂⠺⠌⠁⠚⠊⠄⠰⠇⠩⠂⠊⠄⠇⠩⠂⠓⠊⠁⠺⠌⠁⠚⠊⠄⠰⠞⠖⠊⠄⠃⠊⠅⠣⠚⠴⠺⠂⠌⠁⠚⠊⠄⠰⠓⠡⠊⠄⠙⠲⠄⠋⠼⠆⠺⠌⠁⠚⠊⠄⠰⠱⠂⠊⠄⠍⠊⠄⠙⠩⠁⠺⠌⠁⠚⠊⠄⠰⠇⠊⠌⠁⠊⠄⠞⠪⠆⠌⠴⠁⠺⠌⠁⠚⠊⠄⠰⠟⠔⠊⠄⠇⠥⠂⠞⠲⠈⠇⠥⠬⠄⠺⠌⠁⠚⠊⠄⠰⠓⠭⠁⠉⠖⠄⠊⠄⠇⠡⠂⠚⠸⠁⠺⠌⠁⠚⠊⠄⠰⠟⠒⠇⠥⠂⠊⠄⠚⠊⠡⠁⠺⠌⠁⠚⠊⠄⠰⠚⠿⠁⠊⠄⠱⠖⠏⠡⠺⠌⠁⠚⠊⠄⠰⠚⠊⠁⠊⠄⠎⠲⠵⠲⠁⠺⠌⠁⠚⠊⠄⠰⠢⠂⠊⠄⠳⠆⠚⠸⠁⠺⠌⠁⠚⠊⠄⠰⠚⠥⠄⠊⠄⠍⠊⠓⠼⠺⠌⠁⠚⠊⠄⠰⠏⠊⠏⠔⠊⠄⠍⠡⠋⠮⠺⠌⠁⠚⠊⠄⠄⠄⠄⠄⠄⠄⠊⠬⠄⠌⠁⠙⠡⠂⠅⠩⠁⠅⠳⠁⠃⠥⠊⠂⠲⠚⠕⠆⠎⠲⠁⠌⠁⠬⠂⠅⠣⠱⠄⠰⠓⠢⠆⠌⠁⠬⠂⠺⠊⠆⠰⠌⠼⠎⠕⠄⠺⠃⠥⠅⠢⠄⠬⠄⠵⠕⠯⠂⠌⠢⠄⠑⠲⠺⠾⠳⠁⠸⠂⠰⠱⠥⠁⠳⠁⠙⠥⠰⠺⠓⠿⠁⠳⠁⠋⠼⠬⠄⠰⠺⠉⠪⠵⠄⠚⠫⠁⠚⠴⠳⠁⠍⠡⠆⠃⠢⠂⠰⠌⠴⠁⠱⠏⠥⠎⠔⠓⠣⠁⠟⠦⠲⠓⠿⠁⠃⠥⠅⠢⠄⠊⠄⠥⠂⠙⠑⠂⠆⠱⠧⠁⠃⠥⠅⠢⠄⠊⠄⠥⠂⠅⠯⠆⠱⠂⠃⠥⠅⠢⠄⠊⠄⠥⠂⠞⠪⠆⠱⠺⠄⠃⠥⠅⠢⠄⠊⠄⠥⠂⠵⠖⠄⠆⠅⠜⠍⠥⠆⠃⠥⠅⠢⠄⠊⠄⠥⠂⠞⠼⠇⠕⠂⠆⠚⠴⠃⠥⠅⠢⠄⠊⠄⠥⠂⠏⠊⠄⠲⠟⠒⠁⠞⠡⠁⠝⠜⠄⠱⠼⠁⠆⠓⠫⠞⠡⠁⠟⠧⠱⠼⠁⠆⠅⠳⠁⠞⠡⠁⠟⠲⠱⠼⠁⠆⠙⠲⠁⠞⠡⠁⠓⠾⠄⠱⠼⠁⠆⠃⠪⠂⠌⠷⠞⠡⠁⠅⠊⠱⠼⠁⠆⠾⠓⠫⠞⠡⠁⠓⠜⠁⠱⠼⠁⠆⠱⠧⠁⠌⠲⠁⠞⠡⠁⠎⠲⠁⠋⠼⠱⠼⠁⠆⠱⠺⠄⠚⠊⠞⠡⠁⠝⠮⠆⠝⠪⠄⠱⠼⠁⠆⠋⠦⠃⠥⠓⠬⠁⠱⠼⠁⠉⠄⠗⠄⠲⠚⠕⠆⠢⠆⠱⠖⠟⠆⠚⠥⠄⠆⠓⠧⠆⠅⠊⠁⠚⠷⠎⠺⠆⠌⠴⠁⠃⠥⠚⠕⠆⠗⠄⠇⠲⠂⠑⠲⠱⠦⠯⠂⠓⠬⠁⠌⠕⠂⠓⠖⠳⠆⠙⠻⠁⠥⠄⠓⠬⠁⠌⠕⠂⠇⠊⠳⠆⠅⠊⠁⠓⠊⠁⠓⠬⠁⠌⠕⠂⠸⠳⠆⠌⠲⠁⠅⠳⠁⠓⠬⠁⠌⠕⠂⠙⠧⠳⠆⠌⠲⠚⠳⠄⠓⠬⠁⠌⠕⠂⠊⠆⠳⠲⠇⠣⠂⠟⠲⠌⠲⠁⠚⠣⠁⠬⠂⠆⠬⠄⠟⠲⠌⠲⠁⠵⠄⠩⠆⠅⠢⠄⠸⠂⠥⠇⠮⠱⠴⠂⠓⠩⠁⠂⠌⠼⠚⠥⠙⠲⠁⠋⠦⠍⠧⠆⠅⠩⠆⠃⠊⠱⠚⠣⠁⠍⠔⠄⠍⠴⠂⠚⠴⠃⠥⠙⠢⠗⠓⠪⠆⠌⠁⠲⠐⠆";
  30.                                 //4:fillText(str,x,y);原理就是去更改y的坐标位置
  31.                                 //绘画的函数
  32.                                 function draw(){
  33.                                 //让背景逐渐由透明到不透明
  34.                                         context.fillStyle = "rgba(0,0,0,0.05)";
  35.                                         context.fillRect(0,0,W,H);

  36.                                         //给字体设置样式context.font = "700 "+fontSize+"px [字体名称]";
  37.                                        
  38.                                         context.font = fontSize + 'px Segoe UI';
  39.                                         //给字体添加颜色context.fillStyle = 【字体颜色】
  40.                                         context.fillStyle ="LightGreen";

  41.                                         //写入图形中
  42.                                         for(var i=0;i<colunms;i++){
  43.                                                 var index = Math.floor(Math.random() * str.length);
  44.                                                 var x = i*fontSize;
  45.                                                 var y = drops[i] *fontSize;
  46.                                                 context.fillText(str[index],x,y);

  47.                                                 //如果要改变时间,肯定就是改变每次他的起点
  48.                                                 if(y >= canvas.height && Math.random() > 0.92){
  49.                                                         drops[i] = 0;
  50.                                                 }
  51.                                                 drops[i]++;
  52.                                         }
  53.                                 };

  54.                                 function randColor(){
  55.                                         var r = Math.floor(Math.random() * 256);
  56.                                         var g = Math.floor(Math.random() * 256);
  57.                                         var b = Math.floor(Math.random() * 256);
  58.                                         return "rgb("+r+","+g+","+b+")";

  59.                                 }

  60.                                 draw();
  61.                                 setInterval(draw,10); //速度

  62.                         };

  63.                 </script>
  64.                
  65.                 <style type="text/css">
  66.                         body{margin: 0; padding: 0; overflow: hidden;}
  67.                 </style>
  68.         </head>
  69.         
  70.         <body>
  71.                
  72.         </body>

  73. </html>
复制代码

将以上内容复制到HTML文件中

作者: kirby    时间: 2023-6-29 14:08
好帅            
作者: 南国东东    时间: 2023-6-29 18:22
以前有个叫“黑客帝国”的屏保
作者: hdxzd    时间: 2023-6-29 21:56
不是屏保,就是动态壁纸




欢迎光临 火绒安全软件 (https://bbs.huorong.cn/) Powered by Discuz! X3.4