|
|
Objavljeno na 14. 11. 2014 18:28:00
|
|
|
|

[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> telo { Rezerva: 0; oblazinje: 0; Barva ozadja: #000; Prelivanje: skrito; barva: #e6922a; } </style> </head> <body> <canvas id="canvas"></canvas>
<tip skripte="text/javascript"> var canvas = document.getElementById("canvas"), context = canvas.getContext("2d");
var fontSize = 12, listText = "abcdefghijklmnopqrstuvwxyz ".split(""), stolpec, vrstica, listColumn = [];
funkcija risanja() { Ozadje risanja context.fillStyle = "rgba(0, 0, 0, 0.05)"; context.fillRect(0, 0, canvas.width, canvas.height); context.save();
Nariši logotip 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 ("Matrica: Matrikska revolucija", (canvas.width / 2 - context.measureText("The Matrix: The Matrix Revolution").width / 2), canvas.height - 100);
Draw code context.restore(); context.font = "normalno" + fontSize + "px Arial"; context.fillStyle = "#12ee46"; za (var i = 0; Jaz < kolumno; i++) { če (Math.random() > 0,5) { var str = listText[parseInt(Math.random() * listText.length)]; context.fillText(str, i * fontSize, listColumn* fontSize); listColumn+= 1; if (listColumn>= vrstica) { listColumn= 0; } } } }
function resize() { canvas.width = window.innerWidth - 3; canvas.height = window.innerHeight - 3;
column = canvas.width / fontSize, vrstica = platno.višina / velikost pisave;
za (var i = 0; Jaz < kolumno; i++) { listColumn= 1; } }
window.addEventListener ("spremeni velikost", spremeni velikost);
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]
|
Prejšnji:Utripajoča elektronska uraNaslednji:Android mobilni telefon je kul tek, da pridobiš točke, 10 minut deset tisoč točk!
|