8bit Animation
How do I make an 8bit animation?
This is a spin off of an old pen i wrote.. What is a 8bit animation? How do you make a 8bit animation? This script and codes were developed by Chad Scira on 27 August 2022, Saturday.
8bit Animation - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>8bit Animation</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! */ .container { position: relative; width: 305px; height: 350; margin: auto; margin-top: 20px; transform-origin: 50% 0; transform: scale(.6);
}
.cell { opacity: .8;
}
@keyframes fade { from { opacity: .8; transform: scale(1); } to { opacity: 1; transform: scale(1.5); }
}
@media screen and ( min-height: 200px ) {.container {transform: scale(.6);}}
@media screen and ( min-height: 300px ) {.container {transform: scale(.8);}}
@media screen and ( min-height: 400px ) {.container {transform: scale(1);}}
@media screen and ( min-height: 500px ) {.container {transform: scale(1.3);}}
@media screen and ( min-height: 600px ) {.container {transform: scale(1.7);}} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="container"></div> <script src="js/index.js"></script>
</body>
</html>
8bit Animation - Script Codes CSS Codes
.container { position: relative; width: 305px; height: 350; margin: auto; margin-top: 20px; transform-origin: 50% 0; transform: scale(.6);
}
.cell { opacity: .8;
}
@keyframes fade { from { opacity: .8; transform: scale(1); } to { opacity: 1; transform: scale(1.5); }
}
@media screen and ( min-height: 200px ) {.container {transform: scale(.6);}}
@media screen and ( min-height: 300px ) {.container {transform: scale(.8);}}
@media screen and ( min-height: 400px ) {.container {transform: scale(1);}}
@media screen and ( min-height: 500px ) {.container {transform: scale(1.3);}}
@media screen and ( min-height: 600px ) {.container {transform: scale(1.7);}}
8bit Animation - Script Codes JS Codes
function Logo ($config) { this.bitData = {"width":20,"height":23,"colors":["ffffff","000000","4c2600","663300","fdd180","fedb99","fdc867","fcbc4f","991200","b21700","cc1c00"],"pixels":[0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,3,3,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,3,3,3,3,3,1,0,0,0,0,0,0,0,0,0,1,2,2,3,3,3,3,3,3,3,3,1,0,0,0,0,0,0,0,0,1,2,4,4,2,3,3,4,4,2,3,1,0,0,0,0,0,0,0,0,1,4,5,5,5,2,4,5,5,5,2,1,0,0,0,0,0,0,0,0,1,4,0,1,0,5,0,1,0,5,1,5,1,0,0,0,0,0,0,0,1,2,4,4,6,4,6,4,4,2,1,5,1,0,0,0,0,0,0,0,1,4,5,5,5,5,5,5,5,5,5,1,0,0,0,0,0,0,0,0,1,4,7,7,7,7,7,7,7,5,5,1,0,0,0,0,0,0,0,0,1,1,4,4,4,4,4,4,4,5,1,1,0,0,0,0,0,0,0,1,2,2,1,1,1,1,1,1,1,1,5,3,1,0,0,0,0,0,1,2,3,3,4,5,8,8,8,5,5,5,5,3,3,1,0,0,0,1,2,3,3,3,4,5,5,9,4,5,5,5,4,1,2,3,1,0,1,2,3,3,3,1,2,4,9,10,10,4,4,4,3,1,2,3,3,1,1,2,3,3,3,1,1,2,9,10,10,6,6,3,1,1,2,3,3,1,1,2,3,3,1,0,1,2,9,10,10,6,6,3,1,0,1,2,3,1,1,2,2,3,1,0,1,2,3,9,7,6,3,3,1,0,1,2,3,1,0,1,4,4,1,1,2,3,3,3,3,3,3,3,3,1,1,5,5,1,0,1,4,1,5,1,2,2,2,1,1,1,2,3,3,1,4,1,5,1,0,1,4,4,1,4,4,5,5,1,0,1,4,4,5,5,1,4,4,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1]}; this.scale = $config.scale || 1;
}
Logo.prototype = { renderTo: function (container) { this.bitData.pixels.forEach(function (value, key) { var color = '#' + this.bitData.colors[value], x = key % this.bitData.width, y = Math.floor(key / this.bitData.width); var block = document.createElement('div'); block.style.backgroundColor = color; block.style.position = 'absolute'; block.style.width = (this.scale * 5) + 'px'; block.style.height = (this.scale * 5) + 'px'; block.style.left = (x * this.scale * 5) + 'px'; block.style.top = (y * this.scale * 5) + 'px'; block.className = 'cell'; block.style.animation = block.style.mozAnimation = block.style.webkitAnimation = 'fade 1s ' + (Math.random()*3).toFixed(3) + 's infinite alternate'; container.appendChild(block); }, this); }
};
var logo = new Logo({scale: 3});
logo.renderTo(document.querySelector('.container'));
Developer | Chad Scira |
Username | icodeforlove |
Uploaded | August 27, 2022 |
Rating | 3 |
Size | 2,764 Kb |
Views | 76,912 |
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 |
FontAwesome | 4,360 Kb |
Animated rainbow wave on canvas | 2,777 Kb |
Animated 3D Text | 3,272 Kb |
Canvas Text Vortex | 3,252 Kb |
Client-side nudity detection | 6,271 Kb |
Dippin Dots | 2,459 Kb |
CSS Voxel Animation | 3,005 Kb |
Text Vortex | 6,534 Kb |
Ripple Words | 3,081 Kb |
Delayed Follow | 2,306 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 |
Sass random color animation | Jotavejv | 4,827 Kb |
Acorrdian 2016 | Milanodituti | 3,720 Kb |
Portfolio Layout Flex | Lahvjal | 3,489 Kb |
Tab Menus | Zephyr | 3,180 Kb |
Mega menu | DimaZubkov | 5,066 Kb |
Myprofile | SoufianeAbid | 2,451 Kb |
Matrix | Stathisnikolaidis | 1,922 Kb |
Cartoon Bomb | Tcmulder | 4,929 Kb |
Css3 loader | Clknap | 2,391 Kb |
Simple DevTools | Deegill | 2,511 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!