Systema animatio provectum ad creandum animatios dynamicas, procedurales, et expressionum basatas ultra simplices keyframes.
Systema animatio plura genera sustinet ultra traditum keyframes:
Haec animatios provectae in proprietate animations array elementorum definuntur.
Animatios Nodi (animations array):
Keyframes (keyframes array):
Cum plura methoda animatios eandem proprietatem petunt:
| Proprietas | Typus | Requiritur | Exemplum | Ambitus Valoris | Descriptio |
|---|---|---|---|---|---|
| type | string | true | - | expression | procedural | sequence | path | Typus animatios. |
| enabled | boolean | false | - | - | Sive animatio activa sit. |
| target | string | true | - | - | Via proprietatis ad animandum (e.g., "x", "rotation", "scaleX"). |
| startTime | number | false | - | - | Tempus initii animatios relativum ad initium elementorum, in secundis. |
| duration | number | false | - | - | Duratio animatios in secundis. Pro animatios loopantibus, hoc est periodus loop. |
| loop | boolean | false | - | - | Sive animatio loopat. |
| blendMode | string | false | - | replace | add | multiply | Quomodo haec animatio cum aliis coniungitur: replace (substituere), add (summa), multiply (scalare). |
| blendWeight | number | false | - | - | Vis/impulsus huius animatios (0-1). Usus pro mixtione plurium animatios. |
Expressiones sunt codex JavaScript per frame evaluatus, cum accessu ad variabiles contextus animatios.
{
time: number; // Tempus absolutum currente (secundae)
localTime: number; // Tempus relativum ad initium elementorum
duration: number; // Duratio elementorum
progress: number; // Progressus normalizatus (0-1)
index: number; // Index elementorum in coetu
total: number; // Elementa totalia in coetu
fps: number; // Frames per secundam
width: number; // Lata canvas
height: number; // Altitudo canvas
value: any; // Valor proprietatis currentis
}Animatio bounciens utendo functionibus Math:
{
"id": "element-1",
"type": "Image",
"start": 0,
"duration": 5,
"animations": [
{
"type": "expression",
"target": "y",
"enabled": true,
"expression": "100 + Math.abs(Math.sin(localTime * 3)) * 200",
"startTime": 0,
"duration": 5,
"loop": true
}
]
}
Combinare plura effecta:
{
"animations": [
{
"type": "expression",
"target": "rotation",
"expression": "(localTime * 2 * Math.PI / duration) + Math.sin(localTime * 4) * 0.1",
"loop": true
},
{
"type": "expression",
"target": "scaleX",
"expression": "1 + Math.sin(localTime * 5) * 0.2",
"loop": true
}
]
}
Exemplaria animatios inclusa cum parametris configurabilibus.
{
"animations": [
{
"type": "procedural",
"proceduralType": "wiggle",
"target": "rotation",
"enabled": true,
"frequency": 2,
"amplitude": 0.1,
"loop": true
}
]
}
Animatios basatae in gradibus quae valores in specificis intervallis mutant.
| Proprietas | Typus | Requiritur | Exemplum | Ambitus Valoris | Descriptio |
|---|---|---|---|---|---|
| values | array | true | - | - | Array valorum ad percurrendum. |
| stepDuration | number | true | - | - | Duratio cuiusque gradus in secundis. |
| loop | boolean | false | - | - | Sive series loopat. |
Textus per diversas magnitudines circulans:
{
"animations": [
{
"type": "sequence",
"target": "fontSize",
"enabled": true,
"values": [24, 32, 40, 32, 24],
"stepDuration": 0.5,
"loop": true
}
]
}
Animare elementa per vias curvarum Bezier.
| Proprietas | Typus | Requiritur | Exemplum | Ambitus Valoris | Descriptio |
|---|---|---|---|---|---|
| path | string | array | true | - | - | Data via SVG (attributum d) aut array punctorum viae. |
| autoRotate | boolean | false | - | - | Sive automatice rotat elementa ad sequi tangentem viae. |
| duration | number | true | - | - | Tempus ad peragendam totam viam. |
Motus circularis:
{
"animations": [
{
"type": "path",
"target": "position",
"enabled": true,
"path": "M 100,100 a 200,200 0 1,1 0,1 Z",
"autoRotate": true,
"duration": 4,
"loop": true
}
]
}
Proprietas target utitur notatione puncti ad specificandas proprietates nidificatas:
"x", "y", "rotation""scale.x", "position.y""colors[0]", "points[2].x"{
"target": "x" // Positio x elementorum
"target": "scaleX" // Scalatio horizontalis
"target": "alpha" // Opacitas
"target": "fill.color" // Color implendi (si implens est obiectum)
"target": "points[0].x" // Coordinata x primi puncti
}Regere quomodo animatios coniungantur cum plura eandem proprietatem petunt:
{
"blendMode": "replace",
"blendWeight": 1.0
}Completum substituit valor proprietatis.
{
"blendMode": "add",
"blendWeight": 0.5
}Addit ad valor existente (ponderatum). Utilis ad accumulandum offsets.
{
"blendMode": "multiply",
"blendWeight": 1.0
}Multiplicat valorem existentem. Utilis ad effectus scaling.
Combinando diversa genera animatios:
{
"id": "animated-element",
"type": "Shape",
"animations": [
{
"type": "expression",
"target": "x",
"expression": "width / 2 + Math.sin(localTime * 2) * 300",
"blendMode": "replace",
"loop": true
},
{
"type": "procedural",
"proceduralType": "wiggle",
"target": "rotation",
"frequency": 3,
"amplitude": 0.2,
"blendMode": "add",
"blendWeight": 0.5
},
{
"type": "sequence",
"target": "alpha",
"values": [1, 0.8, 1],
"stepDuration": 0.3,
"loop": true,
"blendMode": "multiply"
}
],
"keyframes": [
{
"id": "kf-1",
"time": 0,
"stateObj": { "scaleX": 1 }
},
{
"id": "kf-2",
"time": 2,
"stateObj": { "scaleX": 1.5 }
}
]
}
In hoc exemplum:
startTime et duration sunt relativum ad tempus start elementorumlocalTime in expressionibus incipit a 0 cum elementa incipitduration generalem elementorumenabled: truetarget existit in elementostartTime intra durationem elementorum est{
"type": "expression",
"target": "x",
"expression": "value + (targetX - value) * 0.1"
}{
"type": "expression",
"target": "scaleY",
"expression": "1 + Math.exp(-localTime * 3) * Math.cos(localTime * 8) * 0.5"
}{
"type": "procedural",
"proceduralType": "wiggle",
"target": "x",
"frequency": 10,
"amplitude": 5
}{
"type": "expression",
"target": "alpha",
"expression": "Math.max(0, Math.min(1, (localTime - index * 0.1) * 2))"
}