@vectoriox/iox-ui 4.0.3 → 4.0.4
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/fesm2022/vectoriox-iox-ui.mjs +376 -35
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/index.d.ts +95 -6
- package/package.json +11 -5
- package/.github/workflows/publish-iox-ui.yml +0 -68
- package/.github/workflows/release-iox-ui.yml.disabled +0 -77
- package/angular.json +0 -150
- package/karma.conf.js +0 -44
- package/projects/iox-ui/.github/copilot-instructions.md +0 -32
- package/projects/iox-ui/.releaserc.json +0 -42
- package/projects/iox-ui/README.md +0 -149
- package/projects/iox-ui/karma.conf.js +0 -44
- package/projects/iox-ui/ng +0 -0
- package/projects/iox-ui/ng-package.json +0 -12
- package/projects/iox-ui/package-lock.json +0 -93
- package/projects/iox-ui/package.json +0 -13
- package/projects/iox-ui/src/lib/iox-aos/iox-aos-animations.ts +0 -45
- package/projects/iox-ui/src/lib/iox-aos/iox-aos-container.component.ts +0 -46
- package/projects/iox-ui/src/lib/iox-aos/iox-aos.directive.ts +0 -133
- package/projects/iox-ui/src/lib/iox-aos/iox-aos.module.ts +0 -33
- package/projects/iox-ui/src/lib/iox-aos/iox-aos.service.ts +0 -21
- package/projects/iox-ui/src/lib/iox-masonry/iox-masonry-item.directive.ts +0 -24
- package/projects/iox-ui/src/lib/iox-masonry/iox-masonry.component.spec.ts +0 -25
- package/projects/iox-ui/src/lib/iox-masonry/iox-masonry.component.ts +0 -71
- package/projects/iox-ui/src/lib/iox-masonry/iox-masonry.module.ts +0 -15
- package/projects/iox-ui/src/lib/iox-masonry/iox-masonry.service.spec.ts +0 -16
- package/projects/iox-ui/src/lib/iox-masonry/iox-masonry.service.ts +0 -9
- package/projects/iox-ui/src/lib/iox-page/iox-page.module.ts +0 -13
- package/projects/iox-ui/src/lib/iox-page/page-component/page-component.component.html +0 -5
- package/projects/iox-ui/src/lib/iox-page/page-component/page-component.component.scss +0 -19
- package/projects/iox-ui/src/lib/iox-page/page-component/page-component.component.ts +0 -60
- package/projects/iox-ui/src/lib/iox-ui.module.ts +0 -11
- package/projects/iox-ui/src/lib/services/page-scroll.provider.ts +0 -45
- package/projects/iox-ui/src/lib/view-position/view-position.directive.ts +0 -98
- package/projects/iox-ui/src/lib/view-position/view-position.module.ts +0 -16
- package/projects/iox-ui/src/public-api.ts +0 -25
- package/projects/iox-ui/src/test.ts +0 -15
- package/projects/iox-ui/tsconfig.lib.json +0 -15
- package/projects/iox-ui/tsconfig.lib.prod.json +0 -10
- package/projects/iox-ui/tsconfig.spec.json +0 -17
- package/src/app/app-routing.module.ts +0 -15
- package/src/app/app.component.html +0 -17
- package/src/app/app.component.scss +0 -31
- package/src/app/app.component.spec.ts +0 -33
- package/src/app/app.component.ts +0 -21
- package/src/app/app.module.ts +0 -36
- package/src/app/pages/aos/aos.component.html +0 -35
- package/src/app/pages/aos/aos.component.scss +0 -49
- package/src/app/pages/aos/aos.component.ts +0 -30
- package/src/app/pages/masonry/masonry.component.html +0 -10
- package/src/app/pages/masonry/masonry.component.scss +0 -23
- package/src/app/pages/masonry/masonry.component.ts +0 -73
- package/src/app/styles/abstracts/functions.scss +0 -0
- package/src/app/styles/abstracts/mixins.scss +0 -0
- package/src/app/styles/abstracts/variables.scss +0 -5
- package/src/app/styles/base/fonts/heebo-black/Heebo-Black.eot +0 -0
- package/src/app/styles/base/fonts/heebo-black/Heebo-Black.svg +0 -1163
- package/src/app/styles/base/fonts/heebo-black/Heebo-Black.ttf +0 -0
- package/src/app/styles/base/fonts/heebo-black/Heebo-Black.woff +0 -0
- package/src/app/styles/base/fonts/heebo-black/Heebo-Black.woff2 +0 -0
- package/src/app/styles/base/fonts/heebo-bold/Heebo-Bold.eot +0 -0
- package/src/app/styles/base/fonts/heebo-bold/Heebo-Bold.svg +0 -1163
- package/src/app/styles/base/fonts/heebo-bold/Heebo-Bold.ttf +0 -0
- package/src/app/styles/base/fonts/heebo-bold/Heebo-Bold.woff +0 -0
- package/src/app/styles/base/fonts/heebo-bold/Heebo-Bold.woff2 +0 -0
- package/src/app/styles/base/fonts/heebo-extrabold/Heebo-ExtraBold.eot +0 -0
- package/src/app/styles/base/fonts/heebo-extrabold/Heebo-ExtraBold.svg +0 -1152
- package/src/app/styles/base/fonts/heebo-extrabold/Heebo-ExtraBold.ttf +0 -0
- package/src/app/styles/base/fonts/heebo-extrabold/Heebo-ExtraBold.woff +0 -0
- package/src/app/styles/base/fonts/heebo-extrabold/Heebo-ExtraBold.woff2 +0 -0
- package/src/app/styles/base/fonts/heebo-extralight/Heebo-ExtraLight.eot +0 -0
- package/src/app/styles/base/fonts/heebo-extralight/Heebo-ExtraLight.svg +0 -1152
- package/src/app/styles/base/fonts/heebo-extralight/Heebo-ExtraLight.ttf +0 -0
- package/src/app/styles/base/fonts/heebo-extralight/Heebo-ExtraLight.woff +0 -0
- package/src/app/styles/base/fonts/heebo-extralight/Heebo-ExtraLight.woff2 +0 -0
- package/src/app/styles/base/fonts/heebo-light/Heebo-Light.eot +0 -0
- package/src/app/styles/base/fonts/heebo-light/Heebo-Light.svg +0 -1151
- package/src/app/styles/base/fonts/heebo-light/Heebo-Light.ttf +0 -0
- package/src/app/styles/base/fonts/heebo-light/Heebo-Light.woff +0 -0
- package/src/app/styles/base/fonts/heebo-light/Heebo-Light.woff2 +0 -0
- package/src/app/styles/base/fonts/heebo-medium/Heebo-Medium.eot +0 -0
- package/src/app/styles/base/fonts/heebo-medium/Heebo-Medium.svg +0 -1158
- package/src/app/styles/base/fonts/heebo-medium/Heebo-Medium.ttf +0 -0
- package/src/app/styles/base/fonts/heebo-medium/Heebo-Medium.woff +0 -0
- package/src/app/styles/base/fonts/heebo-medium/Heebo-Medium.woff2 +0 -0
- package/src/app/styles/base/fonts/heebo-regular/Heebo-Regular.eot +0 -0
- package/src/app/styles/base/fonts/heebo-regular/Heebo-Regular.svg +0 -1150
- package/src/app/styles/base/fonts/heebo-regular/Heebo-Regular.ttf +0 -0
- package/src/app/styles/base/fonts/heebo-regular/Heebo-Regular.woff +0 -0
- package/src/app/styles/base/fonts/heebo-regular/Heebo-Regular.woff2 +0 -0
- package/src/app/styles/base/fonts/heebo-semibold/Heebo-SemiBold.eot +0 -0
- package/src/app/styles/base/fonts/heebo-semibold/Heebo-SemiBold.svg +0 -1155
- package/src/app/styles/base/fonts/heebo-semibold/Heebo-SemiBold.ttf +0 -0
- package/src/app/styles/base/fonts/heebo-semibold/Heebo-SemiBold.woff +0 -0
- package/src/app/styles/base/fonts/heebo-semibold/Heebo-SemiBold.woff2 +0 -0
- package/src/app/styles/base/fonts/heebo-thin/Heebo-Thin.eot +0 -0
- package/src/app/styles/base/fonts/heebo-thin/Heebo-Thin.svg +0 -1143
- package/src/app/styles/base/fonts/heebo-thin/Heebo-Thin.ttf +0 -0
- package/src/app/styles/base/fonts/heebo-thin/Heebo-Thin.woff +0 -0
- package/src/app/styles/base/fonts/heebo-thin/Heebo-Thin.woff2 +0 -0
- package/src/app/styles/base/fonts/iox.eot +0 -0
- package/src/app/styles/base/fonts/iox.svg +0 -35
- package/src/app/styles/base/fonts/iox.ttf +0 -0
- package/src/app/styles/base/fonts/iox.woff +0 -0
- package/src/app/styles/base/iox-font.scss +0 -102
- package/src/app/styles/base/reset.scss +0 -0
- package/src/app/styles/base/typography.scss +0 -104
- package/src/app/styles/layout/flex.scss +0 -183
- package/src/app/styles/layout/grid.scss +0 -0
- package/src/app/styles/main.scss +0 -17
- package/src/assets/.gitkeep +0 -0
- package/src/assets/images/1.jfif +0 -0
- package/src/assets/images/2.jfif +0 -0
- package/src/assets/images/3.jfif +0 -0
- package/src/assets/images/4.png +0 -0
- package/src/assets/images/5.jfif +0 -0
- package/src/assets/images/6.jfif +0 -0
- package/src/assets/images/7.jfif +0 -0
- package/src/assets/images/8.jfif +0 -0
- package/src/assets/images/9.jfif +0 -0
- package/src/environments/environment.prod.ts +0 -3
- package/src/environments/environment.ts +0 -16
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -13
- package/src/main.ts +0 -12
- package/src/polyfills.ts +0 -53
- package/src/styles.scss +0 -15
- package/src/test.ts +0 -14
- package/temp/unused-iox-projects/README.md +0 -10
- package/temp/unused-iox-projects/iox-aos-KEEP.md +0 -1
- package/temp/unused-iox-projects/iox-aos_KEEP.md +0 -5
- package/temp/unused-iox-projects/iox-masonry-KEEP.md +0 -1
- package/temp/unused-iox-projects/iox-masonry_KEEP.md +0 -5
- package/tsconfig.app.json +0 -15
- package/tsconfig.json +0 -54
- package/tsconfig.spec.json +0 -18
|
@@ -1,133 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,71 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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 { }
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
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 {}
|
|
@@ -1,60 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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 { }
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import Lenis from 'lenis';
|
|
3
|
-
|
|
4
|
-
@Injectable()
|
|
5
|
-
export class PageScrollProvider {
|
|
6
|
-
private lenis?: Lenis;
|
|
7
|
-
private rafId?: number;
|
|
8
|
-
|
|
9
|
-
init(options?: ConstructorParameters<typeof Lenis>[0]): void {
|
|
10
|
-
if (this.lenis) {
|
|
11
|
-
this.lenis.destroy();
|
|
12
|
-
}
|
|
13
|
-
if (this.rafId != null) {
|
|
14
|
-
cancelAnimationFrame(this.rafId);
|
|
15
|
-
}
|
|
16
|
-
this.lenis = new Lenis(options || {});
|
|
17
|
-
this.startLoop();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
scrollTo(y: number, options?: { duration?: number; immediate?: boolean }): void {
|
|
21
|
-
this.instance.scrollTo(y, options);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
scrollToTop(options?: { duration?: number; immediate?: boolean }): void {
|
|
25
|
-
this.scrollTo(0, options);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
get instance(): Lenis {
|
|
29
|
-
if (!this.lenis) {
|
|
30
|
-
throw new Error('PageScrollProvider: call init() before accessing the instance.');
|
|
31
|
-
}
|
|
32
|
-
return this.lenis;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
private startLoop(): void {
|
|
36
|
-
if (!this.lenis) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const loop = (time: number) => {
|
|
40
|
-
this.lenis!.raf(time);
|
|
41
|
-
this.rafId = requestAnimationFrame(loop);
|
|
42
|
-
};
|
|
43
|
-
this.rafId = requestAnimationFrame(loop);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import {AfterViewInit, Directive, ElementRef, EventEmitter, HostListener, Input, Output} from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Directive({
|
|
4
|
-
selector:'[view-position]',
|
|
5
|
-
standalone: false
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
export class ViewPositionDirective implements AfterViewInit{
|
|
9
|
-
|
|
10
|
-
private _viewPortHighet!:number;
|
|
11
|
-
private _elementHeight!: number;
|
|
12
|
-
private _elementOffseTop!: number;
|
|
13
|
-
private _curterScreen!:number;
|
|
14
|
-
private _halfSscreen!:number;
|
|
15
|
-
|
|
16
|
-
private _scrollDirection:string= "Down";
|
|
17
|
-
private _scrollPos:number = 0;
|
|
18
|
-
public isOnScreen: boolean = false;
|
|
19
|
-
public isHalfScreen: boolean = false;
|
|
20
|
-
|
|
21
|
-
@Input() data:any
|
|
22
|
-
@Output() onEnter:EventEmitter<any> = new EventEmitter();
|
|
23
|
-
@Output() onLeave:EventEmitter<any> = new EventEmitter();
|
|
24
|
-
@Output() onHalf:EventEmitter<any> = new EventEmitter();
|
|
25
|
-
|
|
26
|
-
constructor(private _elr:ElementRef){
|
|
27
|
-
this._initScreenDeminitions();
|
|
28
|
-
console.log(`screent highet: ${this._viewPortHighet}`);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
ngAfterViewInit(): void {
|
|
33
|
-
this._elementOffseTop = this._elr.nativeElement.offsetTop;
|
|
34
|
-
this._elementHeight = this._elr.nativeElement.offsetHeight;
|
|
35
|
-
console.log(`element offset Y = ${this._elementOffseTop}`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
@HostListener('window:scroll', ['$event']) onScroll(e: Event): void {
|
|
40
|
-
|
|
41
|
-
if ((document.body.getBoundingClientRect()).top > this._scrollPos){
|
|
42
|
-
if(this._scrollDirection != "Up"){
|
|
43
|
-
this.isHalfScreen =false;
|
|
44
|
-
this._scrollDirection = "Up"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
else{
|
|
48
|
-
if(this._scrollDirection !="Down"){
|
|
49
|
-
this.isHalfScreen =false;
|
|
50
|
-
this._scrollDirection = "Down"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
this._scrollPos = (document.body.getBoundingClientRect()).top;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
let currentClientHight = this._elr.nativeElement.getBoundingClientRect().top;
|
|
57
|
-
if(currentClientHight >= this._viewPortHighet || currentClientHight < -this._elementHeight){
|
|
58
|
-
if(this.isOnScreen){
|
|
59
|
-
this.isOnScreen = false;
|
|
60
|
-
this.onLeave.emit("OUT");
|
|
61
|
-
}
|
|
62
|
-
}else{
|
|
63
|
-
if(!this.isOnScreen){
|
|
64
|
-
this.isOnScreen = true;
|
|
65
|
-
this.onEnter.emit("IN");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if(currentClientHight < this._halfSscreen && currentClientHight > 0 && this._scrollDirection == "Down") {
|
|
70
|
-
if(!this.isHalfScreen){
|
|
71
|
-
this.isHalfScreen = true;
|
|
72
|
-
console.log("half")
|
|
73
|
-
this.onHalf.emit(this.data);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if(currentClientHight + this._elementHeight > this._halfSscreen && currentClientHight +this._elementHeight < this._viewPortHighet && this._scrollDirection == "Up") {
|
|
78
|
-
if(!this.isHalfScreen){
|
|
79
|
-
this.isHalfScreen = true;
|
|
80
|
-
console.log("I am half")
|
|
81
|
-
this.onHalf.emit(this.data);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@HostListener('window:resize', ['$event']) onResize(e: Event) {
|
|
87
|
-
this._viewPortHighet = window.innerHeight;
|
|
88
|
-
this._initScreenDeminitions();
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
private _initScreenDeminitions(){
|
|
94
|
-
this._viewPortHighet = window.innerHeight;
|
|
95
|
-
this._curterScreen = Math.trunc(this._viewPortHighet *0.25);
|
|
96
|
-
this._halfSscreen = Math.trunc(this._viewPortHighet *0.5);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { ViewPositionDirective } from './view-position.directive';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@NgModule({
|
|
7
|
-
declarations: [
|
|
8
|
-
ViewPositionDirective
|
|
9
|
-
],
|
|
10
|
-
imports: [
|
|
11
|
-
],
|
|
12
|
-
exports: [
|
|
13
|
-
ViewPositionDirective
|
|
14
|
-
]
|
|
15
|
-
})
|
|
16
|
-
export class ViewPositionModule { }
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API Surface of iox-ui
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export * from './lib/view-position/view-position.directive';
|
|
6
|
-
export * from './lib/view-position/view-position.module';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export * from './lib/iox-aos/iox-aos.directive';
|
|
11
|
-
export * from './lib/iox-aos/iox-aos-container.component';
|
|
12
|
-
export * from './lib/iox-aos/iox-aos.service';
|
|
13
|
-
export * from './lib/iox-aos/iox-aos.module';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export * from './lib/iox-masonry/iox-masonry.service';
|
|
18
|
-
export * from './lib/iox-masonry/iox-masonry.component';
|
|
19
|
-
export * from './lib/iox-masonry/iox-masonry-item.directive';
|
|
20
|
-
export * from './lib/iox-masonry/iox-masonry.module';
|
|
21
|
-
|
|
22
|
-
export * from './lib/iox-ui.module';
|
|
23
|
-
export * from './lib/iox-page/page-component/page-component.component';
|
|
24
|
-
export * from './lib/iox-page/iox-page.module';
|
|
25
|
-
export * from './lib/services/page-scroll.provider';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
-
|
|
3
|
-
import 'zone.js';
|
|
4
|
-
import 'zone.js/testing';
|
|
5
|
-
import { getTestBed } from '@angular/core/testing';
|
|
6
|
-
import {
|
|
7
|
-
BrowserDynamicTestingModule,
|
|
8
|
-
platformBrowserDynamicTesting
|
|
9
|
-
} from '@angular/platform-browser-dynamic/testing';
|
|
10
|
-
|
|
11
|
-
// First, initialize the Angular testing environment.
|
|
12
|
-
getTestBed().initTestEnvironment(
|
|
13
|
-
BrowserDynamicTestingModule,
|
|
14
|
-
platformBrowserDynamicTesting(),
|
|
15
|
-
);
|