@rhtml/modifiers 0.0.109 → 0.0.110
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/README.md +26 -0
- package/dist/animation/animate.css.d.ts +1 -0
- package/dist/animation/animate.css.js +3364 -0
- package/dist/animation/animate.css.js.map +1 -0
- package/dist/animation/animation.d.ts +16 -0
- package/dist/animation/animation.js +55 -0
- package/dist/animation/animation.js.map +1 -0
- package/dist/animation/index.d.ts +3 -0
- package/dist/animation/index.js +16 -0
- package/dist/animation/index.js.map +1 -0
- package/dist/animation/interfaces.d.ts +1 -0
- package/dist/animation/interfaces.js +3 -0
- package/dist/animation/interfaces.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/animation/animate.css.ts +3360 -0
- package/src/animation/animation.ts +56 -0
- package/src/animation/index.ts +3 -0
- package/src/animation/interfaces.ts +79 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Attribute,
|
|
3
|
+
CustomAttributeRegistry,
|
|
4
|
+
Input,
|
|
5
|
+
Modifier
|
|
6
|
+
} from '@rhtml/custom-attributes';
|
|
7
|
+
|
|
8
|
+
import { Animations } from './animate.css';
|
|
9
|
+
import { AnimationsType } from './interfaces';
|
|
10
|
+
|
|
11
|
+
interface Styles {
|
|
12
|
+
animationDelay: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@Modifier({
|
|
16
|
+
selector: 'animated',
|
|
17
|
+
registry(this: HTMLElement) {
|
|
18
|
+
return new CustomAttributeRegistry(this);
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
export class Animation extends Attribute<Styles> {
|
|
22
|
+
@Input({ observe: true })
|
|
23
|
+
delay: string;
|
|
24
|
+
|
|
25
|
+
value: AnimationsType;
|
|
26
|
+
|
|
27
|
+
OnInit() {
|
|
28
|
+
this.pushStylesToParent();
|
|
29
|
+
this.modify();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
OnDestroy() {
|
|
33
|
+
this.element.classList.remove('animated', this.value);
|
|
34
|
+
this.setStyles({ animationDelay: null })(this.element);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
OnUpdate() {
|
|
38
|
+
this.modify();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
OnUpdateAttribute() {
|
|
42
|
+
this.modify();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
private modify() {
|
|
46
|
+
this.element.classList.add('animated', this.value);
|
|
47
|
+
this.setStyles({ animationDelay: this.delay })(this.element);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
private pushStylesToParent() {
|
|
51
|
+
const style = document.createElement('style');
|
|
52
|
+
style.innerHTML = Animations;
|
|
53
|
+
const root = this.parent.shadowRoot ?? this.parent;
|
|
54
|
+
root.prepend(style);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export type AnimationsType =
|
|
2
|
+
| 'slideOutDown'
|
|
3
|
+
| 'slideOutLeft'
|
|
4
|
+
| 'slideOutRight'
|
|
5
|
+
| 'slideOutUp'
|
|
6
|
+
| 'slideInUp'
|
|
7
|
+
| 'slideInRight'
|
|
8
|
+
| 'slideInLeft'
|
|
9
|
+
| 'slideInDown'
|
|
10
|
+
| 'zoomOutUp'
|
|
11
|
+
| 'zoomOutRight'
|
|
12
|
+
| 'zoomOutLeft'
|
|
13
|
+
| 'zoomOutDown'
|
|
14
|
+
| 'zoomOut'
|
|
15
|
+
| 'zoomInUp'
|
|
16
|
+
| 'zoomInRight'
|
|
17
|
+
| 'zoomInLeft'
|
|
18
|
+
| 'zoomInDown'
|
|
19
|
+
| 'zoomIn'
|
|
20
|
+
| 'rollOut'
|
|
21
|
+
| 'rollIn'
|
|
22
|
+
| 'jackInTheBox'
|
|
23
|
+
| 'hinge'
|
|
24
|
+
| 'rotateOutUpRight'
|
|
25
|
+
| 'rotateOutUpLeft'
|
|
26
|
+
| 'rotateOutDownRight'
|
|
27
|
+
| 'rotateOutDownLeft'
|
|
28
|
+
| 'rotateOut'
|
|
29
|
+
| 'rotateInUpRight'
|
|
30
|
+
| 'rotateInUpLeft'
|
|
31
|
+
| 'rotateInDownRight'
|
|
32
|
+
| 'rotateInDownLeft'
|
|
33
|
+
| 'rotateIn'
|
|
34
|
+
| 'lightSpeedOut'
|
|
35
|
+
| 'lightSpeedIn'
|
|
36
|
+
| 'flipOutY'
|
|
37
|
+
| 'flipOutX'
|
|
38
|
+
| 'flipInY'
|
|
39
|
+
| 'flipInX'
|
|
40
|
+
| 'flip'
|
|
41
|
+
| 'fadeOutUpBig'
|
|
42
|
+
| 'fadeOutUp'
|
|
43
|
+
| 'fadeOutRightBig'
|
|
44
|
+
| 'fadeOutRight'
|
|
45
|
+
| 'fadeOutLeftBig'
|
|
46
|
+
| 'fadeOutLeft'
|
|
47
|
+
| 'fadeOutDownBig'
|
|
48
|
+
| 'fadeOutDown'
|
|
49
|
+
| 'fadeOut'
|
|
50
|
+
| 'fadeInUpBig'
|
|
51
|
+
| 'fadeInUp'
|
|
52
|
+
| 'fadeInRightBig'
|
|
53
|
+
| 'fadeInRight'
|
|
54
|
+
| 'fadeInLeftBig'
|
|
55
|
+
| 'fadeInLeft'
|
|
56
|
+
| 'fadeInDownBig'
|
|
57
|
+
| 'fadeInDown'
|
|
58
|
+
| 'fadeIn'
|
|
59
|
+
| 'bounceOutUp'
|
|
60
|
+
| 'bounceOutRight'
|
|
61
|
+
| 'bounceOutLeft'
|
|
62
|
+
| 'bounceOutDown'
|
|
63
|
+
| 'bounceOut'
|
|
64
|
+
| 'bounceInUp'
|
|
65
|
+
| 'bounceInRight'
|
|
66
|
+
| 'bounceInLeft'
|
|
67
|
+
| 'bounceInDown'
|
|
68
|
+
| 'bounceIn'
|
|
69
|
+
| 'heartBeat'
|
|
70
|
+
| 'jello'
|
|
71
|
+
| 'wobble'
|
|
72
|
+
| 'tada'
|
|
73
|
+
| 'swing'
|
|
74
|
+
| 'headShake'
|
|
75
|
+
| 'shake'
|
|
76
|
+
| 'rubberBand'
|
|
77
|
+
| 'pulse'
|
|
78
|
+
| 'flash'
|
|
79
|
+
| 'bounce';
|
package/src/index.ts
CHANGED