Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Keyframes and animation?

1490337508
John B
Pro
Sheet Author
Was fiddling with a character sheet for a home brew and wanted the galaxy to spin on the sheet as just a point of interest and wasn't able to get animation to work.  Now was it because I did something incorrect or is this not supported?  And if it isn't supported well is there a reason why?  thanks
1490346519

Edited 1490346543
Loki
Sheet Author
It is safe to say this isn't supported. Why? Cause right now the script to secure the CSS of sheets is not made to handle it. The script parses the CSS and adds ".charsheet " before any content that comes after a "}" so this @keyframes mymove {0%{top: 0px;}100%{top: 100px;}} turns into this @keyframes mymove {0%{top: 0px;}.charsheet 100%{top: 100px;}.charsheet } Causing the animation to fail to register anything but the 0% phase.
1490374222
John B
Pro
Sheet Author
Ah saw that piece about the parsing and that is why imports wasn't supported and the logic behind needing a way for a css to not goof their presentation up.  Now I get a little bit more of what that meant.  thank you @Loki. 
1490376272
Lithl
Pro
Sheet Author
API Scripter
You can use CSS transitions. That doesn't let you do the same stuff that you can with animations, but it can still get you some nice effects. I used a transition for the toggle button on my Arkham Horror character sheet.
1490378003
John B
Pro
Sheet Author
Yeah I was first experimenting on the transitions with the on hover for a message text bubble to make it look like messaging is through a computer app for a template in my home brew version of a 6D game. 
1490474995
John B
Pro
Sheet Author
Thought I'd share that I was able to get some animation within the limitations that the parsing causes by having a list of named animation in sequence.  It always goes back to original state then the next step so still very limited but thought I'd share. Conceptional like this where in the html there is a loan div tag: div { width: 100px; height: 100px; background-color: red; animation-name: example1, expample2, example3; animation-duration: 4s, 8s, 12s, 16s; } /* Standard syntax */ @keyframes example { 100% {background-color: black;} } @keyframes example { 100% {background-color: Green;} }