EasyAnimationFrame.js
How do I make an easyanimationframe.js?
Using EasyAnimationFrame.js you can control the framerate of the new requestAnimationFrame API managing easily your loop function. What is a easyanimationframe.js? How do you make a easyanimationframe.js? This script and codes were developed by Gianluca Guarini on 04 November 2022, Friday.
EasyAnimationFrame.js - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>EasyAnimationFrame.js</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <p>Using <a target="_blank" href ="https://github.com/GianlucaGuarini/EasyAnimationFrame">EasyAnimationFrame.js</a> you can control the framerate of the new requestAnimationFrame API managing easily your loop function</p>
<div id="demo">0</div> <div style="clear:both;float:left;margin:10px 0 0"> <button id="stop">Stop Animation</button> <button id="start">Start Animation</button> <input style="width:300px" type="text" id="frameDelay" placeholder="Insert a valid number to update the frame delay"/> <p>Current frame delay: <span id="currentFrameDelay"></span></p> <p>Current framerate: <span id="framerate"></span> fps</p> </div> <script src='https://raw.github.com/GianlucaGuarini/EasyAnimationFrame/master/EasyAnimationFrame.js'></script> <script src="js/index.js"></script>
</body>
</html>
EasyAnimationFrame.js - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Titillium+Web);
body, a { background:#222; color: white; font-family: 'Titillium Web', sans-serif;
}
#demo { color:#fff; font-family: 'Titillium Web', sans-serif; font-size:100px; background:#1a4; float:left;
}
EasyAnimationFrame.js - Script Codes JS Codes
var demo = document.getElementById('demo'), start = document.getElementById('start'), stop = document.getElementById('stop'), frameDelay = document.getElementById('frameDelay'), framerate = document.getElementById('framerate'), currentFrameDelay = document.getElementById('currentFrameDelay'), i = 0, animator;
var animate = function () { i ++; demo.innerHTML = i; demo.style.paddingLeft = i + 'px'; framerate.innerHTML = animator.getFramerate();
};
window.onload = function () { // callback , DOM element to animate , FrameDelay animator = new EasyAnimationFrame( animate, demo , 150); //animator.startAnimation(); // autostart // Ui controllers stop.onclick = animator.clearAnimation; start.onclick = animator.startAnimation; currentFrameDelay.innerHTML = animator.getFrameDelay(); frameDelay.onblur = function () { animator.updateFrameDelay(this.value); currentFrameDelay.innerHTML = animator.getFrameDelay(); };
};
Developer | Gianluca Guarini |
Username | GianlucaGuarini |
Uploaded | November 04, 2022 |
Rating | 3 |
Size | 2,382 Kb |
Views | 16,192 |
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 |
Tocca.js | 4,270 Kb |
A Pen by Gianluca Guarini | 1,949 Kb |
The 3D Worrying Cubes | 103,249 Kb |
Riot simple movies live search | 3,501 Kb |
Appletv | 6,368 Kb |
CSS3 Breathing Particles | 2,756 Kb |
The Milk Glass | 26,300 Kb |
Site under construction | 9,039 Kb |
Find your mouse cursor | 3,687 Kb |
Drunk on Google Maps | 2,241 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 |
A Pen by Gregory Potdevin | GregoryPotdevin | 1,713 Kb |
Flat UI Button | Honchoman | 2,289 Kb |
Basic template | Tomcat | 1,675 Kb |
Headroom.js demo | WickyNilliams | 3,982 Kb |
Calendar | Miroot | 2,033 Kb |
A Pen by Jason Kinney | Jason-kinney | 1,980 Kb |
Resize image | Happyhj | 1,892 Kb |
AngularJS Skills | Supro | 3,312 Kb |
My Starter Kit For Codepen | Dkdesign | 2,012 Kb |
My Interests | Anshusaxenaarora | 2,015 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!