Actions

Template

Difference between revisions of "Animate"

From Sonic Retro

(wip)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div style="display:inline-block;">{{#if:{{{delay|}}}|{{#vardefine:delay|{{{delay|}}}}}}}{{#fornumargs: a
+
<includeonly><div style="display:inline-block; border:1px solid red; width:auto;">{{#vardefine:framecount|0}}{{#fornumargs:a||{{incvar|framecount}}}}{{#if:{{{delay|}}}|{{#vardefine:delay|{{#expr:{{{delay|}}}*{{#var:framecount}}}}}}|{{#vardefine:delay|{{#var:framecount}}}}}}{{#fornumargs: a
 
| frame
 
| frame
| <div style="animation-name:animate; animation-duration:{{#var:delay}}s; animation-iteration-count:infinite; posi<!-- -->tion:absolute;">{{#var:frame}}</div>
+
| <div style="animation-name:animate{{#var:framecount}}; animation-duration:{{#var:delay}}s; animation-iteration-count:infinite; animation-delay:{{#expr:({{#var:a}}-1)*{{#var:delay}}*(1/{{#var:framecount}})}}s; display:inline-block; width:0px; over<!-- -->flow:hidden; border:1px solid blue">{{#var:frame}}</div>
}}</div>
+
}}</div></includeonly><noinclude>
</includeonly><noinclude>
+
{{animate|this|is|animated|delay=0.5}}
{{animate|this|is|animated|delay=1}}
 
 
</noinclude>
 
</noinclude>

Revision as of 13:56, 21 April 2018

this
is
animated
this
is
animated