This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14256|Reply: 2

[CSS/DIV] The Matrix: The Matrix Revolution

[Copy link]
Posted on 11/14/2014 6:28:00 PM | | | |

[mw_shl_code=css,true] <!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>Martrix</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            background-color: #000;
            overflow: hidden;
            color:#e6922a;
        }
    </style>
</head>
<body>
    <canvas id="canvas"></canvas>
   
    <script type="text/javascript">
        var canvas = document.getElementById("canvas"),
            context = canvas.getContext("2d");

        var fontSize = 12,
            listText = "abcdefghijklmnopqrstuvwxyz        ".split(""),
            column, row,
            listColumn = [];

        function draw() {
            Draw background
            context.fillStyle = "rgba(0, 0, 0, 0.05)";
            context.fillRect(0, 0, canvas.width, canvas.height);
            context.save();

            Draw a logo
            context.shadowColor = "#074425";
            context.shadowBlur = parseInt(Math.random() * 40 + 1);
            context.font = "bold 36px Arial";
            context.fillStyle = "#eefbf5";
            context.fillText("ITSVSE.COM", (canvas.width / 2 - context.measureText("ITSVSE.COM").width / 2), canvas.height - 200);
            context.fillText("Wusoft Forum", (canvas.width / 2 - context.measureText("Wusoft Forum").width / 2), canvas.height - 165);
            context.font = "16px Microsoft Yahei";
            context.fillText("The Matrix: The Matrix Revolution", (canvas.width / 2 - context.measureText("The Matrix: The Matrix Revolution").width / 2), canvas.height - 100);

            Draw code
            context.restore();
            context.font = "normal " + fontSize + "px Arial";
            context.fillStyle = "#12ee46";
            for (var i = 0; i < column; i++) {
                if (Math.random() > 0.5) {
                    var str = listText[parseInt(Math.random() * listText.length)];
                    context.fillText(str, i * fontSize, listColumn* fontSize);
                    listColumn+= 1;
                    if (listColumn>= row) {
                        listColumn= 0;
                    }
                }
            }
        }

        function resize() {
            canvas.width = window.innerWidth - 3;
            canvas.height = window.innerHeight - 3;

            column = canvas.width / fontSize,
            row = canvas.height / fontSize;

            for (var i = 0; i < column; i++) {
                listColumn= 1;
            }
        }

        window.addEventListener("resize", resize);

        canvas.addEventListener("mousedown", function () {
            clearInterval(timer);
            timer = setInterval(draw, 20);
        });

        canvas.addEventListener("mouseup", function () {
            clearInterval(timer);
            timer = setInterval(draw, 40);
        });

        resize();
        var timer = setInterval(draw, 40);

    </script>
</body>
</html>[/mw_shl_code]




Previous:A beating electronic clock
Next:Android mobile phone cool run to swipe points, 10 minutes tens of thousands of points!
Posted on 11/14/2014 6:32:02 PM |
Love the feeling
Posted on 12/25/2014 11:44:31 PM |
Not bad I've seen other people's black pages before
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com