Skip to content

Commit c73a020

Browse files
committed
feat(components): added image comparison component
1 parent 29a7fbe commit c73a020

34 files changed

+783
-16
lines changed

PLAYBOOK.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,11 @@ ng g component containers/StickyTable --project=experiments --dry-run
385385
ng g component containers/clapButton --project=experiments -s -t --spec=false --dry-run
386386
ng g component containers/knobDemo --project=experiments --dry-run
387387
ng g component containers/ledDemo --project=experiments --dry-run
388+
ng g component containers/ImageComp --project=experiments --dry-run
389+
390+
# generate components for `ImageComparison` Module
391+
ng g lib ImageComparison --prefix=ngx --tags=public-module --spec=false --publishable=true --dry-run
392+
ng g component ImageComparison --project=image-comparison --export --flat --dry-run
388393
```
389394

390395
#### Workspace Schematics

angular.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,46 @@
13781378
}
13791379
}
13801380
}
1381+
},
1382+
"image-comparison": {
1383+
"root": "libs/image-comparison",
1384+
"sourceRoot": "libs/image-comparison/src",
1385+
"projectType": "library",
1386+
"prefix": "ngx",
1387+
"architect": {
1388+
"build": {
1389+
"builder": "@angular-devkit/build-ng-packagr:build",
1390+
"options": {
1391+
"tsConfig": "libs/image-comparison/tsconfig.lib.json",
1392+
"project": "libs/image-comparison/ng-package.json"
1393+
},
1394+
"configurations": {
1395+
"production": {
1396+
"project": "libs/image-comparison/ng-package.prod.json"
1397+
}
1398+
}
1399+
},
1400+
"lint": {
1401+
"builder": "@angular-devkit/build-angular:tslint",
1402+
"options": {
1403+
"tsConfig": [
1404+
"libs/image-comparison/tsconfig.lib.json",
1405+
"libs/image-comparison/tsconfig.spec.json"
1406+
],
1407+
"exclude": [
1408+
"**/node_modules/**"
1409+
]
1410+
}
1411+
},
1412+
"test": {
1413+
"builder": "@nrwl/builders:jest",
1414+
"options": {
1415+
"jestConfig": "libs/image-comparison/jest.config.js",
1416+
"tsConfig": "libs/image-comparison/tsconfig.spec.json",
1417+
"setupFile": "libs/image-comparison/src/test-setup.ts"
1418+
}
1419+
}
1420+
}
13811421
}
13821422
},
13831423
"schematics": {
262 KB
Loading
213 KB
Loading
166 KB
Loading
160 KB
Loading
135 KB
Loading
222 KB
Loading

libs/core/src/lib/menu-data.ts

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,49 @@ export const defaultMenu: MenuItem[] = [
6767
icon: 'directions',
6868
link: '/dashboard/experiments/knob',
6969
},
70+
// {
71+
// name: 'Microinteractions',
72+
// icon: 'casino',
73+
// disabled: false,
74+
// children: [
75+
// {
76+
// name: 'Clap',
77+
// icon: 'pan_tool',
78+
// link: '/dashboard/experiments/clap',
79+
// },
80+
// {
81+
// name: 'Led',
82+
// icon: 'highlight',
83+
// link: '/dashboard/experiments/led',
84+
// },
85+
// {
86+
// name: 'Image Comp',
87+
// icon: 'tonality',
88+
// link: '/dashboard/experiments/image-comp',
89+
// },
90+
// ],
91+
// },
92+
],
93+
},
94+
{
95+
name: 'Micro Interactions',
96+
icon: 'casino',
97+
disabled: false,
98+
children: [
7099
{
71-
name: 'Microinteractions',
72-
icon: 'casino',
73-
disabled: false,
74-
children: [
75-
{
76-
name: 'Clap',
77-
icon: 'pan_tool',
78-
link: '/dashboard/experiments/clap',
79-
},
80-
{
81-
name: 'Led',
82-
icon: 'highlight',
83-
link: '/dashboard/experiments/led',
84-
},
85-
],
100+
name: 'Clap',
101+
icon: 'pan_tool',
102+
link: '/dashboard/experiments/clap',
103+
},
104+
{
105+
name: 'Led',
106+
icon: 'highlight',
107+
link: '/dashboard/experiments/led',
108+
},
109+
{
110+
name: 'Image Comp',
111+
icon: 'tonality',
112+
link: '/dashboard/experiments/image-comp',
86113
},
87114
],
88115
},
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<ngx-image-comparison startPosition="70">
2+
<img #comparisonImage src="assets/img/comp/1-before.jpg" alt="first image" data-label="first">
3+
<img #comparisonImage src="assets/img/comp/1-after.jpg" alt="second image" data-label="second">
4+
</ngx-image-comparison>
5+
<br/><br/>
6+
<ngx-image-comparison startPosition="40">
7+
<img #comparisonImage src="assets/img/comp/2-before.jpg" alt="" data-label="1">
8+
<img #comparisonImage src="assets/img/comp/2-after.jpg" alt="" data-label="2">
9+
</ngx-image-comparison>
10+
<br/><br/>
11+
<ngx-image-comparison startPosition="60">
12+
<img #comparisonImage src="assets/img/comp/3-before.jpg">
13+
<img #comparisonImage src="assets/img/comp/3-after.jpg">
14+
</ngx-image-comparison>

0 commit comments

Comments
 (0)