CSS Animation seeking with JavaScript
How do I make an css animation seeking with javascript?
What is a css animation seeking with javascript? How do you make a css animation seeking with javascript? This script and codes were developed by Peter Hrynkow on 14 September 2022, Wednesday.
CSS Animation seeking with JavaScript - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS Animation seeking with JavaScript</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="thing" style=""></div>
<div class="info"><h4>Scroll Down</h4><p>Here’s how you can seek to a specific frame in a CSS Animation using JavaScript. The trick is to use a negative animation delay.</p></div>
<div class="thing" style=""></div>
<div class="info"><h4>Extra text</h4><p>Here is some more text ipsum dolor site amet. Mauris iaculis porttitor posuere. Praesent id metus massa, ut blandit odio. Proin quis tortor orci. Etiam at risus et.
</p></div> <script src="js/index.js"></script>
</body>
</html>
CSS Animation seeking with JavaScript - Script Codes CSS Codes
body { padding-bottom: 500px;
}
.thing { margin: 100px auto; border: 1px solid #ccc; width: 100px; height: 100px; -webkit-animation: move 1s linear infinite; animation: move 1s linear infinite; -webkit-animation-direction: alternate; animation-direction: alternate; -webkit-animation-fill-mode: both; animation-fill-mode: both; -webkit-animation-play-state: paused; animation-play-state: paused; will-change: transform;
}
.info { margin: 0 auto; max-width: 500px; padding: 0 20px; margin: 100px auto;
}
@-webkit-keyframes move { 0% { -webkit-transform: translateY(0px); transform: translateY(0px); } 100% { -webkit-transform: translateY(200px) rotate(45deg); transform: translateY(200px) rotate(45deg); }
}
@keyframes move { 0% { -webkit-transform: translateY(0px); transform: translateY(0px); } 100% { -webkit-transform: translateY(200px) rotate(45deg); transform: translateY(200px) rotate(45deg); }
}
CSS Animation seeking with JavaScript - Script Codes JS Codes
'use strict';
{ (function () { var things = Array.from(document.querySelectorAll('.thing')); var scrollPosition = 0; var render = function render() { var complete = Math.min(scrollPosition / 500, 1) * -1; things.forEach(function (thing) { thing.style.animationDelay = complete + 's'; }); window.requestAnimationFrame(render); }; var scrollHandler = function scrollHandler() { scrollPosition = window.pageYOffset; }; window.addEventListener('scroll', scrollHandler); render(); })();
}
Developer | Peter Hrynkow |
Username | peterhry |
Uploaded | September 14, 2022 |
Rating | 3 |
Size | 3,053 Kb |
Views | 20,240 |
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 |
CircleType | 3,535 Kb |
Juicy Red Button | 2,173 Kb |
CSS Button with Angled Sides | 2,338 Kb |
T-Shape Visualization | 3,883 Kb |
Word Wrap Algorithm for Multiline Canvas Text | 2,349 Kb |
CSS Starbursts | 2,605 Kb |
Simple scroll prompt | 2,480 Kb |
3D Message Flipper | 2,651 Kb |
Ripple Effect | 242,119 Kb |
Kris Kross Hamburger | 2,517 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 |
Word Wrap Algorithm for Multiline Canvas Text | Peterhry | 2,349 Kb |
Rows with image hover effect | Amit-webdesigner | 12,875 Kb |
Incremental game | Eprouver | 5,868 Kb |
V.35 The Monolith Update - Hero Release Notes | Jordan | 12,045 Kb |
CSS3 Button Examples | Volusion | 3,377 Kb |
Draggables in pure angular | Rlo206 | 5,167 Kb |
Perspective Origin Demo | Agelber | 3,614 Kb |
Stylize Stories | Jvhti | 2,465 Kb |
Jstam.com Home Page | Jstam | 10,558 Kb |
Shopping List | Markmurray | 6,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!