-
Notifications
You must be signed in to change notification settings - Fork 1
/
core.go
120 lines (114 loc) · 3.84 KB
/
core.go
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
package ua
import (
"github.com/axe/axe-go/pkg/ease"
"github.com/axe/axe-go/pkg/id"
"github.com/axe/axe-go/pkg/ui"
)
var (
DefaultDuration float32 = 1.0
DefaultSave = true
DefaultEasing = ease.Linear
Named = id.NewDenseKeyMap[ui.AnimationFactory, uint16, uint8](
id.WithStringMap(map[string]ui.AnimationFactory{
// animatecss
"bounce": Bounce,
"rubberband": RubberBand,
"flash": Flash,
"pulse": Pulse,
"shake": Shake,
"swing": Swing,
"tada": Tada,
"wobble": Wobble,
"fadein": FadeIn,
"fadeout": FadeOut,
"bounceindown": BounceInDown,
"bounceinleft": BounceInLeft,
"bounceinright": BounceInRight,
"bounceinup": BounceInUp,
"bouncein": BounceIn,
"bounceoutdown": BounceOutDown,
"bounceoutleft": BounceOutLeft,
"bounceoutright": BounceOutRight,
"bounceoutup": BounceOutUp,
"bounceout": BounceOut,
"fadeindown": FadeInDown,
"fadeindownbig": FadeInDownBig,
"fadeinleft": FadeInLeft,
"fadeinleftbig": FadeInLeftBig,
"fadeinright": FadeInRight,
"fadeinrightbig": FadeInRightBig,
"fadeinup": FadeInUp,
"fadeinupbig": FadeInUpBig,
"fadeoutdown": FadeOutDown,
"fadeoutdownbig": FadeOutDownBig,
"fadeoutleft": FadeOutLeft,
"fadeoutleftbig": FadeOutLeftBig,
"fadeoutright": FadeOutRight,
"fadeoutrightbig": FadeOutRightBig,
"fadeoutup": FadeOutUp,
"fadeoutupbig": FadeOutUpBig,
"rotatein": RotateIn,
"rotateindownleft": RotateInDownLeft,
"rotateindownright": RotateInDownRight,
"rotateinupleft": RotateInUpLeft,
"rotateinupright": RotateInUpRight,
"rotateout": RotateOut,
"rotateoutdownleft": RotateOutDownLeft,
"rotateoutdownright": RotateOutDownRight,
"rotateoutupleft": RotateOutUpLeft,
"rotateoutupright": RotateOutUpRight,
"hinge": Hinge,
"rollin": RollIn,
"rollout": RollOut,
"zoomin": ZoomIn,
"zoominleft": ZoomInLeft,
"zoominright": ZoomInRight,
"zoominup": ZoomInUp,
"zoomindown": ZoomInDown,
"zoomout": ZoomOut,
"zoomoutdown": ZoomOutDown,
"zoomoutleft": ZoomOutLeft,
"zoomoutright": ZoomOutRight,
"zoomoutup": ZoomOutUp,
"slideindown": SlideInDown,
"slideinleft": SlideInLeft,
"slideinright": SlideInRight,
"slideinup": SlideInUp,
"slideoutdown": SlideOutDown,
"slideoutleft": SlideOutLeft,
"slideoutright": SlideOutRight,
"slideoutup": SlideOutUp,
// anim8js
"wiggle": Wiggle,
// axe
"explode": Explode,
"revealdown": RevealDown,
"revealup": RevealUp,
"revealupdown": RevealUpDown,
"revealleft": RevealLeft,
"revealright": RevealRight,
"revealleftright": RevealLeftRight,
}),
)
Animations = ui.Animations{
Named: Named,
}
AnimationGen = func(frames []ui.BasicAnimationFrame) ui.BasicAnimation {
return ui.BasicAnimation{
Duration: DefaultDuration,
Save: DefaultSave,
Easing: DefaultEasing,
Frames: frames,
}
}
// Common
OriginTop = ui.NewAmountPointParent(0.5, 0)
OriginCenter = ui.NewAmountPointParent(0.5, 0.5)
OriginBottom = ui.NewAmountPointParent(0.5, 1.0)
OriginTopLeft = ui.NewAmountPointParent(0, 0)
OriginTopRight = ui.NewAmountPointParent(1, 0)
OriginCenterRight = ui.NewAmountPointParent(1, 0.5)
OriginBottomLeft = ui.NewAmountPointParent(0, 1)
OriginBottomRight = ui.NewAmountPointParent(1, 1)
OriginCenterLeft = ui.NewAmountPointParent(0, 0.5)
)