Skip to content

Commit af2beb1

Browse files
committed
Initial commit
0 parents  commit af2beb1

27 files changed

+1942
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ngu-carousel-exh8fv
2+
3+
[Edit on StackBlitz ⚡️](https://stackblitz.com/edit/ngu-carousel-exh8fv)

angular.json

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"demo": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"styleext": "scss"
14+
}
15+
},
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/demo",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "src/tsconfig.app.json",
25+
"assets": [
26+
"src/favicon.ico",
27+
"src/assets"
28+
],
29+
"styles": [
30+
"src/styles.scss"
31+
],
32+
"scripts": []
33+
},
34+
"configurations": {
35+
"production": {
36+
"fileReplacements": [
37+
{
38+
"replace": "src/environments/environment.ts",
39+
"with": "src/environments/environment.prod.ts"
40+
}
41+
],
42+
"optimization": true,
43+
"outputHashing": "all",
44+
"sourceMap": false,
45+
"extractCss": true,
46+
"namedChunks": false,
47+
"aot": true,
48+
"extractLicenses": true,
49+
"vendorChunk": false,
50+
"buildOptimizer": true
51+
}
52+
}
53+
},
54+
"serve": {
55+
"builder": "@angular-devkit/build-angular:dev-server",
56+
"options": {
57+
"browserTarget": "demo:build"
58+
},
59+
"configurations": {
60+
"production": {
61+
"browserTarget": "demo:build:production"
62+
}
63+
}
64+
},
65+
"extract-i18n": {
66+
"builder": "@angular-devkit/build-angular:extract-i18n",
67+
"options": {
68+
"browserTarget": "demo:build"
69+
}
70+
},
71+
"test": {
72+
"builder": "@angular-devkit/build-angular:karma",
73+
"options": {
74+
"main": "src/test.ts",
75+
"polyfills": "src/polyfills.ts",
76+
"tsConfig": "src/tsconfig.spec.json",
77+
"karmaConfig": "src/karma.conf.js",
78+
"styles": [
79+
"styles.css"
80+
],
81+
"scripts": [],
82+
"assets": [
83+
"src/favicon.ico",
84+
"src/assets"
85+
]
86+
}
87+
},
88+
"lint": {
89+
"builder": "@angular-devkit/build-angular:tslint",
90+
"options": {
91+
"tsConfig": [
92+
"src/tsconfig.app.json",
93+
"src/tsconfig.spec.json"
94+
],
95+
"exclude": [
96+
"**/node_modules/**"
97+
]
98+
}
99+
}
100+
}
101+
},
102+
"demo-e2e": {
103+
"root": "e2e/",
104+
"projectType": "application",
105+
"architect": {
106+
"e2e": {
107+
"builder": "@angular-devkit/build-angular:protractor",
108+
"options": {
109+
"protractorConfig": "e2e/protractor.conf.js",
110+
"devServerTarget": "demo:serve"
111+
}
112+
},
113+
"lint": {
114+
"builder": "@angular-devkit/build-angular:tslint",
115+
"options": {
116+
"tsConfig": "e2e/tsconfig.e2e.json",
117+
"exclude": [
118+
"**/node_modules/**"
119+
]
120+
}
121+
}
122+
}
123+
}
124+
},
125+
"defaultProject": "demo"
126+
}

package.json

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "ngu-carousel",
3+
"version": "0.0.0",
4+
"private": true,
5+
"dependencies": {
6+
"rxjs": "6.1.0",
7+
"core-js": "2.5.5",
8+
"zone.js": "0.8.26",
9+
"hammerjs": "2.0.8",
10+
"rxjs-compat": "6.1.0",
11+
"@angular/core": "6.0.0",
12+
"@angular/forms": "6.0.0",
13+
"@angular/common": "6.0.0",
14+
"@angular/router": "6.0.0",
15+
"@types/hammerjs": "2.0.35",
16+
"@angular/compiler": "6.0.0",
17+
"@angular/animations": "6.0.2",
18+
"@angular/platform-browser": "6.0.0",
19+
"@angular/platform-browser-dynamic": "6.0.0"
20+
},
21+
"scripts": {
22+
"ng": "ng",
23+
"start": "ng serve",
24+
"build": "ng build",
25+
"test": "ng test",
26+
"lint": "ng lint",
27+
"e2e": "ng e2e"
28+
},
29+
"devDependencies": {
30+
"@angular-devkit/build-angular": "~0.901.1",
31+
"@angular/cli": "~9.1.1",
32+
"@angular/compiler-cli": "~9.1.1",
33+
"@angular/language-service": "~9.1.1",
34+
"@types/node": "^12.11.1",
35+
"@types/jasmine": "~3.5.0",
36+
"@types/jasminewd2": "~2.0.3",
37+
"codelyzer": "^5.1.2",
38+
"jasmine-core": "~3.5.0",
39+
"jasmine-spec-reporter": "~4.2.1",
40+
"karma": "~4.4.1",
41+
"karma-chrome-launcher": "~3.1.0",
42+
"karma-coverage-istanbul-reporter": "~2.1.0",
43+
"karma-jasmine": "~3.0.1",
44+
"karma-jasmine-html-reporter": "^1.4.2",
45+
"protractor": "~5.4.3",
46+
"ts-node": "~8.3.0",
47+
"tslint": "~6.1.0",
48+
"typescript": "~3.8.3"
49+
}
50+
}

src/app/app-animation.ts

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import {
2+
AnimationTriggerMetadata,
3+
animate,
4+
state,
5+
style,
6+
transition,
7+
trigger
8+
} from '@angular/animations';
9+
10+
/** Time and timing curve for expansion panel animations. */
11+
export const EXPANSION_PANEL_ANIMATION_TIMING =
12+
'225ms cubic-bezier(0.4,0.0,0.2,1)';
13+
14+
/** Animations used by the Material expansion panel. */
15+
export const btnAnim: AnimationTriggerMetadata = trigger('btnAnim', [
16+
state('true', style({ opacity: 1, transform: 'translate3d(0,0,0)' })),
17+
state(
18+
'false',
19+
style({
20+
opacity: 0,
21+
transform: `translate3d({{btn}}50px,0,0)`
22+
}),
23+
{
24+
params: { btn: 'left' }
25+
}
26+
),
27+
transition('* => *', animate('300ms cubic-bezier(.75,-0.48,.26,1.52)'))
28+
]);

src/app/app.component.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<ngu-carousel #myCarousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" [dataSource]="carouselTileItems">
2+
<ngu-tile *nguCarouselDef="let item; let i = index">
3+
<div class="tile" [style.background]="'url(' + item + ')'" style="min-height: 200px">
4+
<h1>{{i}}</h1>
5+
</div>
6+
</ngu-tile>
7+
<button NguCarouselPrev class="leftRs" [style.opacity]="myCarousel.isFirst ? 0.5:1">&lt;</button>
8+
<button NguCarouselNext class="rightRs" [style.opacity]="myCarousel.isLast ? 0.5:1">&gt;</button>
9+
<ul class="myPoint" NguCarouselPoint>
10+
<li *ngFor="let i of myCarousel.pointNumbers; let i = index" [class.active]="i==myCarousel.activePoint" (click)="myCarousel.moveTo(i)"
11+
[style.background]="'url(' + carouselTileItems[i] + ')'"></li>
12+
</ul>
13+
</ngu-carousel>
14+
15+
<!-- {{carouselTileItems | json}} -->
16+
{{myCarousel.isFirst}} --- {{myCarousel.isLast}} --- {{myCarousel.pointNumbers}}

0 commit comments

Comments
 (0)