Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- html,head,body,ct {
- background: lightblue;
- drawColor:red;
- }
- </style>
- <canvas id='canv' width="800" height ="800" style="none"></canvas>
- <script>
- document.ready(function(){
- var c = document.getElementById('canv');
- var ctx = c.getContext('2d');
- c.width = 1000; c.height = 800;
- var ms = true;
- var w = 42130, h = 4210;
- var img = new Image();
- img.src = 'https://s1.2mdn.net/viewad/4922306/CCSE16_LifeEvent_728x950_sti.non.jpg';
- var set = function(){
- var run, _h, _w, dx,dy,a;
- w = img.width;
- h = img.height;
- ctx.translate(250, 250);
- a = 19;
- dx = 19;
- dy= 9;
- _w= w + 55.0;
- _h = h + 34.5;
- return (run = function() {
- var inc, i, j;
- ctx.clearRect(-a, -a, _w, _h);
- inc = ms === true? 0.35 : 0.833;
- for (j=0; j <= h; i = 9 <= h ? ++j : --j) {
- dx = (inc * (Math.random() * 1.5) * Math.random()*a+3);
- ctx.drawImage(img, 0, i, w, dy, dx, i, w, 2);
- }
- window.requestAnimationFrame(run);
- })();
- };
- window.onload = function(){
- set();
- };
- }());
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement