Created
June 5, 2024 06:18
-
-
Save JLarky/54afe84cb2be58bff4297c934812c361 to your computer and use it in GitHub Desktop.
Is it possible to apply CSS transitions inline? Yes
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
const links = document.querySelectorAll('a'); | |
links.forEach((link) => { | |
link.style.outline = '10px solid #52c5ea'; | |
link.style.outlineOffset = '5px'; | |
link.animate( | |
[ | |
{ outlineColor: '#448c4a', outlineOffset: '5px' }, | |
{ | |
outlineColor: '#52c5ea', | |
outlineOffset: '10px', | |
outlineWidth: '15px', | |
}, | |
{ outlineColor: '#448c4a', outlineOffset: '5px' }, | |
], | |
{ | |
duration: 1000, | |
iterations: 30, | |
}, | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment