一、html代码雨
效果图:
代码块
Code
body{
margin: 0;
overflow: hidden;
}
const width = document.getElementById("myCanvas").width = screen.availWidth;
const height = document.getElementById("myCanvas").height = screen.availHeight;
const ctx = document.getElementById("myCanvas").getContext("2d");
const arr = Array(Math.ceil(width / 10)).fill(0);
const str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("");
function rain() {
ctx.fillStyle = "rgba(0,0,0,0.05)";
ctx.fillRect(0, 0, width, height);
ctx.fillStyle = "#0f0";
arr.forEach(function (value, index) {
ctx.fillText(str[Math.floor(Math.random() * str.length)], index * 10, value + 10);
arr[index] = value >= height || value > 8888 * Math.random() ? 0 : value + 10;
});
}
setInterval(rain, 30);
二、vb代码雨
效果图:
代码块
@echo off&mode con cols=42 lines=20&color 02setlocal enabledelayedexpansionset code=123456789abcdefset m=1&set v=1title 神秘小峯代码雨:beginset /a a=%random%%%2,b=%random%%%3if %b% neq 0 (set b=%a%) else (set "b= ") set str=%str%%b%set /a n+=1if %n% lss 40 goto begin nanjingachopard.patek-swissa.comset /a m+=1,x+=1if %m% geq 20 set /a v+=1 set str%m%=%str%cls&for /l %%i in (%m%,-1,%v%) do echo.!str%%i!if %x% equ 20 call :lpset str=&set n=0goto begin:lpset /a a=%random%%%15,x=0set a=!code:~%a%,1!color 0%a%
三、bat代码雨
效果图:
代码块
@echo off&mode con cols=42 lines=20&color 02
set m=1&set v=1
set code==^^^&%%%^:!$#^>^ |