Skip to content

Commit b5c492a

Browse files
committed
add draft for the next version loadin.css
1 parent df9018a commit b5c492a

165 files changed

Lines changed: 14741 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

viewer/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

viewer/animation/beat/index.css

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
@-moz-keyframes beat {
2+
0% {
3+
transform: scale(0.9);
4+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
5+
}
6+
33.333333333333336% {
7+
transform: scale(0.7);
8+
animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5);
9+
}
10+
66.66666666666667% {
11+
transform: scale(0.9);
12+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
13+
}
14+
83.33333333333334% {
15+
transform: scale(0.7);
16+
animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5);
17+
}
18+
100% {
19+
transform: scale(0.9);
20+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
21+
}
22+
}
23+
@-webkit-keyframes beat {
24+
0% {
25+
transform: scale(0.9);
26+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
27+
}
28+
33.333333333333336% {
29+
transform: scale(0.7);
30+
animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5);
31+
}
32+
66.66666666666667% {
33+
transform: scale(0.9);
34+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
35+
}
36+
83.33333333333334% {
37+
transform: scale(0.7);
38+
animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5);
39+
}
40+
100% {
41+
transform: scale(0.9);
42+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
43+
}
44+
}
45+
@-o-keyframes beat {
46+
0% {
47+
transform: scale(0.9);
48+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
49+
}
50+
33.333333333333336% {
51+
transform: scale(0.7);
52+
animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5);
53+
}
54+
66.66666666666667% {
55+
transform: scale(0.9);
56+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
57+
}
58+
83.33333333333334% {
59+
transform: scale(0.7);
60+
animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5);
61+
}
62+
100% {
63+
transform: scale(0.9);
64+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
65+
}
66+
}
67+
@keyframes beat {
68+
0% {
69+
transform: scale(0.9);
70+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
71+
}
72+
33.333333333333336% {
73+
transform: scale(0.7);
74+
animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5);
75+
}
76+
66.66666666666667% {
77+
transform: scale(0.9);
78+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
79+
}
80+
83.33333333333334% {
81+
transform: scale(0.7);
82+
animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5);
83+
}
84+
100% {
85+
transform: scale(0.9);
86+
animation-timing-function: cubic-bezier(0, 0.5, 0.5, 1);
87+
}
88+
}

viewer/animation/beat/index.styl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
//- jump
3+
rate = 0.3
4+
r = 0.6
5+
N = 3
6+
R = 100 * (r - 1) / (r ** (N + 1) - 1)
7+
D = -50px
8+
k = 1.1
9+
alpha = 1
10+
11+
//- bounce
12+
N = 1
13+
rate = .5
14+
r = .5
15+
R = 100 * (r - 1) / (r ** (N + 1) - 1)
16+
k = 0
17+
D = 0.7
18+
mD = 0.9
19+
alpha = 0.9
20+
21+
@keyframes beat
22+
0%
23+
transform: scale(mD)
24+
animation-timing-function: cubic-bezier(0,rate,1 - rate, 1)
25+
for num in (0..N)
26+
p = (r ** ( num + 1 ) - 1) / (r - 1)
27+
p2 = p - (r ** num) * 0.5
28+
d2 = D * ((r ** k) ** num)
29+
{R * 1% * p2 }
30+
transform: scale(d2)
31+
animation-timing-function: cubic-bezier(rate,0,1,1 - rate)
32+
{R * 1% * p}
33+
transform: scale(mD)
34+
animation-timing-function: cubic-bezier(0,rate,1 - rate, 1)
35+
36+
rate = 0.3
37+
offset = 50px
38+

viewer/animation/bounce/base.styl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//- module
2+
3+
bounce(name, dur, iterations, accelerate, decay, power, offset, func)
4+
R = 100 * (decay - 1) / (decay ** (iterations + 1) - 1)
5+
.{name}
6+
animation: unquote(name) dur linear infinite
7+
@keyframes {name}
8+
0%
9+
func(0,0)
10+
timing-speed-down(accelerate)
11+
for num in (0..iterations)
12+
p = (decay ** ( num + 1 ) - 1) / (decay - 1)
13+
p2 = p - (decay ** num) * 0.5
14+
d = offset * ((decay ** power) ** num)
15+
{R * 1% * p2 }
16+
func(d,num * 2 + 1)
17+
timing-speed-up(accelerate)
18+
{R * 1% * p}
19+
func(0,num * 2 + 2)
20+
timing-speed-down(accelerate)

viewer/animation/bounce/beat.js

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

viewer/animation/bounce/beat.ls

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
ret = do
3+
name: \beat
4+
desc: ''
5+
edit: do
6+
iterations: default: 1, type: \number, min: 0, max: 10
7+
accelerate: default: 0.4, type: \number, min: 0, max: 1, step: 0.1
8+
decay: default: 0.5, type: \number, min: 0, max: 1, step: 0.1
9+
power: default: 1.1, type: \number, min:0, max: 10, step: 0.1
10+
offset: default: 0.2, type: \number, min: 0, max: 1
11+
code: (config) ->
12+
"""
13+
bounce("ld-beat", config.dur, config.iterations, config.accelerate, config.decay, config.power, config.offset,@(v) { transform: scale(1 + config.offset - v) })
14+
"""
15+
16+
if module? => module.exports = ret

viewer/animation/bounce/bounce-alt.js

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ret = do
2+
name: \bounce-alt
3+
desc: ''
4+
edit: do
5+
iterations: default: 0, type: \number, min: 0, max: 10
6+
accelerate: default: 0.5, type: \number, min: 0, max: 1, step: 0.1
7+
decay: default: 0.5, type: \number, min: 0, max: 1, step: 0.1
8+
power: default: 0, type: \number, min:0, max: 10, step: 0.1
9+
offset: default: -14, type: \number, unit: \px, min: -100, max: 100
10+
code: (config) ->
11+
"""
12+
bounce("ld-bounce-alt", config.dur, config.iterations, config.accelerate, config.decay, config.power, config.offset,@(v) { transform: translate(0,v) })
13+
"""
14+
15+
if module? => module.exports = ret

viewer/animation/bounce/jump.js

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

viewer/animation/bounce/jump.ls

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
ret = do
3+
name: \jump
4+
desc: ''
5+
edit: do
6+
iterations: default: 5, type: \number, min: 0, max: 10
7+
accelerate: default: 0.4, type: \number, min: 0, max: 1, step: 0.1
8+
decay: default: 0.6, type: \number, min: 0, max: 1, step: 0.1
9+
power: default: 1.1, type: \number, min:0, max: 10, step: 0.1
10+
offset: default: -14, type: \number, unit: \px, min: -100, max: 100
11+
code: (config) ->
12+
"""
13+
bounce("ld-jump", config.dur, config.iterations, config.accelerate, config.decay, config.power, config.offset,@(v) { transform: translate(0,v) })
14+
"""
15+
16+
if module? => module.exports = ret

0 commit comments

Comments
 (0)