0 votes
by (170 points)
I am planning to have a warning system built into my game. Links implying difficult or risky actions will be tagged with the "defiant" class and will shake when clicked. They also have to be clicked multiple times for the story to continue.

How can I set up the shake animation with pure CSS? I tried using keyframes and <<linkreplace>> but the second link replaces the first before the animation is visible.

2 Answers

0 votes
by (2.7k points)
edited by

How are you getting the link to shake? I might be able to help. The Sugarcube <<timed>> macro might allow the animation to show. As for how to actually make it shake... I have no idea.

Edit: Install the shaking links add-on mentioned below. Then use this code:

<<linkreplace "Shaking Link">><<shake>>[[Shaking Link]]<</shake>><</linkreplace>>

 

0 votes
by (710 points)
I haven't used it myself, but one of the add-ons listed on the Sugarcube 2 page is a macro to do shaking text. http://www.motoslave.net/sugarcube/2/
...