Walkcycle with music loop
How do I make an walkcycle with music loop?
Demonstrating that the HTML5 audio's looping capability, which you'd think would be seemless and awesome, "pauses for breath" between loopage. Le sigh.. What is a walkcycle with music loop? How do you make a walkcycle with music loop? This script and codes were developed by Rachel Nabors on 14 June 2022, Tuesday.
Walkcycle with music loop - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Walkcycle with music loop</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <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! */ .tuna { animation: walk-cycle 1s steps(12) infinite; background: url(http://stash.rachelnabors.com/img/codepen/tuna_sprite.png) 0 0 no-repeat; height: 200px; width: 400px; margin: 100px auto 0;
}
@keyframes walk-cycle { 0% {background-position: 0 0; } 100% {background-position: 0 -2391px; }
}
html {text-align: center;} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="tuna"></div>
<input type="button" value="Play loop!" />
<!--Notice the pauses in the loopage. So sad. Why you hurt me so, browsers?-->
<audio loop> <source src="http://stash.rachelnabors.com/music/byakkoya_single.mp3" type='audio/mpeg; codecs="mp3"'/> <source src="http://stash.rachelnabors.com/music/byakkoya_single.ogg" type='audio/ogg; codecs="vorbis"' />
</audio> <script src="js/index.js"></script>
</body>
</html>
Walkcycle with music loop - Script Codes CSS Codes
.tuna { animation: walk-cycle 1s steps(12) infinite; background: url(http://stash.rachelnabors.com/img/codepen/tuna_sprite.png) 0 0 no-repeat; height: 200px; width: 400px; margin: 100px auto 0;
}
@keyframes walk-cycle { 0% {background-position: 0 0; } 100% {background-position: 0 -2391px; }
}
html {text-align: center;}
Walkcycle with music loop - Script Codes JS Codes
document.querySelector('input').addEventListener('click', playMusic);
function playMusic() { document.querySelector('audio').play(); // audio tags have play
};
![Walkcycle with music loop - Script Codes](http://shots.codepen.io/rachelnabors/pen/gcump-512.jpg)
Developer | Rachel Nabors |
Username | rachelnabors |
Uploaded | June 14, 2022 |
Rating | 4 |
Size | 2,398 Kb |
Views | 143,704 |
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 |
Crisp lines at smaller sizes | 2,869 Kb |
Running on Web Animations API | 4,700 Kb |
Loading Tuna in the Window | 3,409 Kb |
Text Clipping Sass mixin | 2,593 Kb |
Bright Lights, Big Kitty | 2,853 Kb |
Key Press SVG illustration with CSS animation | 4,242 Kb |
Spinner | 3,385 Kb |
Tuna in the Window | 2,441 Kb |
Falling Down the Rabbit Hole | 4,578 Kb |
Rolling a Ball with CSS Transitions | 2,694 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 |
TheCalendar.js | The-teacher | 6,330 Kb |
A Pen by Brendan Skousen | Bskousen | 2,954 Kb |
Dice | Fraina | 5,026 Kb |
CSS3 Diamond | Rendro | 1,960 Kb |
Sass Radar | Jlong | 6,887 Kb |
Sass Get Function | Lukewatts | 2,155 Kb |
IbrahimJabbari-Effect21 | Ibrahimjabbari | 1,882 Kb |
03 - CSS Variables | Run-time | 2,682 Kb |
Slide like Mailbox | Hmps | 3,758 Kb |
Hello People | Danburrows | 2,365 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!