Concision in CSS animations - any tips?

Is it possible to auto generate these animations? Can I use javascript to create @keyframes rules?

Javascript inserting a new rule into an existing stylesheet.
index must be the next one after any existing rule, first rule is index 0

sheet.insertRule(stylesText, index)

Create a new stylesheet if needed

var element = document.createElement('style');
var sheet;
document.head.appendChild(element);
sheet = element.sheet;
1 Like

whoa! This isn’t even on W3Schools o.O
Thanks!