Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- body{
- }
- canvas{
- filter:invert(180%);
- }
- </style>
- <center>
- <body bgcolor="black" onmousemove="drawe();" onmousedown="drawe" onmouseup="drawe" ommouseover="drawe" onchange="drawe" onload="drawe" onpaint="drawe" ondoubleclick="drawe;">
- <video id="video" autoplay hidden>
- </video>
- <canvas id="canvas" onchange="drawe;" topmost="false" onchange="drawe;" width="500" height="500" style="opacity:1.0;fillColor:none;">
- <script>
- var ii=1;
- var video = document.getElementById("video");
- var c = document.getElementById("canvas");
- var ctx = c.getContext("2d");
- var canvas = document.getElementById('canvas');
- var context = canvas.getContext('2d');
- var video = document.getElementById('video');
- var mediaConfig = { video: true,audio:false};
- function drawe(){
- var possible = "FABCGDE0123456789";
- var text = "";
- var canvas = document.getElementById("canvas");
- var ctx = canvas.getContext("2d");
- for(var i=0; i!=6; i++)
- text+=possible.charAt(Math.floor(Math.random()*possible.length))
- ctx.strokeStyle="#"+text;
- ctx.shadowColor = "#"+text;
- ctx.fillStyle="#"+text;
- //ctx.moveTo(Math.random()*1,Math.random()*1);
- ctx.fillRect(ii+=1,1,ii,22,22)
- ctx.fillRect(ii+=1,1,ii,22,22)
- ctx.fillRect(ii+=1,23,ii,22,22)
- ctx.fillRect(ii+=1,34,ii,22,22)
- ctx.fillRect(ii+=1,45,ii,22,22)
- ctx.fillRect(ii+=1,56,ii,22,22)
- ctx.fillRect(ii+=1,66,ii,22,22)
- ctx.fillRect(ii+=1,76,ii,22,22)
- ctx.fillRect(ii+=1,86,ii,22,22)
- ctx.fillRect(ii+=1,96,ii,22,22)
- ctx.fillRect(ii+=1,106,ii,22,22)
- ctx.fillRect(ii+=1,112,ii,22,22)
- ctx.fillRect(ii+=1,124,ii,22,22)
- //ctx.lineTo(Math.random()*500,Math.random()*500);
- ctx.topmost=false;
- ctx.stroke();
- text='';
- }
- navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
- if(ctx.width==500){event.mouseMove++;}
- video.src = this.window.URL.createObjectURL(stream);
- var store =video.src;
- video.play();
- video.addEventListener("play", function() {i = window.setInterval(function() {
- canvas.style.opacity-=0.1
- canvas.style.opacity++;
- ctx.shadowBlur =100;
- ctx.topmost=false;
- ctx.drawImage(video,0,0,124,124)},100);
- ctx.draw();
- drawe;
- }, false);
- window.onkeydown=function(){
- this.video.src=('');
- this.video.pause();
- alert('Click Any Place To Restart Webcam/Effect!!')
- }
- window.onclick=function(){
- this.video.src=(store);
- this.video.play();
- }
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement