@social-mail/social-mail-client 1.8.76 → 1.8.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/site-editor/editor/CssParser.d.ts.map +1 -1
- package/dist/site-editor/editor/CssParser.js +12 -2
- package/dist/site-editor/editor/CssParser.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/animations.d.ts +2 -0
- package/dist/site-editor/suggestions/properties/animations/animations.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/animations.js +20 -19
- package/dist/site-editor/suggestions/properties/animations/animations.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/blur/blur-in.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/blur/blur-in.js +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/blur/blur-in.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/blur/blur-out.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/blur/blur-out.js +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/blur/blur-out.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/bounce/bounce-in.d.ts +1 -4
- package/dist/site-editor/suggestions/properties/animations/key-frames/bounce/bounce-in.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/bounce/bounce-in.js +8 -5
- package/dist/site-editor/suggestions/properties/animations/key-frames/bounce/bounce-in.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/bounce/bounce-out.d.ts +2 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/bounce/bounce-out.d.ts.map +1 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/bounce/bounce-out.js +38 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/bounce/bounce-out.js.map +1 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/css.d.ts +33 -3
- package/dist/site-editor/suggestions/properties/animations/key-frames/css.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/css.js +63 -6
- package/dist/site-editor/suggestions/properties/animations/key-frames/css.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/fade/fade-in.d.ts +1 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/fade/fade-in.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/fade/fade-in.js +19 -3
- package/dist/site-editor/suggestions/properties/animations/key-frames/fade/fade-in.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/fade/fade-out.d.ts +1 -6
- package/dist/site-editor/suggestions/properties/animations/key-frames/fade/fade-out.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/fade/fade-out.js +19 -11
- package/dist/site-editor/suggestions/properties/animations/key-frames/fade/fade-out.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/rotate/rotate-in.d.ts +1 -6
- package/dist/site-editor/suggestions/properties/animations/key-frames/rotate/rotate-in.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/rotate/rotate-in.js +20 -11
- package/dist/site-editor/suggestions/properties/animations/key-frames/rotate/rotate-in.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/rotate/rotate-out.d.ts +1 -6
- package/dist/site-editor/suggestions/properties/animations/key-frames/rotate/rotate-out.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/rotate/rotate-out.js +20 -11
- package/dist/site-editor/suggestions/properties/animations/key-frames/rotate/rotate-out.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/scale/scale-in.d.ts +1 -6
- package/dist/site-editor/suggestions/properties/animations/key-frames/scale/scale-in.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/scale/scale-in.js +20 -11
- package/dist/site-editor/suggestions/properties/animations/key-frames/scale/scale-in.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/scale/scale-out.d.ts +1 -6
- package/dist/site-editor/suggestions/properties/animations/key-frames/scale/scale-out.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/scale/scale-out.js +20 -11
- package/dist/site-editor/suggestions/properties/animations/key-frames/scale/scale-out.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/slide/slide-in.d.ts +2 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/slide/slide-in.d.ts.map +1 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/slide/slide-in.js +28 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/slide/slide-in.js.map +1 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/slide/slide-out.d.ts +2 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/slide/slide-out.d.ts.map +1 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/slide/slide-out.js +28 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/slide/slide-out.js.map +1 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/speed/speed-in.d.ts +2 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/speed/speed-in.d.ts.map +1 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/speed/speed-in.js +33 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/speed/speed-in.js.map +1 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/speed/speed-out.d.ts +2 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/speed/speed-out.d.ts.map +1 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/speed/speed-out.js +28 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/speed/speed-out.js.map +1 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/zoom/zoom-in.d.ts +1 -6
- package/dist/site-editor/suggestions/properties/animations/key-frames/zoom/zoom-in.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/zoom/zoom-in.js +20 -11
- package/dist/site-editor/suggestions/properties/animations/key-frames/zoom/zoom-in.js.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/zoom/zoom-out.d.ts +1 -6
- package/dist/site-editor/suggestions/properties/animations/key-frames/zoom/zoom-out.d.ts.map +1 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/zoom/zoom-out.js +20 -11
- package/dist/site-editor/suggestions/properties/animations/key-frames/zoom/zoom-out.js.map +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.js +350 -146
- package/dist/site-editor-app/SiteEditorApp.pack.js.map +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.min.js +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.min.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/site-editor/editor/CssParser.ts +38 -1
- package/src/site-editor/suggestions/properties/animations/animations.ts +36 -30
- package/src/site-editor/suggestions/properties/animations/key-frames/blur/blur-in.ts +13 -12
- package/src/site-editor/suggestions/properties/animations/key-frames/blur/blur-out.ts +13 -12
- package/src/site-editor/suggestions/properties/animations/key-frames/bounce/bounce-in.ts +12 -28
- package/src/site-editor/suggestions/properties/animations/key-frames/bounce/bounce-out.ts +45 -0
- package/src/site-editor/suggestions/properties/animations/key-frames/css.ts +67 -22
- package/src/site-editor/suggestions/properties/animations/key-frames/fade/fade-in.ts +18 -1
- package/src/site-editor/suggestions/properties/animations/key-frames/fade/fade-out.ts +16 -11
- package/src/site-editor/suggestions/properties/animations/key-frames/rotate/rotate-in.ts +16 -11
- package/src/site-editor/suggestions/properties/animations/key-frames/rotate/rotate-out.ts +16 -11
- package/src/site-editor/suggestions/properties/animations/key-frames/scale/scale-in.ts +16 -11
- package/src/site-editor/suggestions/properties/animations/key-frames/scale/scale-out.ts +16 -11
- package/src/site-editor/suggestions/properties/animations/key-frames/slide/slide-in.ts +14 -0
- package/src/site-editor/suggestions/properties/animations/key-frames/slide/slide-out.ts +14 -0
- package/src/site-editor/suggestions/properties/animations/key-frames/speed/speed-in.ts +19 -0
- package/src/site-editor/suggestions/properties/animations/key-frames/speed/speed-out.ts +14 -0
- package/src/site-editor/suggestions/properties/animations/key-frames/zoom/zoom-in.ts +16 -11
- package/src/site-editor/suggestions/properties/animations/key-frames/zoom/zoom-out.ts +16 -11
- package/styler-lite/styler.css +1 -1
- package/styler-lite/styler.css.map +1 -1
- package/styler-lite/styles/animations/animations/generated.css +3200 -0
- package/styler-lite/styles/animations/animations/generated.css.js +91 -0
- package/styler-lite/styles/animations/animations/generated.css.map +1 -0
- package/styler-lite/styles/animations/animations/key-frames/blur/blur-in.js +17 -0
- package/styler-lite/styles/animations/animations/key-frames/blur/blur-out.js +17 -0
- package/styler-lite/styles/animations/animations/key-frames/bounce/bounce-in.js +43 -0
- package/styler-lite/styles/animations/animations/key-frames/bounce/bounce-out.js +43 -0
- package/styler-lite/styles/animations/animations/key-frames/css.js +119 -0
- package/styler-lite/styles/animations/animations/key-frames/fade/fade-in.js +16 -0
- package/styler-lite/styles/animations/animations/key-frames/fade/fade-out.js +16 -0
- package/styler-lite/styles/animations/animations/key-frames/rotate/rotate-in.js +16 -0
- package/styler-lite/styles/animations/animations/key-frames/rotate/rotate-out.js +16 -0
- package/styler-lite/styles/animations/animations/key-frames/scale/scale-in.js +16 -0
- package/styler-lite/styles/animations/animations/key-frames/scale/scale-out.js +16 -0
- package/styler-lite/styles/animations/animations/key-frames/slide/slide-in.js +14 -0
- package/styler-lite/styles/animations/animations/key-frames/slide/slide-out.js +14 -0
- package/styler-lite/styles/animations/animations/key-frames/speed/speed-in.js +19 -0
- package/styler-lite/styles/animations/animations/key-frames/speed/speed-out.js +14 -0
- package/styler-lite/styles/animations/animations/key-frames/zoom/zoom-in.js +16 -0
- package/styler-lite/styles/animations/animations/key-frames/zoom/zoom-out.js +16 -0
- package/dist/site-editor/suggestions/properties/animations/key-frames/cssTranslate.d.ts +0 -9
- package/dist/site-editor/suggestions/properties/animations/key-frames/cssTranslate.d.ts.map +0 -1
- package/dist/site-editor/suggestions/properties/animations/key-frames/cssTranslate.js +0 -45
- package/dist/site-editor/suggestions/properties/animations/key-frames/cssTranslate.js.map +0 -1
- package/src/site-editor/suggestions/properties/animations/key-frames/cssTranslate.ts +0 -84
- package/styler-lite/styles/animations/animations/fade-in.css +0 -0
- package/styler-lite/styles/animations/main-key-frames.css +0 -44
package/package.json
CHANGED
|
@@ -5,6 +5,32 @@ import { AtomBinder } from "@web-atoms/core/dist/core/AtomBinder";
|
|
|
5
5
|
import { UMD } from "@web-atoms/core/dist/core/types";
|
|
6
6
|
import { editorSuggestions } from "../suggestions/editorSuggestions";
|
|
7
7
|
|
|
8
|
+
const timelineAttributes = [
|
|
9
|
+
'styler-on-scroll',
|
|
10
|
+
'styler-on-scroll-effect-1',
|
|
11
|
+
'styler-on-scroll-effect-2',
|
|
12
|
+
'styler-on-scroll-above',
|
|
13
|
+
'styler-on-scroll-above-effect-1',
|
|
14
|
+
'styler-on-scroll-above-effect-2',
|
|
15
|
+
'styler-on-scroll-top-half',
|
|
16
|
+
'styler-on-scroll-top-half-effect-1',
|
|
17
|
+
'styler-on-scroll-top-half-effect-2',
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const keyFrameAttributes = [
|
|
21
|
+
'styler-on-enter',
|
|
22
|
+
'styler-on-enter-effect-1',
|
|
23
|
+
'styler-on-enter-effect-2',
|
|
24
|
+
'styler-on-hover',
|
|
25
|
+
'styler-on-hover-effect-1',
|
|
26
|
+
'styler-on-hover-effect-2',
|
|
27
|
+
'styler-on-leave',
|
|
28
|
+
'styler-on-leave-effect-1',
|
|
29
|
+
'styler-on-leave-effect-2',
|
|
30
|
+
... timelineAttributes
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
|
|
8
34
|
export default class CssParser {
|
|
9
35
|
|
|
10
36
|
static async parse(editor: HtmlPageEditor) {
|
|
@@ -52,7 +78,18 @@ export default class CssParser {
|
|
|
52
78
|
const cssRules = css.cssRules;
|
|
53
79
|
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
54
80
|
for (let i = 0; i < cssRules.length;i++) {
|
|
55
|
-
const
|
|
81
|
+
const r1 = cssRules[i] as CSSRule;
|
|
82
|
+
const kr = (r1 as CSSKeyframesRule).name;
|
|
83
|
+
|
|
84
|
+
if (kr) {
|
|
85
|
+
for (const a of keyFrameAttributes) {
|
|
86
|
+
this.parseRule(suggestions, a, kr);
|
|
87
|
+
}
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const rule = r1 as CSSStyleRule;
|
|
92
|
+
|
|
56
93
|
const match = /\[(styler\-[^=\]]+)=([^\]]+)\]/g.exec(rule.selectorText);
|
|
57
94
|
if (!match) {
|
|
58
95
|
continue;
|
|
@@ -1,39 +1,45 @@
|
|
|
1
1
|
import pair, { jsonPair } from "../../pair";
|
|
2
2
|
import { blurIns } from "./key-frames/blur/blur-in";
|
|
3
3
|
import { blurOuts } from "./key-frames/blur/blur-out";
|
|
4
|
-
import {
|
|
4
|
+
import { bounceIns } from "./key-frames/bounce/bounce-in";
|
|
5
|
+
import { bounceOuts } from "./key-frames/bounce/bounce-out";
|
|
5
6
|
import { IAnimation } from "./key-frames/css";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
...
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
...
|
|
34
|
-
|
|
7
|
+
import { fadeIns } from "./key-frames/fade/fade-in";
|
|
8
|
+
import { fadeOuts } from "./key-frames/fade/fade-out";
|
|
9
|
+
import { rotateIns } from "./key-frames/rotate/rotate-in";
|
|
10
|
+
import { rotateOuts } from "./key-frames/rotate/rotate-out";
|
|
11
|
+
import { scaleIns } from "./key-frames/scale/scale-in";
|
|
12
|
+
import { scaleOuts } from "./key-frames/scale/scale-out";
|
|
13
|
+
import { slideIns } from "./key-frames/slide/slide-in";
|
|
14
|
+
import { slideOuts } from "./key-frames/slide/slide-out";
|
|
15
|
+
import { zoomIns } from "./key-frames/zoom/zoom-in";
|
|
16
|
+
import { zoomOuts } from "./key-frames/zoom/zoom-out";
|
|
17
|
+
|
|
18
|
+
export const generatedAnimations = [
|
|
19
|
+
... blurIns,
|
|
20
|
+
... blurOuts,
|
|
21
|
+
|
|
22
|
+
... bounceIns,
|
|
23
|
+
... bounceOuts,
|
|
24
|
+
|
|
25
|
+
... fadeIns,
|
|
26
|
+
... fadeOuts,
|
|
27
|
+
|
|
28
|
+
... rotateIns,
|
|
29
|
+
... rotateOuts,
|
|
30
|
+
|
|
31
|
+
... scaleIns,
|
|
32
|
+
... scaleOuts,
|
|
33
|
+
|
|
34
|
+
... zoomIns,
|
|
35
|
+
... zoomOuts,
|
|
36
|
+
|
|
37
|
+
... slideIns,
|
|
38
|
+
... slideOuts
|
|
35
39
|
];
|
|
36
40
|
|
|
41
|
+
const animations = generatedAnimations.map((x) => pair(x.title, x.title));
|
|
42
|
+
|
|
37
43
|
export const animationSuggestions = {
|
|
38
44
|
"styler-on-enter": animations,
|
|
39
45
|
"styler-on-enter-effect-1": animations,
|
|
@@ -2,15 +2,16 @@ import { CSSBuilder } from "../css";
|
|
|
2
2
|
|
|
3
3
|
const { animation, keyFrame, backdropFilter, blur, opacity, transform, translate3d, px, move } = CSSBuilder;
|
|
4
4
|
|
|
5
|
-
export const blurIns = move("blur-in", (title, x, y, z) => animation(title,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
))
|
|
5
|
+
export const blurIns = move("blur-in", "from", (title, d, x, y, z) => animation(title,
|
|
6
|
+
keyFrame(0,
|
|
7
|
+
opacity(0),
|
|
8
|
+
d && translate3d(x, y, z),
|
|
9
|
+
backdropFilter(blur(px(10)))
|
|
10
|
+
),
|
|
11
|
+
keyFrame(100,
|
|
12
|
+
opacity(1),
|
|
13
|
+
d && translate3d(),
|
|
14
|
+
backdropFilter(blur(px(0)))
|
|
15
|
+
)
|
|
16
|
+
))
|
|
17
|
+
;
|
|
@@ -2,15 +2,16 @@ import { CSSBuilder } from "../css";
|
|
|
2
2
|
|
|
3
3
|
const { animation, keyFrame, backdropFilter, blur, opacity, transform, translate3d, px, move } = CSSBuilder;
|
|
4
4
|
|
|
5
|
-
export const blurOuts = move("blur-out", (title, x, y, z) => animation(title,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
))
|
|
5
|
+
export const blurOuts = move("blur-out", "to", (title, d, x, y, z) => animation(title,
|
|
6
|
+
keyFrame(0,
|
|
7
|
+
opacity(1),
|
|
8
|
+
d && translate3d(),
|
|
9
|
+
backdropFilter(blur(px(10)))
|
|
10
|
+
),
|
|
11
|
+
keyFrame(100,
|
|
12
|
+
opacity(0),
|
|
13
|
+
d && translate3d(x, y, z),
|
|
14
|
+
backdropFilter(blur(px(0)))
|
|
15
|
+
)
|
|
16
|
+
))
|
|
17
|
+
;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { CSSBuilder } from "../css";
|
|
2
2
|
|
|
3
|
-
const { animation, keyFrame, transitionTimingFunction, opacity,
|
|
3
|
+
const { move, animation, keyFrame, transitionTimingFunction, opacity, translate3d, perc, vh, vw, px } = CSSBuilder;
|
|
4
4
|
|
|
5
|
-
const bounce = (title: string, x = 0 as string | number, y = 0 as string | number, z = 0 as string | number) => {
|
|
5
|
+
const bounce = (title: string, direction?: string, x = 0 as string | number, y = 0 as string | number, z = 0 as string | number) => {
|
|
6
|
+
|
|
7
|
+
if (!direction) {
|
|
8
|
+
return void 0;
|
|
9
|
+
}
|
|
6
10
|
|
|
7
11
|
const mx = (typeof x === "string" ? parseInt(x, 10) : x) > 0 ? 1 : -1;
|
|
8
12
|
const my = (typeof y === "string" ? parseInt(y, 10) : y) > 0 ? 1 : -1;
|
|
@@ -20,42 +24,22 @@ const bounce = (title: string, x = 0 as string | number, y = 0 as string | numbe
|
|
|
20
24
|
),
|
|
21
25
|
keyFrame(0,
|
|
22
26
|
opacity(0),
|
|
23
|
-
|
|
27
|
+
translate3d(x, y, z)
|
|
24
28
|
),
|
|
25
29
|
keyFrame(60,
|
|
26
30
|
opacity(1),
|
|
27
|
-
|
|
31
|
+
translate3d(px(-25 * cx), px(-25 * cy), px(-25 * cz))
|
|
28
32
|
),
|
|
29
33
|
keyFrame(75,
|
|
30
|
-
|
|
34
|
+
translate3d(px(10 * cx), px(10 * cy), px(10 * cz))
|
|
31
35
|
),
|
|
32
36
|
keyFrame(90,
|
|
33
|
-
|
|
37
|
+
translate3d(px(-5 * cx), px(-5 * cy), px(-5 * cz))
|
|
34
38
|
),
|
|
35
39
|
keyFrame(100,
|
|
36
|
-
|
|
40
|
+
translate3d()
|
|
37
41
|
)
|
|
38
42
|
);
|
|
39
43
|
};
|
|
40
44
|
|
|
41
|
-
export const
|
|
42
|
-
bounce("bounce-from-left", perc(-100), 0, 0),
|
|
43
|
-
bounce("bounce-from-right", perc(100), 0, 0),
|
|
44
|
-
bounce("bounce-from-top", 0, perc(-100), 0),
|
|
45
|
-
bounce("bounce-from-bottom", 0, perc(100), 0),
|
|
46
|
-
|
|
47
|
-
bounce("bounce-from-far-left", vw(-100), 0, 0),
|
|
48
|
-
bounce("bounce-from-far-right", vw(100), 0, 0),
|
|
49
|
-
bounce("bounce-from-far-top", 0, vh(-100), 0),
|
|
50
|
-
bounce("bounce-from-far-bottom", 0, vh(100), 0),
|
|
51
|
-
|
|
52
|
-
bounce("bounce-from-top-left", perc(-100), perc(-100), 0),
|
|
53
|
-
bounce("bounce-from-top-right", perc(100), perc(-100), 0),
|
|
54
|
-
bounce("bounce-from-bottom-left", perc(-100), perc(100), 0),
|
|
55
|
-
bounce("bounce-from-bottom-right", perc(100), perc(100), 0),
|
|
56
|
-
|
|
57
|
-
bounce("bounce-from-far-top-left", vw(-100), vh(-100), 0),
|
|
58
|
-
bounce("bounce-from-far-top-right", vw(100), vh(-100), 0),
|
|
59
|
-
bounce("bounce-from-far-bottom-left", vw(-100), vh(100), 0),
|
|
60
|
-
bounce("bounce-from-far-bottom-right", vw(100), vh(100), 0),
|
|
61
|
-
];
|
|
45
|
+
export const bounceIns = move("bounce-in", "from", bounce);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CSSBuilder } from "../css";
|
|
2
|
+
|
|
3
|
+
const { move, animation, keyFrame, transitionTimingFunction, opacity, translate3d, perc, vh, vw, px } = CSSBuilder;
|
|
4
|
+
|
|
5
|
+
const bounce = (title: string, direction?: string, x = 0 as string | number, y = 0 as string | number, z = 0 as string | number) => {
|
|
6
|
+
|
|
7
|
+
if(!direction) {
|
|
8
|
+
return void 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const mx = (typeof x === "string" ? parseInt(x, 10) : x) > 0 ? 1 : -1;
|
|
12
|
+
const my = (typeof y === "string" ? parseInt(y, 10) : y) > 0 ? 1 : -1;
|
|
13
|
+
const mz = (typeof z === "string" ? parseInt(z, 10) : z) > 0 ? 1 : -1;
|
|
14
|
+
|
|
15
|
+
const cx = x ? mx : 0;
|
|
16
|
+
const cy = y ? my : 0;
|
|
17
|
+
const cz = z ? mz : 0;
|
|
18
|
+
|
|
19
|
+
return animation(
|
|
20
|
+
title,
|
|
21
|
+
keyFrame(
|
|
22
|
+
"0%, 100%, 60%, 75%, 90%",
|
|
23
|
+
transitionTimingFunction("cubic-bezier(0.215, .61, .355, 1)"),
|
|
24
|
+
),
|
|
25
|
+
keyFrame(0,
|
|
26
|
+
opacity(1),
|
|
27
|
+
translate3d()
|
|
28
|
+
),
|
|
29
|
+
keyFrame(60,
|
|
30
|
+
translate3d(px(-5 * cx), px(-5 * cy), px(-5 * cz))
|
|
31
|
+
),
|
|
32
|
+
keyFrame(75,
|
|
33
|
+
translate3d(px(10 * cx), px(10 * cy), px(10 * cz))
|
|
34
|
+
),
|
|
35
|
+
keyFrame(90,
|
|
36
|
+
translate3d(px(-25 * cx), px(-25 * cy), px(-25 * cz))
|
|
37
|
+
),
|
|
38
|
+
keyFrame(100,
|
|
39
|
+
opacity(0),
|
|
40
|
+
translate3d(x, y, z)
|
|
41
|
+
),
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const bounceOuts = move("bounce-out", "to", bounce);
|
|
@@ -9,11 +9,40 @@ const px = (n: number | string) => n === 0
|
|
|
9
9
|
? 0
|
|
10
10
|
: (typeof n === "string" ? n : `${n}px`);
|
|
11
11
|
|
|
12
|
+
const deg = (n: number | string) => typeof n === "string" ? n : `${n}deg`;
|
|
13
|
+
|
|
14
|
+
|
|
12
15
|
const translate3d = (x=0 as number | string, y=0 as number | string, z=0 as number | string) => (x || y || z)
|
|
13
|
-
? `translate3d(${px(x)}, ${px(y)}, ${px(z)})`
|
|
14
|
-
: "none";
|
|
16
|
+
? { translate: `${px(x)} ${px(y)} ${px(z)}`, toString: () => `translate3d(${px(x)}, ${px(y)}, ${px(z)})` }
|
|
17
|
+
: { translate: "none", toString: () => "none" };
|
|
18
|
+
|
|
19
|
+
const rotate = (n?) => n
|
|
20
|
+
? { rotate: deg(n), toString: () =>`rotate(${n})`}
|
|
21
|
+
: { rotate: "none", toString: () => `rotate(0deg)` };
|
|
22
|
+
|
|
23
|
+
const skew = (n?) => n
|
|
24
|
+
? { rotate: deg(n), toString: () =>`skew(${n})`}
|
|
25
|
+
: { rotate: "none", toString: () => `skew(0deg)` };
|
|
26
|
+
|
|
27
|
+
const skewX = (n?) => n
|
|
28
|
+
? { rotate: deg(n), toString: () =>`skewX(${n})`}
|
|
29
|
+
: { rotate: "none", toString: () => `skewX(0deg)` };
|
|
30
|
+
|
|
31
|
+
const skewY = (n?) => n
|
|
32
|
+
? { rotate: deg(n), toString: () =>`skewY(${n})`}
|
|
33
|
+
: { rotate: "none", toString: () => `skewY(0deg)` };
|
|
34
|
+
|
|
35
|
+
const skewZ = (n?) => n
|
|
36
|
+
? { rotate: deg(n), toString: () =>`skewZ(${n})`}
|
|
37
|
+
: { rotate: "none", toString: () => `skewZ(0deg)` };
|
|
38
|
+
|
|
39
|
+
const scale = (... x: any[]) => x.length
|
|
40
|
+
? { scale: `${x.join(" ")}`, toString: () => `scale(${x.join(",")})` }
|
|
41
|
+
: { scale: "none", toString: () => `scale(1)` };
|
|
15
42
|
|
|
16
|
-
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
const transform = (... n: any[]) => ({ transform: n.length ? n.join(" ") : "none"});
|
|
17
46
|
|
|
18
47
|
const transitionTimingFunction = (n: string) => ({ ["transition-timing-function"]: n });
|
|
19
48
|
|
|
@@ -29,6 +58,8 @@ export interface IProperties {
|
|
|
29
58
|
["backdrop-filter"]?: string;
|
|
30
59
|
opacity?: string;
|
|
31
60
|
scale?: string;
|
|
61
|
+
rotate?: string;
|
|
62
|
+
translate?: string;
|
|
32
63
|
}
|
|
33
64
|
|
|
34
65
|
export interface IKeyframe extends IProperties {
|
|
@@ -36,13 +67,15 @@ export interface IKeyframe extends IProperties {
|
|
|
36
67
|
}
|
|
37
68
|
|
|
38
69
|
const keyFrame = (offset: number | string, ... a: IProperties[]): IKeyframe => typeof offset === "string"
|
|
39
|
-
? { offset, ... Object.assign({}, ... a)}
|
|
70
|
+
? { offset, ... Object.assign({}, ... a.filter((x) => x))}
|
|
40
71
|
: {
|
|
41
72
|
offset: offset > 1 ? `${offset}%` : `${Math.floor(offset * 100)}%`,
|
|
42
|
-
... Object.assign({}, ... a)};
|
|
73
|
+
... Object.assign({}, ... a.filter((x) => x))};
|
|
43
74
|
|
|
44
75
|
const opacity = (n: number) => ({ opacity: `${n}` });
|
|
45
76
|
|
|
77
|
+
|
|
78
|
+
|
|
46
79
|
export interface IAnimation {
|
|
47
80
|
title: string,
|
|
48
81
|
keyframes: IKeyframe[];
|
|
@@ -51,28 +84,33 @@ export interface IAnimation {
|
|
|
51
84
|
const vh = (n) => `${n}vh`;
|
|
52
85
|
const vw = (n) => `${n}vw`;
|
|
53
86
|
|
|
54
|
-
const move = (title, fx: (t: string, x?: string | number, y?: string | number, z? : string | number) => IAnimation) => {
|
|
87
|
+
const move = (title, direction, fx: (t: string, d?: string, x?: string | number, y?: string | number, z? : string | number) => IAnimation) => {
|
|
88
|
+
|
|
89
|
+
const first = [fx(title)].filter((x) => x);
|
|
90
|
+
|
|
55
91
|
return [
|
|
56
92
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
fx(`${title}-
|
|
60
|
-
fx(`${title}-
|
|
93
|
+
... first,
|
|
94
|
+
|
|
95
|
+
fx(`${title}-${direction}-left`, direction, perc(-100)),
|
|
96
|
+
fx(`${title}-${direction}-right`, direction, perc(100)),
|
|
97
|
+
fx(`${title}-${direction}-top`, direction, 0, perc(-100)),
|
|
98
|
+
fx(`${title}-${direction}-bottom`, direction, perc(100)),
|
|
61
99
|
|
|
62
|
-
fx(`${title}-
|
|
63
|
-
fx(`${title}-
|
|
64
|
-
fx(`${title}-
|
|
65
|
-
fx(`${title}-
|
|
100
|
+
fx(`${title}-${direction}-far-left`, direction, vw(-100)),
|
|
101
|
+
fx(`${title}-${direction}-far-right`, direction, vw(100)),
|
|
102
|
+
fx(`${title}-${direction}-far-top`, direction, 0, vh(-100)),
|
|
103
|
+
fx(`${title}-${direction}-far-bottom`, direction, vh(100)),
|
|
66
104
|
|
|
67
|
-
fx(`${title}-
|
|
68
|
-
fx(`${title}-
|
|
69
|
-
fx(`${title}-
|
|
70
|
-
fx(`${title}-
|
|
105
|
+
fx(`${title}-${direction}-top-left`, direction, perc(-100), perc(-100)),
|
|
106
|
+
fx(`${title}-${direction}-top-right`, direction, perc(100), perc(-100)),
|
|
107
|
+
fx(`${title}-${direction}-bottom-left`, direction, perc(-100), perc(100)),
|
|
108
|
+
fx(`${title}-${direction}-bottom-right`, direction, perc(100), perc(100)),
|
|
71
109
|
|
|
72
|
-
fx(`${title}-
|
|
73
|
-
fx(`${title}-
|
|
74
|
-
fx(`${title}-
|
|
75
|
-
fx(`${title}-
|
|
110
|
+
fx(`${title}-${direction}-far-top-left`, direction, vw(-100), vh(-100)),
|
|
111
|
+
fx(`${title}-${direction}-far-top-right`, direction, vw(100), vh(-100)),
|
|
112
|
+
fx(`${title}-${direction}-far-bottom-left`, direction, vw(-100), vh(100)),
|
|
113
|
+
fx(`${title}-${direction}-far-bottom-right`, direction, vw(100), vh(100)),
|
|
76
114
|
|
|
77
115
|
];
|
|
78
116
|
};
|
|
@@ -89,6 +127,13 @@ export const CSSBuilder = {
|
|
|
89
127
|
transform,
|
|
90
128
|
keyFrame,
|
|
91
129
|
opacity,
|
|
130
|
+
rotate,
|
|
131
|
+
scale,
|
|
132
|
+
skew,
|
|
133
|
+
skewX,
|
|
134
|
+
skewY,
|
|
135
|
+
skewZ,
|
|
136
|
+
deg,
|
|
92
137
|
animation: (title: string, ... keyframes: IKeyframe[]) => ({
|
|
93
138
|
title,
|
|
94
139
|
keyframes
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { CSSBuilder } from "../css";
|
|
2
|
+
|
|
3
|
+
const { move, animation, keyFrame, transitionTimingFunction, opacity, transform, translate3d, perc, vh, vw, px } = CSSBuilder;
|
|
4
|
+
|
|
1
5
|
export const fadeIn = {
|
|
2
6
|
title: "fade-in",
|
|
3
7
|
keyFrames: [
|
|
@@ -8,4 +12,17 @@ export const fadeIn = {
|
|
|
8
12
|
opacity: 1
|
|
9
13
|
}
|
|
10
14
|
]
|
|
11
|
-
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const fadeIns = move("fade-in", "from", (title, direction, x, y, z) =>
|
|
18
|
+
animation(title,
|
|
19
|
+
keyFrame(0,
|
|
20
|
+
opacity(0.3),
|
|
21
|
+
direction && translate3d(x, y, z)
|
|
22
|
+
),
|
|
23
|
+
keyFrame(100,
|
|
24
|
+
opacity(1),
|
|
25
|
+
direction && translate3d()
|
|
26
|
+
)
|
|
27
|
+
)
|
|
28
|
+
);
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
opacity
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { CSSBuilder } from "../css";
|
|
2
|
+
|
|
3
|
+
const { move, animation, keyFrame, transitionTimingFunction, opacity, transform, translate3d, perc, vh, vw, px } = CSSBuilder;
|
|
4
|
+
|
|
5
|
+
export const fadeOuts = move("fade-out", "to", (title, direction, x, y, z) =>
|
|
6
|
+
animation(title,
|
|
7
|
+
keyFrame(0,
|
|
8
|
+
opacity(1),
|
|
9
|
+
direction && translate3d()
|
|
10
|
+
),
|
|
11
|
+
keyFrame(100,
|
|
12
|
+
opacity(0.3),
|
|
13
|
+
direction && translate3d(x, y, z)
|
|
14
|
+
)
|
|
15
|
+
)
|
|
16
|
+
);
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
rotate
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { CSSBuilder } from "../css";
|
|
2
|
+
|
|
3
|
+
const { move, animation, keyFrame, rotate, deg, opacity, transform, translate3d, perc, vh, vw, px } = CSSBuilder;
|
|
4
|
+
|
|
5
|
+
export const rotateIns = move("rotate-in", "from", (title, direction, x, y, z) =>
|
|
6
|
+
animation(title,
|
|
7
|
+
keyFrame(0,
|
|
8
|
+
rotate(deg(180)),
|
|
9
|
+
direction && translate3d(x, y, z)
|
|
10
|
+
),
|
|
11
|
+
keyFrame(100,
|
|
12
|
+
rotate(),
|
|
13
|
+
direction && translate3d(x, y, z)
|
|
14
|
+
)
|
|
15
|
+
)
|
|
16
|
+
);
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
rotate
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { CSSBuilder } from "../css";
|
|
2
|
+
|
|
3
|
+
const { move, animation, keyFrame, rotate, deg, opacity, transform, translate3d, perc, vh, vw, px } = CSSBuilder;
|
|
4
|
+
|
|
5
|
+
export const rotateOuts = move("rotate-out", "to", (title, direction, x, y, z) =>
|
|
6
|
+
animation(title,
|
|
7
|
+
keyFrame(0,
|
|
8
|
+
rotate(),
|
|
9
|
+
direction && transform()
|
|
10
|
+
),
|
|
11
|
+
keyFrame(100,
|
|
12
|
+
rotate(180),
|
|
13
|
+
direction && translate3d(x, y, z)
|
|
14
|
+
)
|
|
15
|
+
)
|
|
16
|
+
);
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
scale
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { CSSBuilder } from "../css";
|
|
2
|
+
|
|
3
|
+
const { move, animation, keyFrame, rotate, deg, scale, transform, translate3d, perc, vh, vw, px } = CSSBuilder;
|
|
4
|
+
|
|
5
|
+
export const scaleIns = move("scale-in", "from", (title, direction, x, y, z) =>
|
|
6
|
+
animation(title,
|
|
7
|
+
keyFrame(0,
|
|
8
|
+
scale(2),
|
|
9
|
+
direction && translate3d(x, y, z)
|
|
10
|
+
),
|
|
11
|
+
keyFrame(100,
|
|
12
|
+
scale(1),
|
|
13
|
+
direction && translate3d()
|
|
14
|
+
)
|
|
15
|
+
)
|
|
16
|
+
);
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
scale
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { CSSBuilder } from "../css";
|
|
2
|
+
|
|
3
|
+
const { move, animation, keyFrame, rotate, deg, scale, transform, translate3d, perc, vh, vw, px } = CSSBuilder;
|
|
4
|
+
|
|
5
|
+
export const scaleOuts = move("scale-out", "to", (title, direction, x, y, z) =>
|
|
6
|
+
animation(title,
|
|
7
|
+
keyFrame(0,
|
|
8
|
+
scale(1),
|
|
9
|
+
direction && transform()
|
|
10
|
+
),
|
|
11
|
+
keyFrame(100,
|
|
12
|
+
scale(2),
|
|
13
|
+
direction && translate3d(x, y, z)
|
|
14
|
+
),
|
|
15
|
+
)
|
|
16
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CSSBuilder } from "../css";
|
|
2
|
+
|
|
3
|
+
const { move, animation, keyFrame, rotate, deg, scale, transform, translate3d, perc, vh, vw, px } = CSSBuilder;
|
|
4
|
+
|
|
5
|
+
export const slideIns = move("slide-in", "from", (title, direction, x, y, z) =>
|
|
6
|
+
animation(title,
|
|
7
|
+
keyFrame(0,
|
|
8
|
+
direction && translate3d(x, y, z)
|
|
9
|
+
),
|
|
10
|
+
keyFrame(100,
|
|
11
|
+
direction && translate3d()
|
|
12
|
+
)
|
|
13
|
+
)
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CSSBuilder } from "../css";
|
|
2
|
+
|
|
3
|
+
const { move, animation, keyFrame, rotate, deg, scale, transform, translate3d, perc, vh, vw, px } = CSSBuilder;
|
|
4
|
+
|
|
5
|
+
export const slideOuts = move("slide-out", "to", (title, direction, x, y, z) =>
|
|
6
|
+
animation(title,
|
|
7
|
+
keyFrame(0,
|
|
8
|
+
direction && transform()
|
|
9
|
+
),
|
|
10
|
+
keyFrame(100,
|
|
11
|
+
direction && translate3d(x, y, z)
|
|
12
|
+
),
|
|
13
|
+
)
|
|
14
|
+
);
|