@vectoriox/iox-ui 4.0.2 → 4.0.3

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.
Files changed (133) hide show
  1. package/.github/workflows/publish-iox-ui.yml +68 -0
  2. package/.github/workflows/release-iox-ui.yml.disabled +77 -0
  3. package/angular.json +150 -0
  4. package/karma.conf.js +44 -0
  5. package/package.json +1 -1
  6. package/projects/iox-ui/.github/copilot-instructions.md +32 -0
  7. package/projects/iox-ui/.releaserc.json +42 -0
  8. package/projects/iox-ui/README.md +149 -0
  9. package/projects/iox-ui/karma.conf.js +44 -0
  10. package/projects/iox-ui/ng +0 -0
  11. package/projects/iox-ui/ng-package.json +12 -0
  12. package/projects/iox-ui/package-lock.json +93 -0
  13. package/projects/iox-ui/package.json +13 -0
  14. package/projects/iox-ui/src/lib/iox-aos/iox-aos-animations.ts +45 -0
  15. package/projects/iox-ui/src/lib/iox-aos/iox-aos-container.component.ts +46 -0
  16. package/projects/iox-ui/src/lib/iox-aos/iox-aos.directive.ts +133 -0
  17. package/projects/iox-ui/src/lib/iox-aos/iox-aos.module.ts +33 -0
  18. package/projects/iox-ui/src/lib/iox-aos/iox-aos.service.ts +21 -0
  19. package/projects/iox-ui/src/lib/iox-masonry/iox-masonry-item.directive.ts +24 -0
  20. package/projects/iox-ui/src/lib/iox-masonry/iox-masonry.component.spec.ts +25 -0
  21. package/projects/iox-ui/src/lib/iox-masonry/iox-masonry.component.ts +71 -0
  22. package/projects/iox-ui/src/lib/iox-masonry/iox-masonry.module.ts +15 -0
  23. package/projects/iox-ui/src/lib/iox-masonry/iox-masonry.service.spec.ts +16 -0
  24. package/projects/iox-ui/src/lib/iox-masonry/iox-masonry.service.ts +9 -0
  25. package/projects/iox-ui/src/lib/iox-page/iox-page.module.ts +13 -0
  26. package/projects/iox-ui/src/lib/iox-page/page-component/page-component.component.html +5 -0
  27. package/projects/iox-ui/src/lib/iox-page/page-component/page-component.component.scss +19 -0
  28. package/projects/iox-ui/src/lib/iox-page/page-component/page-component.component.ts +60 -0
  29. package/projects/iox-ui/src/lib/iox-ui.module.ts +11 -0
  30. package/projects/iox-ui/src/lib/services/page-scroll.provider.ts +45 -0
  31. package/projects/iox-ui/src/lib/view-position/view-position.directive.ts +98 -0
  32. package/projects/iox-ui/src/lib/view-position/view-position.module.ts +16 -0
  33. package/projects/iox-ui/src/public-api.ts +25 -0
  34. package/projects/iox-ui/src/test.ts +15 -0
  35. package/projects/iox-ui/tsconfig.lib.json +15 -0
  36. package/projects/iox-ui/tsconfig.lib.prod.json +10 -0
  37. package/projects/iox-ui/tsconfig.spec.json +17 -0
  38. package/src/app/app-routing.module.ts +15 -0
  39. package/src/app/app.component.html +17 -0
  40. package/src/app/app.component.scss +31 -0
  41. package/src/app/app.component.spec.ts +33 -0
  42. package/src/app/app.component.ts +21 -0
  43. package/src/app/app.module.ts +36 -0
  44. package/src/app/pages/aos/aos.component.html +35 -0
  45. package/src/app/pages/aos/aos.component.scss +49 -0
  46. package/src/app/pages/aos/aos.component.ts +30 -0
  47. package/src/app/pages/masonry/masonry.component.html +10 -0
  48. package/src/app/pages/masonry/masonry.component.scss +23 -0
  49. package/src/app/pages/masonry/masonry.component.ts +73 -0
  50. package/src/app/styles/abstracts/functions.scss +0 -0
  51. package/src/app/styles/abstracts/mixins.scss +0 -0
  52. package/src/app/styles/abstracts/variables.scss +5 -0
  53. package/src/app/styles/base/fonts/heebo-black/Heebo-Black.eot +0 -0
  54. package/src/app/styles/base/fonts/heebo-black/Heebo-Black.svg +1163 -0
  55. package/src/app/styles/base/fonts/heebo-black/Heebo-Black.ttf +0 -0
  56. package/src/app/styles/base/fonts/heebo-black/Heebo-Black.woff +0 -0
  57. package/src/app/styles/base/fonts/heebo-black/Heebo-Black.woff2 +0 -0
  58. package/src/app/styles/base/fonts/heebo-bold/Heebo-Bold.eot +0 -0
  59. package/src/app/styles/base/fonts/heebo-bold/Heebo-Bold.svg +1163 -0
  60. package/src/app/styles/base/fonts/heebo-bold/Heebo-Bold.ttf +0 -0
  61. package/src/app/styles/base/fonts/heebo-bold/Heebo-Bold.woff +0 -0
  62. package/src/app/styles/base/fonts/heebo-bold/Heebo-Bold.woff2 +0 -0
  63. package/src/app/styles/base/fonts/heebo-extrabold/Heebo-ExtraBold.eot +0 -0
  64. package/src/app/styles/base/fonts/heebo-extrabold/Heebo-ExtraBold.svg +1152 -0
  65. package/src/app/styles/base/fonts/heebo-extrabold/Heebo-ExtraBold.ttf +0 -0
  66. package/src/app/styles/base/fonts/heebo-extrabold/Heebo-ExtraBold.woff +0 -0
  67. package/src/app/styles/base/fonts/heebo-extrabold/Heebo-ExtraBold.woff2 +0 -0
  68. package/src/app/styles/base/fonts/heebo-extralight/Heebo-ExtraLight.eot +0 -0
  69. package/src/app/styles/base/fonts/heebo-extralight/Heebo-ExtraLight.svg +1152 -0
  70. package/src/app/styles/base/fonts/heebo-extralight/Heebo-ExtraLight.ttf +0 -0
  71. package/src/app/styles/base/fonts/heebo-extralight/Heebo-ExtraLight.woff +0 -0
  72. package/src/app/styles/base/fonts/heebo-extralight/Heebo-ExtraLight.woff2 +0 -0
  73. package/src/app/styles/base/fonts/heebo-light/Heebo-Light.eot +0 -0
  74. package/src/app/styles/base/fonts/heebo-light/Heebo-Light.svg +1151 -0
  75. package/src/app/styles/base/fonts/heebo-light/Heebo-Light.ttf +0 -0
  76. package/src/app/styles/base/fonts/heebo-light/Heebo-Light.woff +0 -0
  77. package/src/app/styles/base/fonts/heebo-light/Heebo-Light.woff2 +0 -0
  78. package/src/app/styles/base/fonts/heebo-medium/Heebo-Medium.eot +0 -0
  79. package/src/app/styles/base/fonts/heebo-medium/Heebo-Medium.svg +1158 -0
  80. package/src/app/styles/base/fonts/heebo-medium/Heebo-Medium.ttf +0 -0
  81. package/src/app/styles/base/fonts/heebo-medium/Heebo-Medium.woff +0 -0
  82. package/src/app/styles/base/fonts/heebo-medium/Heebo-Medium.woff2 +0 -0
  83. package/src/app/styles/base/fonts/heebo-regular/Heebo-Regular.eot +0 -0
  84. package/src/app/styles/base/fonts/heebo-regular/Heebo-Regular.svg +1150 -0
  85. package/src/app/styles/base/fonts/heebo-regular/Heebo-Regular.ttf +0 -0
  86. package/src/app/styles/base/fonts/heebo-regular/Heebo-Regular.woff +0 -0
  87. package/src/app/styles/base/fonts/heebo-regular/Heebo-Regular.woff2 +0 -0
  88. package/src/app/styles/base/fonts/heebo-semibold/Heebo-SemiBold.eot +0 -0
  89. package/src/app/styles/base/fonts/heebo-semibold/Heebo-SemiBold.svg +1155 -0
  90. package/src/app/styles/base/fonts/heebo-semibold/Heebo-SemiBold.ttf +0 -0
  91. package/src/app/styles/base/fonts/heebo-semibold/Heebo-SemiBold.woff +0 -0
  92. package/src/app/styles/base/fonts/heebo-semibold/Heebo-SemiBold.woff2 +0 -0
  93. package/src/app/styles/base/fonts/heebo-thin/Heebo-Thin.eot +0 -0
  94. package/src/app/styles/base/fonts/heebo-thin/Heebo-Thin.svg +1143 -0
  95. package/src/app/styles/base/fonts/heebo-thin/Heebo-Thin.ttf +0 -0
  96. package/src/app/styles/base/fonts/heebo-thin/Heebo-Thin.woff +0 -0
  97. package/src/app/styles/base/fonts/heebo-thin/Heebo-Thin.woff2 +0 -0
  98. package/src/app/styles/base/fonts/iox.eot +0 -0
  99. package/src/app/styles/base/fonts/iox.svg +35 -0
  100. package/src/app/styles/base/fonts/iox.ttf +0 -0
  101. package/src/app/styles/base/fonts/iox.woff +0 -0
  102. package/src/app/styles/base/iox-font.scss +102 -0
  103. package/src/app/styles/base/reset.scss +0 -0
  104. package/src/app/styles/base/typography.scss +104 -0
  105. package/src/app/styles/layout/flex.scss +183 -0
  106. package/src/app/styles/layout/grid.scss +0 -0
  107. package/src/app/styles/main.scss +17 -0
  108. package/src/assets/.gitkeep +0 -0
  109. package/src/assets/images/1.jfif +0 -0
  110. package/src/assets/images/2.jfif +0 -0
  111. package/src/assets/images/3.jfif +0 -0
  112. package/src/assets/images/4.png +0 -0
  113. package/src/assets/images/5.jfif +0 -0
  114. package/src/assets/images/6.jfif +0 -0
  115. package/src/assets/images/7.jfif +0 -0
  116. package/src/assets/images/8.jfif +0 -0
  117. package/src/assets/images/9.jfif +0 -0
  118. package/src/environments/environment.prod.ts +3 -0
  119. package/src/environments/environment.ts +16 -0
  120. package/src/favicon.ico +0 -0
  121. package/src/index.html +13 -0
  122. package/src/main.ts +12 -0
  123. package/src/polyfills.ts +53 -0
  124. package/src/styles.scss +15 -0
  125. package/src/test.ts +14 -0
  126. package/temp/unused-iox-projects/README.md +10 -0
  127. package/temp/unused-iox-projects/iox-aos-KEEP.md +1 -0
  128. package/temp/unused-iox-projects/iox-aos_KEEP.md +5 -0
  129. package/temp/unused-iox-projects/iox-masonry-KEEP.md +1 -0
  130. package/temp/unused-iox-projects/iox-masonry_KEEP.md +5 -0
  131. package/tsconfig.app.json +15 -0
  132. package/tsconfig.json +54 -0
  133. package/tsconfig.spec.json +18 -0
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "@iox-dev/iox-ui",
3
+ "version": "1.0.9",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "@iox-dev/iox-ui",
9
+ "version": "1.0.9",
10
+ "dependencies": {
11
+ "@fristys/masonry": "^1.1.7",
12
+ "tslib": "^2.3.0"
13
+ },
14
+ "peerDependencies": {
15
+ "@angular/animations": "^17.0.0",
16
+ "@angular/common": "^17.0.0",
17
+ "@angular/core": "^17.0.0"
18
+ }
19
+ },
20
+ "node_modules/@angular/animations": {
21
+ "version": "17.3.11",
22
+ "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-17.3.11.tgz",
23
+ "integrity": "sha512-1y1Egag5jbdUSUWVK+KA39N9VFDrzq9ObjbAhrXFlXKa0npBRw5bprEEeLFQMETMP9Mpjbmj2PoASfl4vqj/Iw==",
24
+ "peer": true,
25
+ "dependencies": {
26
+ "tslib": "^2.3.0"
27
+ },
28
+ "engines": {
29
+ "node": "^18.13.0 || >=20.9.0"
30
+ },
31
+ "peerDependencies": {
32
+ "@angular/core": "17.3.11"
33
+ }
34
+ },
35
+ "node_modules/@angular/common": {
36
+ "version": "17.3.11",
37
+ "resolved": "https://registry.npmjs.org/@angular/common/-/common-17.3.11.tgz",
38
+ "integrity": "sha512-WG+HQjUaQziYLGdbcv2aW+G73uroN5VF9yk4qWYcolW+VB8SV/DOAol8uFVgCF21cIOl5+wfJZvA4r5oG3dYaw==",
39
+ "peer": true,
40
+ "dependencies": {
41
+ "tslib": "^2.3.0"
42
+ },
43
+ "engines": {
44
+ "node": "^18.13.0 || >=20.9.0"
45
+ },
46
+ "peerDependencies": {
47
+ "@angular/core": "17.3.11",
48
+ "rxjs": "^6.5.3 || ^7.4.0"
49
+ }
50
+ },
51
+ "node_modules/@angular/core": {
52
+ "version": "17.3.11",
53
+ "resolved": "https://registry.npmjs.org/@angular/core/-/core-17.3.11.tgz",
54
+ "integrity": "sha512-2wPZwXFei3kVxK2ylIH6CdGebrC4kvooFx7qoX+250OITAEFMODJGdh/e3x0DpFUjlRvQtIFQ+YpQlfC5JnL4g==",
55
+ "peer": true,
56
+ "dependencies": {
57
+ "tslib": "^2.3.0"
58
+ },
59
+ "engines": {
60
+ "node": "^18.13.0 || >=20.9.0"
61
+ },
62
+ "peerDependencies": {
63
+ "rxjs": "^6.5.3 || ^7.4.0",
64
+ "zone.js": "~0.14.0"
65
+ }
66
+ },
67
+ "node_modules/@fristys/masonry": {
68
+ "version": "1.1.7",
69
+ "resolved": "https://registry.npmjs.org/@fristys/masonry/-/masonry-1.1.7.tgz",
70
+ "integrity": "sha512-b/CohDq3E/NOXIlBa+b64ObmZvtjofPMLThBjDLa5gp/NCwDD6b8GoXTmMAoCwibZvIsXsgvk5JgIpE5QJg9mA=="
71
+ },
72
+ "node_modules/rxjs": {
73
+ "version": "7.8.1",
74
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
75
+ "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
76
+ "peer": true,
77
+ "dependencies": {
78
+ "tslib": "^2.1.0"
79
+ }
80
+ },
81
+ "node_modules/tslib": {
82
+ "version": "2.6.3",
83
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz",
84
+ "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ=="
85
+ },
86
+ "node_modules/zone.js": {
87
+ "version": "0.14.7",
88
+ "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.14.7.tgz",
89
+ "integrity": "sha512-0w6DGkX2BPuiK/NLf+4A8FLE43QwBfuqz2dVgi/40Rj1WmqUskCqj329O/pwrqFJLG5X8wkeG2RhIAro441xtg==",
90
+ "peer": true
91
+ }
92
+ }
93
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@vectoriox/iox-ui",
3
+ "version": "4.0.3",
4
+ "peerDependencies": {
5
+ "@angular/common": "^20.0.0",
6
+ "@angular/core": "^20.0.0",
7
+ "@angular/animations": "^20.0.0"
8
+ },
9
+ "dependencies": {
10
+ "tslib": "^2.3.0",
11
+ "@fristys/masonry": "^1.1.7"
12
+ }
13
+ }
@@ -0,0 +1,45 @@
1
+ import { AnimationBuilder, style, animate, keyframes } from '@angular/animations';
2
+
3
+ /********** Entries Animations ********************/
4
+
5
+ export const IoxAnimationStyles: any = {}
6
+
7
+ IoxAnimationStyles["fade-up"] = (delay:string, duration:string)=>{
8
+ return [style({ opacity: 0, transform: "translate3d(0,100px,0)"}),
9
+ animate(`${duration} ${delay} cubic-bezier(0.445, 0.05, 0.55, 0.95)`, style({ opacity: 1, transform: "translateZ(0)" }))]
10
+ }
11
+
12
+ IoxAnimationStyles["fade-right"] = (delay:string, duration:string)=>{
13
+ return [style({ opacity: 0, transform: "translateX(150px)"}),
14
+ animate(`${duration} ${delay} cubic-bezier(0.445, 0.05, 0.55, 0.95)`, style({ opacity: 1, transform: "translateZ(0)" }))]
15
+ }
16
+
17
+ IoxAnimationStyles["fade-out-right"] = (delay:string, duration:string)=>{
18
+ return [style({ opacity: 1, transform: "translateX(0px)"}),
19
+ animate(`${duration} ${delay} cubic-bezier(0.445, 0.05, 0.55, 0.95)`, style({ opacity: 0, transform: "translateX(150px)" }))]
20
+ }
21
+
22
+ IoxAnimationStyles["fade-left"] = (delay:string, duration:string)=>{
23
+ return [style({ opacity: 0, transform: "translateX(-150px)"}),
24
+ animate(`${duration} ${delay} cubic-bezier(0.445, 0.05, 0.55, 0.95)`, style({ opacity: 1, transform: "translateZ(0)" }))]
25
+ }
26
+
27
+ IoxAnimationStyles["fade-out-up"] = (delay:string, duration:string)=>{
28
+ return [ style({ opacity: 1, transform: "translateZ(0)" }),
29
+ animate(`${duration} ${delay} cubic-bezier(0.445, 0.05, 0.55, 0.95)`, style({ opacity: 0, transform: "translate3d(0,-100px,0)"}))]
30
+ }
31
+
32
+ IoxAnimationStyles["flip-left"] = (delay:string, duration:string)=>{
33
+ return [style({opacity: 0,transform: "perspective(2500px) rotateY(-100deg)"}),
34
+ animate(`${duration} ${delay} cubic-bezier(0.445, 0.05, 0.55, 0.95)`, style({ opacity: 1, transform: "perspective(2500px) rotateY(0)" }))]
35
+ }
36
+
37
+ IoxAnimationStyles["flip-up"] = (delay:string, duration:string)=>{
38
+ return [style({opacity: 0,transform: "perspective(2500px) rotateX(-100deg)"}),
39
+ animate(`${duration} ${delay} cubic-bezier(0.445, 0.05, 0.55, 0.95)`, style({ opacity: 1, transform: "perspective(2500px) rotateY(0)" }))]
40
+ }
41
+
42
+ IoxAnimationStyles["zoom-in-up"] = (delay:string, duration:string)=>{
43
+ return [style({opacity: 0,transform: "translate3d(0,100px,0) scale(.6)"}),
44
+ animate(`${duration} ${delay} cubic-bezier(0.445, 0.05, 0.55, 0.95)`, style({ opacity: 1, transform: "translateZ(0) scale(1)" }))]
45
+ }
@@ -0,0 +1,46 @@
1
+ import { Component, ElementRef, HostListener, Input, SimpleChanges, ViewChild } from '@angular/core';
2
+ import { Observable, Subject } from 'rxjs';
3
+ import { AOSService } from './iox-aos.service';
4
+
5
+ @Component({
6
+ selector: "[ioxAnimateContainer], ioxAnimateContainer",
7
+ template:`<div class='animate_root_element' #animateRooteElement>
8
+ <ng-content></ng-content>
9
+ </div>`,
10
+ standalone: false
11
+ })
12
+ export class IoxAnimateContainer {
13
+
14
+ @Input('kickIn') kickIn = true;
15
+
16
+ private _scrollOffset:Subject<any> = new Subject();
17
+ public readonly scrollOffset: Observable<any> = this._scrollOffset.asObservable();
18
+ @ViewChild('animateRooteElement') public animateRooteElement:any;
19
+
20
+
21
+ constructor(private _element: ElementRef, private _aOSService: AOSService) {
22
+ }
23
+
24
+ ngAfterViewInit(){
25
+ this.updateOffset();
26
+ }
27
+
28
+ @HostListener('scroll', ['$event'])
29
+ public onScroll($event:any){
30
+ this.updateOffset();
31
+ }
32
+
33
+ ngOnChanges(changes: SimpleChanges) {
34
+ console.log(changes);
35
+ if(changes['kickIn'] && changes['kickIn'].currentValue){
36
+ this.updateOffset();
37
+ }
38
+ }
39
+
40
+
41
+ private updateOffset(){
42
+ let elClientRect = this.animateRooteElement.nativeElement.getBoundingClientRect();
43
+ this._scrollOffset.next(elClientRect);
44
+ this._aOSService.updateScrollOffset(elClientRect);
45
+ }
46
+ }
@@ -0,0 +1,133 @@
1
+ import { Directive, OnDestroy, AfterViewInit, ElementRef, Input, OnInit, Renderer2, HostListener, Host, Optional } from "@angular/core";
2
+ import { AnimationBuilder, style, animate, AnimationPlayer } from '@angular/animations';
3
+ import { IoxAnimationStyles } from "./iox-aos-animations"
4
+ ;
5
+ import { IoxAnimateContainer } from "./iox-aos-container.component";
6
+ @Directive({
7
+ selector: "[ioxAnimate], ioxAnimate",
8
+ standalone: false
9
+ })
10
+ export class IoxAosDirective implements OnDestroy, OnInit, AfterViewInit {
11
+
12
+ @Input("animationDelay") animationDelay: string ="";
13
+ @Input("animationIn") animationIn: string ="";
14
+ @Input("animationOut") animationOut: string = "";
15
+ @Input("animationDuration") animationDuration: string = "0.5s";
16
+
17
+ // @Input("in")
18
+ // @Input("out")
19
+
20
+ public animation:AnimationPlayer | any;
21
+ public isAnimationPlayed= false;
22
+ private _elTop:number =0;
23
+
24
+
25
+ constructor(@Host() @Optional() private _animateContainer: IoxAnimateContainer, private _element: ElementRef, private _animationBuilder:AnimationBuilder, private _renderer: Renderer2){
26
+
27
+ this._renderer.setStyle(_element.nativeElement,'opacity', '0');
28
+ }
29
+
30
+ public ngOnInit(){
31
+ }
32
+
33
+ public ngAfterViewInit(){
34
+
35
+ setTimeout(()=>{
36
+
37
+ this._elTop = this._cumulativeOffset(this._element.nativeElement).top;
38
+
39
+ if(this._animateContainer){
40
+ if(this._animateContainer.kickIn){
41
+ this.runIfVisiable();
42
+ }else{
43
+ return
44
+ }
45
+ }else{
46
+ this.runIfVisiable();
47
+ }
48
+
49
+
50
+
51
+ },150)
52
+
53
+ const resizeObserver = new ResizeObserver((entries) =>
54
+ this._elTop = this._cumulativeOffset(this._element.nativeElement).top
55
+ );
56
+
57
+ resizeObserver.observe(document.body);
58
+
59
+ if(this._animateContainer){
60
+ this._animateContainer?.scrollOffset.subscribe((offset:any)=>{
61
+ if(this._animateContainer.kickIn){
62
+ this.scrollEventHandler(-1 *offset.top);
63
+ }
64
+ })
65
+ }
66
+
67
+
68
+ }
69
+
70
+ public makeAnimationIn(animationStyle:any):AnimationPlayer{
71
+ let animation = IoxAnimationStyles[animationStyle](this.animationDelay, this.animationDuration);
72
+ const myAnimation = this._animationBuilder.build(animation)
73
+ return myAnimation.create(this._element.nativeElement);
74
+
75
+ }
76
+
77
+ private _cumulativeOffset(element:any) {
78
+ var top = 0, left = 0;
79
+ do {
80
+ top += element.offsetTop || 0;
81
+ left += element.offsetLeft || 0;
82
+ element = element.offsetParent;
83
+ } while(element);
84
+
85
+ return {
86
+ top: top,
87
+ left: left
88
+ };
89
+ };
90
+
91
+ @HostListener('document:scroll', ['$event']) onScrollEvent($event:any){
92
+ this.scrollEventHandler(window.pageYOffset)
93
+ }
94
+
95
+ public isVisable(offset:number){
96
+ //console.log(this._elTop >= window.pageYOffset && this._elTop <= window.pageYOffset + window.innerHeight);
97
+ //return this._elTop >= window.pageYOffset && this._elTop <= window.pageYOffset + window.innerHeight;
98
+ return this._elTop >= offset && this._elTop <= offset + window.innerHeight;
99
+ }
100
+
101
+
102
+ public scrollEventHandler(offset:number){
103
+
104
+ if(this._animateContainer && this._animateContainer.kickIn == false){
105
+ return
106
+ }
107
+
108
+ if(this.isVisable(offset) && !this.isAnimationPlayed){
109
+ let animationStyle = this.animationIn || "fade-up";
110
+ this.makeAnimationIn(animationStyle).play();
111
+ this.isAnimationPlayed = true;
112
+ }else if(!this.isVisable(offset) && this.isAnimationPlayed && this.animationOut){
113
+ this.makeAnimationIn(this.animationOut).play();
114
+ this.isAnimationPlayed =false;
115
+ }
116
+ }
117
+
118
+ public runIfVisiable(){
119
+ if(this.isVisable(window.pageYOffset)){
120
+ let animationStyle = this.animationIn || "fade-up";
121
+ this.makeAnimationIn(animationStyle).play();
122
+ this.isAnimationPlayed = true;
123
+ }
124
+ }
125
+ public ngOnDestroy(){
126
+
127
+ }
128
+
129
+ }
130
+
131
+ function ViewParent() {
132
+ throw new Error("Function not implemented.");
133
+ }
@@ -0,0 +1,33 @@
1
+ import { ModuleWithProviders, NgModule } from '@angular/core';
2
+ import { IoxAosDirective } from './iox-aos.directive';
3
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
4
+ import { IoxAnimateContainer } from './iox-aos-container.component';
5
+ import { AOSService } from './iox-aos.service';
6
+
7
+
8
+ @NgModule({
9
+ declarations: [
10
+ IoxAosDirective,
11
+ IoxAnimateContainer
12
+ ],
13
+ imports: [
14
+ BrowserAnimationsModule
15
+ ],
16
+ providers:[
17
+ AOSService
18
+ ],
19
+ exports: [
20
+ IoxAosDirective,
21
+ IoxAnimateContainer
22
+ ]
23
+ })
24
+ export class IoxAosModule {
25
+
26
+ static forRoot(): ModuleWithProviders<any> {
27
+ return {
28
+ ngModule: IoxAosModule,
29
+ providers: [AOSService]
30
+ };
31
+ }
32
+
33
+ }
@@ -0,0 +1,21 @@
1
+ import { Injectable } from "@angular/core";
2
+ import { Observable, Subject } from "rxjs";
3
+
4
+
5
+
6
+ @Injectable({providedIn: 'root'})
7
+ export class AOSService {
8
+
9
+
10
+
11
+ private _scrollOffset:Subject<any> = new Subject();
12
+ public readonly scrollOffset: Observable<any> = this._scrollOffset.asObservable();
13
+
14
+ constructor() { }
15
+
16
+
17
+ updateScrollOffset(offset:any){
18
+ this._scrollOffset.next(offset);
19
+ }
20
+
21
+ }
@@ -0,0 +1,24 @@
1
+ import { Directive, Inject, ElementRef, forwardRef, OnDestroy, AfterViewInit, Renderer2 } from '@angular/core';
2
+ import { IoxMasonryComponent } from './iox-masonry.component';
3
+ @Directive({
4
+ selector: "[ioxMasonryItem], ioxMasonryItem",
5
+ standalone: false
6
+ })
7
+ export class IoxMasonryItemDirective implements OnDestroy, AfterViewInit {
8
+ constructor(
9
+ private _element: ElementRef,
10
+ @Inject(forwardRef(() => IoxMasonryComponent))
11
+ private _parent: IoxMasonryComponent,
12
+ private _renderer:Renderer2) {
13
+ //this._renderer.setStyle(_element.nativeElement,'opacity', '0');
14
+ }
15
+
16
+ ngAfterViewInit() {
17
+ console.log(this._element.nativeElement);
18
+ this._parent.add(this._element.nativeElement);
19
+ }
20
+
21
+ ngOnDestroy() {
22
+ this._parent.remove(this._element.nativeElement);
23
+ }
24
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { IoxMasonryComponent } from './iox-masonry.component';
4
+
5
+ describe('IoxMasonryComponent', () => {
6
+ let component: IoxMasonryComponent;
7
+ let fixture: ComponentFixture<IoxMasonryComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ IoxMasonryComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(IoxMasonryComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,71 @@
1
+ import { Component, OnInit, Input, Output, EventEmitter, HostListener, ElementRef, AfterViewInit} from '@angular/core';
2
+ import { Masonry } from '@fristys/masonry';
3
+
4
+
5
+ @Component({
6
+ selector: "[iox-masonry], iox-masonry",
7
+ template: `<ng-content></ng-content>`,
8
+ styles: [],
9
+ standalone: false
10
+ })
11
+ export class IoxMasonryComponent implements OnInit, AfterViewInit {
12
+
13
+
14
+
15
+ // Inputs
16
+ @Input() public options: any = {};
17
+ @Input() public useImagesLoaded: Boolean = false;
18
+ @Input() updateLayout: Boolean = false;
19
+
20
+ @Output() layoutComplete: EventEmitter<any[]> = new EventEmitter<any[]>();
21
+
22
+ public _msnry: any;
23
+ private isAppendAllowed:boolean = true;
24
+
25
+ constructor(private _element: ElementRef) { }
26
+
27
+ ngAfterViewInit(): void {
28
+ console.log("test");
29
+ }
30
+
31
+ ngOnInit() {
32
+ this._msnry = new Masonry(document.getElementById('masonry'), this.options);
33
+ this.layout();
34
+ }
35
+
36
+ ngOnChanges(changes: any) {
37
+ console.log(changes);
38
+ }
39
+
40
+
41
+ add = (element: HTMLElement)=>{
42
+ setTimeout(()=>{
43
+ this._msnry.init();
44
+ },200)
45
+
46
+ }
47
+
48
+ public remove(element: HTMLElement) {
49
+ this._msnry.remove(element);
50
+ }
51
+
52
+ public layout() {
53
+ setTimeout(() => {
54
+ this._msnry.init();
55
+ });
56
+ }
57
+
58
+ }
59
+
60
+ export interface IoxMasonryOptions {
61
+ columns?: number;
62
+ columnBreakpoints?: number;
63
+ gutter?: number | string;
64
+ initOnImageLoad?: boolean;
65
+ loadingClass?: string;
66
+ loadedClass?: string;
67
+ onInit?:any;
68
+ bindOnScroll?: boolean;
69
+ useContainerWidth?: boolean;
70
+ trackItemSizeChanges?: boolean;
71
+ }
@@ -0,0 +1,15 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { IoxMasonryComponent } from './iox-masonry.component';
3
+ import { IoxMasonryItemDirective } from './iox-masonry-item.directive';
4
+ import { BrowserModule } from '@angular/platform-browser';
5
+
6
+
7
+
8
+ @NgModule({
9
+ declarations: [IoxMasonryComponent, IoxMasonryItemDirective],
10
+ imports: [
11
+ BrowserModule
12
+ ],
13
+ exports: [IoxMasonryComponent, IoxMasonryItemDirective]
14
+ })
15
+ export class IoxMasonryModule { }
@@ -0,0 +1,16 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { IoxMasonryService } from './iox-masonry.service';
4
+
5
+ describe('IoxMasonryService', () => {
6
+ let service: IoxMasonryService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(IoxMasonryService);
11
+ });
12
+
13
+ it('should be created', () => {
14
+ expect(service).toBeTruthy();
15
+ });
16
+ });
@@ -0,0 +1,9 @@
1
+ import { Injectable } from '@angular/core';
2
+
3
+ @Injectable({
4
+ providedIn: 'root'
5
+ })
6
+ export class IoxMasonryService {
7
+
8
+ constructor() { }
9
+ }
@@ -0,0 +1,13 @@
1
+
2
+ import { NgModule } from '@angular/core';
3
+ import { CommonModule } from '@angular/common';
4
+ import { IoxPageComponent } from './page-component/page-component.component';
5
+ import { PageScrollProvider } from '../services/page-scroll.provider';
6
+
7
+ @NgModule({
8
+ imports: [CommonModule],
9
+ declarations: [IoxPageComponent],
10
+ exports: [IoxPageComponent],
11
+ providers: [PageScrollProvider]
12
+ })
13
+ export class IoxPageModule {}
@@ -0,0 +1,5 @@
1
+ <div #page [class]="class" class="iox-page-wrapper">
2
+ <div class="page-mask">
3
+ <ng-content></ng-content>
4
+ </div>
5
+ </div>
@@ -0,0 +1,19 @@
1
+ :host {
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ }
8
+ .iox-page-wrapper {
9
+ position: relative;
10
+ width: 100%;
11
+ height: 100%;
12
+ overflow: auto;
13
+ }
14
+
15
+ .page-mask {
16
+ min-height: 100%;
17
+ }
18
+
19
+
@@ -0,0 +1,60 @@
1
+ import { Component, ElementRef, EventEmitter, Input, Output, ViewChild, AfterViewInit, OnDestroy } from '@angular/core';
2
+ import { fromEvent, Subscription } from 'rxjs';
3
+ import { PageScrollProvider } from '../../services/page-scroll.provider';
4
+
5
+ @Component({
6
+ selector: 'iox-page-component',
7
+ templateUrl: './page-component.component.html',
8
+ styleUrls: ['./page-component.component.scss'],
9
+ standalone: false
10
+ })
11
+ export class IoxPageComponent implements AfterViewInit, OnDestroy {
12
+ @Input() class = '';
13
+ @ViewChild('page') public page!: ElementRef<HTMLDivElement>;
14
+ private scrollSubscription!: Subscription;
15
+ @Output() scrollEvent = new EventEmitter<{
16
+ scrollTop: number;
17
+ scrollLeft: number;
18
+ scrollHeight: number;
19
+ scrollWidth: number;
20
+ clientHeight: number;
21
+ clientWidth: number;
22
+ scrollPercentage: number;
23
+ }>();
24
+
25
+ constructor(private pageScrollProvider: PageScrollProvider) {}
26
+
27
+ ngAfterViewInit(): void {
28
+ if (this.page) {
29
+ this.scrollSubscription = fromEvent(this.page.nativeElement, 'scroll').subscribe((event) => {
30
+ this.onScroll(event as Event);
31
+ });
32
+
33
+ this.pageScrollProvider.init({
34
+ wrapper: this.page.nativeElement,
35
+ content: this.page.nativeElement.querySelector('.page-mask')!,
36
+ duration: 1.2,
37
+ easing: (t: number) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
38
+ });
39
+ }
40
+ }
41
+
42
+ onScroll(event: Event): void {
43
+ const target = event.target as HTMLElement;
44
+ const scrollTop = target.scrollTop;
45
+ const scrollLeft = target.scrollLeft;
46
+ const scrollHeight = target.scrollHeight;
47
+ const scrollWidth = target.scrollWidth;
48
+ const clientHeight = target.clientHeight;
49
+ const clientWidth = target.clientWidth;
50
+ const scrollPercentage = (scrollTop / (scrollHeight - clientHeight)) * 100;
51
+
52
+ this.scrollEvent.emit({ scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth, scrollPercentage });
53
+ }
54
+
55
+ ngOnDestroy(): void {
56
+ if (this.scrollSubscription) {
57
+ this.scrollSubscription.unsubscribe();
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,11 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { IoxAosModule } from './iox-aos/iox-aos.module';
3
+ import { IoxPageModule } from './iox-page/iox-page.module';
4
+
5
+
6
+ @NgModule({
7
+ declarations: [],
8
+ imports: [IoxAosModule, IoxPageModule],
9
+ exports: [IoxAosModule, IoxPageModule]
10
+ })
11
+ export class IoxUiModule { }