用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字

用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字

请选择技术分类

 *如果你找不到更细的分类,可以选择上级分类
当前位置:云代码 - 技术问答 - HTML

星星代码

 悬赏:10|提问者:和雨音|浏览:2699
举报|2019-09-05
我想知道作者的星星代码可以换成文字和图片吗,请赐教

我来回答

所有回答
举报|(2)|(3)2019-09-17
首先我得线有星星代码
举报|(2)|(3)2019-10-09
应该不可以
举报|(2)|(3)2019-10-21
0000
举报|(2)|(3)2019-10-26
不可以
举报|(2)|(3)2019-10-31
五角星?
举报|(2)|(3)2019-11-11
赚积分
举报|(2)|(3)2020-01-27
不可以吧
举报|(2)|(3)2020-02-25
应该不行
举报|(1)|(2)2020-04-13
111111111111111111
举报|(1)|(2)2020-10-16
s
举报|(2)|(2)2021-03-02
好像不可以

你看懂了吗?

举报|(1)|(1)2021-04-08
<!DOCTYPE html>
<html>
<head>
    <title>黑客帝国代码雨</title>
</head>
  
<body>
<canvas id="canvas"></canvas>
<style type="text/css">
    body{margin: 0; padding: 0; overflow: hidden;}
</style>
<script type="text/javascript">
    var canvas = document.getElementById('canvas');
    var ctx = canvas.getContext('2d');
  
  
    canvas.height = window.innerHeight;
    canvas.width = window.innerWidth;
  
    var texts = '0123456789'.split('');
  
    var fontSize = 16;
    var columns = canvas.width/fontSize;
    // 用于计算输出文字时坐标,所以长度即为列数
    var drops = [];
    //初始值
    for(var x = 0; x < columns; x++){
        drops[x] = 1;
    }
  
    function draw(){
        //让背景逐渐由透明到不透明
        ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
        ctx.fillRect(0, 0, canvas.width, canvas.height);
        //文字颜色
        ctx.fillStyle = '#0F0';
        ctx.font = fontSize + 'px arial';
        //逐行输出文字
        for(var i = 0; i < drops.length; i++){
            var text = texts[Math.floor(Math.random()*texts.length)];
            ctx.fillText(text, i*fontSize, drops[i]*fontSize);
  
            if(drops[i]*fontSize > canvas.height || Math.random() > 0.95){
                drops[i] = 0;
            }
  
            drops[i]++;
        }
    }
  
    setInterval(draw, 33);
</script>
</body>
</html>

举报|(1)|(1)2021-04-09
赚积分
举报|(1)|(1)2021-05-26
dddd
举报|(1)|(1)2021-08-12
int aszS
举报|(1)|(1)2021-12-25
首先我得线有星星代码
举报|(1)|(1)2022-09-27
SGERTGSEF
举报|(0)|(0)2022-12-29
积分积分

相关提问