Skip to content

Instantly share code, notes, and snippets.

@mattn
Created March 7, 2022 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/27bad581e37cdd5be964e21e2a7ab8c4 to your computer and use it in GitHub Desktop.
Save mattn/27bad581e37cdd5be964e21e2a7ab8c4 to your computer and use it in GitHub Desktop.
<style>
#container {
display: inline-block;
margin-left: 200px;
margin-top: 200px;
}
#container img {
margin: 50px;
}
</style>
<script>
window.addEventListener('DOMContentLoaded', function() {
let d1 = 0, d2 = 0;
setInterval(function() {
d1 += 10;
d2 += 10;
document.getElementById("img1").style.transform = "rotate(" + d1 + "deg)";
document.getElementById("img2").style.transform = "rotate(" + d2 + "deg)";
}, 10);
})
</script>
<div id="container">
<img id="img1" src="ukrain.png">
<img id="img2" src="ukrain.png">
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment