Created
January 11, 2022 23:11
-
-
Save giuseppeg/46592356d7c1579f488eddbd6042be44 to your computer and use it in GitHub Desktop.
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
// setup | |
let classes = ['a','b','c'] | |
let counter = 0 | |
el.classList.add(classes[counter]) | |
function rotate() { | |
counter++ | |
el.classList.replace( | |
classes[(counter-1) % classes.length], | |
classes[(counter) % classes.length] | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment