16 293
правки
(Новая страница: «=== Conditional expressions === Available operations: * <code>></code> — greater than * <code>>=</code> — greater than or equal to * <code><</code> — less than * <code><=</code> — less than or equal to!N !* <code>==</code> — equals * <code>!=</code> — not equal») |
(Новая страница: «=== Loading === # Create a new SVG panel following the instructions in the Creating an SVG panel. # In the svg panel editor, click the '''As JSON''' button, copy the link description from the saved file and paste the text into the field # Click the '''Save'' button '' at the bottom of the page.») |
||
Строка 261: | Строка 261: | ||
SVG panel elements can be animated using CSS. | SVG panel elements can be animated using CSS. | ||
To do this: | |||
#Draw an SVG panel in a vector editor like Inkscape. | |||
# | #Open the SVG file in a text editor and add a style block wrapped in tags<style></style> . | ||
# | #Add the '''@keyframes''' rule in the style block. | ||
# | #Save the file and load it into the controller. | ||
# | #Go to the SVG panel editor in the controller's web interface. | ||
# | #Activate the '''Style''' parameter and set the property '''animation''' in the '''Value''' field. You also need to set the condition under which the animation will work. | ||
# | |||
Rendering in CSS is done using the '''animation''' property and the '''@keyframes''' rule. | |||
'''@keyframes''', or keyframes, contain information about how the element should look at each point in time. | |||
'''@keyframes''', | |||
A rule containing two keyframes would look like this: | |||
<syntaxhighlight lang="css"> | |||
<syntaxhighlight lang="css"> | @keyframes <keyframe name> { | ||
@keyframes < | from: { description of the initial state of the element } | ||
from: { | to: { description of the final state of the element } | ||
to: { | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Here '''from''' and '''to''' keywords denote the start and end points of the animation. Instead, you can use 0% and 100%, as well as add intermediate values. | |||
The keyframe name is an identifier by which the rule will be called from the style description. | |||
In order for the animation to work, you need to set the element style to the '''animation''' property. | |||
<div lang="ru" dir="ltr" class="mw-content-ltr"> | <div lang="ru" dir="ltr" class="mw-content-ltr"> |