Twine Version: 2.3.14
Story Format: Sugarcube 2.34.1
I have these links that disappear after a few second and play a css animation before they disappear:
CSS:
@keyframes qte{
0% {color: #ff2108;}
100% {color: black;}
}
In passage:
<span id="QTE">
<a data-passage="Next Passage" style= "animation: qte 3s">This link disappears in 3 seconds!</a>
</span>
<<timed 3s>>
<<replace "#QTE">>
Ah you missed it.
<</replace>>
<</timed>>
<<silently>>[[Next Passage]]<</silently>>
Right now I want to show many of these links in several passages. The text is the same, but the timing across different passages are different. For example, the first passage have “A” “B” “C” “D”, all 5 seconds long, then second passage these same links only lasts 3 seconds, and 1 second in the next passage.
Changing every link individually is kinda cumbersome, and there are quite a lot of passages that have them, so I thought of plugging in a temporary variable for each passage, but the problem is that I couldn’t figure out how to put it in the “style” part in <a>
I tried some examples online and here is what I have:
<<set _time = 3>>
<span id="QTE">
<<= '<a data-passage="Next Passage" style= "animation: qte +_time+s">This link disappear in 3 seconds </a>' >>
</span>
<<timed _time+'s'>>
<<replace "#QTE">>
Ah you missed it
<</replace>>
<</timed>>
It works in <<timed>>
but not in <a>
Is there a way to use the temp variable like this or just a generally easier way to create these links? I’m still new to HTML.