Pertama, copy code dibawah ini sebagai dasarnya :
<head>
<style>
canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
}
</style>
</head>
<body>
<canvas></canvas>
<script>
</script>
</body>
Lalu copy code dibawah ini dan taruh di bawah tag <script> :
var c = document.getElementsByTagName('canvas')[0],
x = c.getContext('2d');
pr = window.devicePixelRatio || 1,
w = window.innerWidth,
h = window.innerHeight,
c.width = w*pr;
c.height = h*pr;
x.globalAlpha = 0.9;
var mh = Math.floor(c.height/3),
rp = Math.floor((Math.random() * (c.height-mh)) + 0),
rh = Math.floor((Math.random() * mh) + (rp+30)),
cl = ['#00C8F8','#59C4C5', '#F3BA39', '#FBE2B4',
'#FF4C65', '#588C73', '#F2E394', '#F2AE72',
'#D96459', '#8C4646'];
x.beginPath();
x.moveTo(0, rp);
x.lineTo(0, rh);
x.lineTo(c.width/2, c.height/2);
x.closePath();
x.fillStyle = cl[Math.floor((Math.random() * 9) + 0)];
x.fill();
x.beginPath();
x.moveTo(c.width, c.height-rp);
x.lineTo(c.width, c.height-rh);
x.lineTo(c.width/2, c.height/2);
x.closePath();
x.fillStyle = cl[Math.floor((Math.random() * 9) + 0)];
x.fill();
Sekian dan terimakasih ^_^
--------------------------------------------------------------------------------------------------------------
Big thanks for Google and all Blogger~




0 komentar:
Posting Komentar