Glitch animation generator
How do I make an glitch animation generator?
With bas64 manipulation.. What is a glitch animation generator? How do you make a glitch animation generator? This script and codes were developed by Martin Grand on 11 August 2022, Thursday.
Glitch animation generator - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>glitch animation generator</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ html, body { width:100%; height:100%; padding:0; margin:0; font:16px/20px arial;
}
canvas { max-width:100%;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <label>Image File:</label><br/>
<input type="file" id="imageLoader" name="imageLoader"/><br/>
<canvas id="imageCanvas"></canvas> <script src="js/index.js"></script>
</body>
</html>
Glitch animation generator - Script Codes CSS Codes
html, body { width:100%; height:100%; padding:0; margin:0; font:16px/20px arial;
}
canvas { max-width:100%;
}
Glitch animation generator - Script Codes JS Codes
var imageLoader = document.getElementById('imageLoader'); imageLoader.addEventListener('change', handleImage, false);
var canvas = document.getElementById('imageCanvas');
var ctx = canvas.getContext('2d');
function handleImage(e){ var reader = new FileReader(); reader.onload = function(event){ var img = new Image(); img.onload = function(){ canvas.width = img.width; canvas.height = img.height; ctx.drawImage(img,0,0); requestAnimationFrame(function(){ img.src = createGlitch(event.target.result); }); } img.error = function(){ alert('fail'); } img.src = createGlitch(event.target.result); } reader.readAsDataURL(e.target.files[0]);
}
function createGlitch(input) { var urlParts, separator = ';base64,', what, whatRegexp, end; urlParts = input.split(separator); end = urlParts[1].slice(-10); urlParts[1] = urlParts[1].slice(0, -10); what = urlParts[1].substr(Math.random()*(urlParts[1].length),2); whatRegexp = new RegExp(what.replace('+', '/+'),"g"); urlParts[1] = urlParts[1].replace(what, what.split('').reverse().join('')) + end; return urlParts.join(separator);
}
Developer | Martin Grand |
Username | martingrand |
Uploaded | August 11, 2022 |
Rating | 3 |
Size | 2,321 Kb |
Views | 38,456 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Switch | 3,122 Kb |
Coming soon page for pixelbrain.io | 4,794 Kb |
BEM class name preprocess | 2,474 Kb |
Birthday Cake | 3,047 Kb |
Clock | 3,520 Kb |
Pure css christmas tree | 3,621 Kb |
Animated captcha concept | 2,723 Kb |
3d mosaic, with any image from your computer | 12,990 Kb |
Pure css loader | 3,918 Kb |
Seconds counter | 4,152 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Right Click Menu | Anodpixels | 2,252 Kb |
Google Chrome Icon using Pure CSS in one DIV | Grssam | 3,627 Kb |
Bezier Animation with straight paths | Rhernando | 2,087 Kb |
DFF Website | Hawcubite | 10,123 Kb |
Parallax-ish Sliding Content | Jdsteinbach | 2,748 Kb |
Draggable directive | YahyaKacem | 2,277 Kb |
Ionic - Wordpress REST API starter | Superpikar | 2,961 Kb |
Owl Carousel - jumpTo | OwlFonk | 2,553 Kb |
Modal Dialog | Gigaleet | 2,251 Kb |
Portfolio Page | HuffmanJ25 | 5,240 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!