Last active
April 25, 2022 18:47
-
-
Save 0x4248/4ac3ea55bfae27f68adfadf6c6d1969d to your computer and use it in GitHub Desktop.
opacity animator in J (minifiled)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://gist.github.com/awesomelewis2007/4ac3ea55bfae27f68adfadf6c6d1969d" async defer></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sleep(t){return new Promise(e=>setTimeout(e,t))}async function opacity_to_100(t){var e=0;for(let o=0;o<25;o++)document.getElementById(t).style.opacity=e+"%",e+=4,await sleep(10)}async function opacity_to_0(t){var e=100;for(let o=0;o<25;o++)document.getElementById(t).style.opacity=e+"%",e-=4,await sleep(10)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment