Skip to content

Instantly share code, notes, and snippets.

@0x4248
Last active April 25, 2022 18:47
Show Gist options
  • Save 0x4248/4ac3ea55bfae27f68adfadf6c6d1969d to your computer and use it in GitHub Desktop.
Save 0x4248/4ac3ea55bfae27f68adfadf6c6d1969d to your computer and use it in GitHub Desktop.
opacity animator in J (minifiled)
<script src="https://gist.github.com/awesomelewis2007/4ac3ea55bfae27f68adfadf6c6d1969d" async defer></script>
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