/
anim.mcss.json
160 lines (160 loc) · 3.73 KB
/
anim.mcss.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
{
"decls": [
["@keyframes", "fade-in", { "opacity": 0 }, { "opacity": 1 }],
["@keyframes", "fade-out", { "opacity": 1 }, { "opacity": 0 }],
["@keyframes", "spin", { "rotate": 0 }, { "rotate": "1turn" }],
[
"@keyframes",
"shrink",
{ "height": "var(--mcss-shrink-size)" },
{ "height": 0 }
]
],
"vars": {
"anim": ["animation"],
"transition": ["transition"]
},
"specs": [
{
"doc": {
"group": "animation / transition",
"desc": "direction"
},
"name": "anim-<v>",
"props": "animation-direction",
"values": ["normal", "reverse", "alternate", "alternate-reverse"]
},
{
"doc": { "group": "animation / transition" },
"name": "anim-<k>",
"props": "animation-play-state",
"values": { "pause": "paused", "play": "running" }
},
{
"doc": {
"group": "animation / transition",
"desc": "timing function"
},
"name": "<vid>-<v>",
"props": "<var>-timing-function",
"values": ["ease", "ease-in", "ease-out", "ease-in-out", "linear"],
"vars": ["anim", "transition"]
},
{
"doc": {
"group": "animation / transition",
"desc": "<v>"
},
"name": "transition-<k>",
"props": "transition-property",
"values": {
"all": "all",
"bg": "background-color",
"color": "color",
"none": "none",
"width": "width",
"height": "height"
}
}
],
"templates": [
{
"doc": {
"group": "animation / transition",
"args": ["duration: in seconds"],
"desc": "Animation to change opacity"
},
"name": "fade-<vid>",
"props": { "animation": "fade-<vid> {0}s ease-in-out forwards" },
"vars": ["in", "out"]
},
{
"doc": {
"group": "animation / transition",
"args": ["duration: in seconds"],
"desc": "Transition to tween background color"
},
"name": "bg-anim",
"props": { "transition": "{0}s background-color ease-in-out" }
},
{
"doc": {
"group": "animation / transition",
"args": ["duration: in seconds"],
"desc": "Animation which rotates element a full turn, looping indefinitely"
},
"name": "spin",
"props": { "animation": "spin {0}s linear infinite" }
},
{
"doc": {
"group": "animation / transition",
"args": [
"duration: in seconds",
"height: initial height (incl. units)"
],
"desc": "Animation which shrinks the height from given initial value to zero. Target element must NOT have padding (use a wrapper if necessary)."
},
"name": "shrink",
"props": {
"--mcss-shrink-size": "{1}",
"animation": "shrink {0}s ease-out forwards"
}
},
{
"doc": {
"group": "animation / transition",
"args": ["duration: time (in seconds)"]
},
"name": "<vid>-duration",
"props": "<var>-duration",
"unit": "second",
"vars": ["anim", "transition"]
},
{
"doc": {
"group": "animation / transition",
"args": ["delay: time (in seconds)"]
},
"name": "<vid>-delay",
"props": "<var>-delay",
"unit": "second",
"vars": ["anim", "transition"]
},
{
"doc": {
"group": "animation / transition",
"desc": "Sets <var>-timing-function to `steps(num)`",
"args": ["num: number of steps"]
},
"name": "<vid>-steps",
"props": { "<var>-timing-function": "steps({0})" },
"vars": ["anim", "transition"]
},
{
"doc": {
"group": "animation / transition",
"args": ["iter: number of iterations"]
},
"name": "anim-iter",
"props": "animation-iteration-count"
},
{
"doc": {
"group": "animation / transition",
"args": ["body: CSS value/definition"]
},
"name": "<vid>",
"props": "<var>",
"vars": ["anim", "transition"]
},
{
"doc": {
"group": "animation / transition",
"args": ["prop: CSS value/definition"]
},
"name": "transition-property",
"props": "transition-property"
}
]
}