diff --git a/angular.json b/angular.json index b7f8b396..cf6d7540 100644 --- a/angular.json +++ b/angular.json @@ -212,6 +212,105 @@ } } } + }, + "hands-on-solution": { + "root": "steps/hands-on-solution/", + "sourceRoot": "steps/hands-on-solution/src", + "projectType": "application", + "prefix": "app", + "schematics": {}, + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/hands-on-solution", + "index": "steps/hands-on-solution/src/index.html", + "main": "steps/hands-on-solution/src/main.ts", + "polyfills": "steps/hands-on-solution/src/polyfills.ts", + "tsConfig": "steps/hands-on-solution/tsconfig.app.json", + "assets": [ + "steps/hands-on-solution/src/favicon.ico", + "steps/hands-on-solution/src/assets" + ], + "styles": [ + "steps/hands-on-solution/src/styles.css" + ], + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "steps/hands-on-solution/src/environments/environment.ts", + "with": "steps/hands-on-solution/src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "hands-on-solution:build" + }, + "configurations": { + "production": { + "browserTarget": "hands-on-solution:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "hands-on-solution:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "steps/hands-on-solution/src/test.ts", + "polyfills": "steps/hands-on-solution/src/polyfills.ts", + "tsConfig": "steps/hands-on-solution/tsconfig.spec.json", + "karmaConfig": "steps/hands-on-solution/karma.conf.js", + "styles": [ + "steps/hands-on-solution/src/styles.css" + ], + "scripts": [], + "assets": [ + "steps/hands-on-solution/src/favicon.ico", + "steps/hands-on-solution/src/assets" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "steps/hands-on-solution/tsconfig.app.json", + "steps/hands-on-solution/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } } }, "defaultProject": "angular-200", @@ -224,4 +323,4 @@ "prefix": "sfeir" } } -} +} \ No newline at end of file diff --git a/steps/hands-on-solution/browserslist b/steps/hands-on-solution/browserslist new file mode 100644 index 00000000..37371cb0 --- /dev/null +++ b/steps/hands-on-solution/browserslist @@ -0,0 +1,11 @@ +# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries +# +# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed + +> 0.5% +last 2 versions +Firefox ESR +not dead +not IE 9-11 \ No newline at end of file diff --git a/steps/hands-on-solution/src/app/app.component.css b/steps/hands-on-solution/src/app/app.component.css new file mode 100644 index 00000000..df3c0b92 --- /dev/null +++ b/steps/hands-on-solution/src/app/app.component.css @@ -0,0 +1,46 @@ +mat-toolbar.extend-toolbar { + background-color: #0168AB; + background-image: url('/assets/images/bg_right.png'); + background-repeat: no-repeat; + background-position: right; + top: 0px; + box-shadow: 0 2px 5px 0 rgba(0,0,0,.26); + width: 100%; + z-index: 1; + color: white; + margin-bottom: 10px; +} + +mat-toolbar .flex { + flex: 1 1 auto; +} + +mat-toolbar a { + color: inherit; + text-decoration: none; + height: 100%; + margin: 0px 10px 0px 10px; + border-bottom: 2px solid transparent; + font-size: 1.1em; + font-weight: normal; + font-family: 'Open Sans', sans-serif; +} + +mat-toolbar a:not(.active):hover { + border-bottom: 2px solid white; +} + +mat-toolbar a img { + height: 100%; + margin-left: -60px; +} + +mat-toolbar-row:nth-child(1) { + margin-bottom: 66px; +} +mat-toolbar-row:nth-child(2) { + padding-left: 30px; + text-align: center; + height: 56px; + margin-top: 56px; +} diff --git a/steps/hands-on-solution/src/app/app.component.html b/steps/hands-on-solution/src/app/app.component.html new file mode 100644 index 00000000..33fc45ee --- /dev/null +++ b/steps/hands-on-solution/src/app/app.component.html @@ -0,0 +1,18 @@ + + + + Sfeir + + + + + + + Maps + List + + + + + Hello {{ name }} + \ No newline at end of file diff --git a/steps/hands-on-solution/src/app/app.component.ts b/steps/hands-on-solution/src/app/app.component.ts new file mode 100644 index 00000000..69c2609e --- /dev/null +++ b/steps/hands-on-solution/src/app/app.component.ts @@ -0,0 +1,14 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'sfeir-app', + templateUrl: 'app.component.html', + styleUrls: ['app.component.css'] +}) +export class PeopleAppComponent { + name: string; + + constructor() { + this.name = 'Angular 2'; + } +} diff --git a/steps/hands-on-solution/src/app/app.module.ts b/steps/hands-on-solution/src/app/app.module.ts new file mode 100644 index 00000000..8539ec6a --- /dev/null +++ b/steps/hands-on-solution/src/app/app.module.ts @@ -0,0 +1,42 @@ +// CORE DEPS +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +// MATERIAL DESIGN MODULES +import { + MatToolbarModule, + MatCardModule, + MatTabsModule, + MatButtonModule, + MatInputModule, + MatCheckboxModule, + MatRadioModule, + MatIconModule, + MatListModule +} from '@angular/material'; +import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; + +import { PeopleAppComponent } from './app.component'; + +@NgModule({ + imports: [ + BrowserModule, + BrowserAnimationsModule, + MatToolbarModule, + MatCardModule, + MatTabsModule, + MatButtonModule, + MatInputModule, + MatCheckboxModule, + MatRadioModule, + MatIconModule, + MatListModule + ], + declarations: [ + PeopleAppComponent + ], + providers: [ ], + bootstrap: [ + PeopleAppComponent + ] +}) +export class AppModule { } diff --git a/steps/hands-on-solution/src/app/index.ts b/steps/hands-on-solution/src/app/index.ts new file mode 100644 index 00000000..875bdb2f --- /dev/null +++ b/steps/hands-on-solution/src/app/index.ts @@ -0,0 +1,2 @@ +export * from './app.component'; +export * from './app.module'; diff --git a/steps/hands-on-solution/src/assets/.gitkeep b/steps/hands-on-solution/src/assets/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/steps/hands-on-solution/src/assets/.npmignore b/steps/hands-on-solution/src/assets/.npmignore new file mode 100644 index 00000000..e69de29b diff --git a/steps/hands-on-solution/src/assets/images/bg_right.png b/steps/hands-on-solution/src/assets/images/bg_right.png new file mode 100644 index 00000000..449e4bc8 Binary files /dev/null and b/steps/hands-on-solution/src/assets/images/bg_right.png differ diff --git a/steps/hands-on-solution/src/assets/images/icon-delete.svg b/steps/hands-on-solution/src/assets/images/icon-delete.svg new file mode 100644 index 00000000..c665bde5 --- /dev/null +++ b/steps/hands-on-solution/src/assets/images/icon-delete.svg @@ -0,0 +1 @@ + diff --git a/steps/hands-on-solution/src/assets/images/icon-edit.svg b/steps/hands-on-solution/src/assets/images/icon-edit.svg new file mode 100644 index 00000000..bb07333e --- /dev/null +++ b/steps/hands-on-solution/src/assets/images/icon-edit.svg @@ -0,0 +1 @@ + diff --git a/steps/hands-on-solution/src/assets/images/icon-mail.svg b/steps/hands-on-solution/src/assets/images/icon-mail.svg new file mode 100644 index 00000000..040a7e7f --- /dev/null +++ b/steps/hands-on-solution/src/assets/images/icon-mail.svg @@ -0,0 +1 @@ + diff --git a/steps/hands-on-solution/src/assets/images/icon-maps.svg b/steps/hands-on-solution/src/assets/images/icon-maps.svg new file mode 100644 index 00000000..989697e2 --- /dev/null +++ b/steps/hands-on-solution/src/assets/images/icon-maps.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/steps/hands-on-solution/src/assets/images/icon-phone.svg b/steps/hands-on-solution/src/assets/images/icon-phone.svg new file mode 100644 index 00000000..15ac4a3e --- /dev/null +++ b/steps/hands-on-solution/src/assets/images/icon-phone.svg @@ -0,0 +1 @@ + diff --git a/steps/hands-on-solution/src/assets/images/logo-sfeir.svg b/steps/hands-on-solution/src/assets/images/logo-sfeir.svg new file mode 100644 index 00000000..9d6e4c3e --- /dev/null +++ b/steps/hands-on-solution/src/assets/images/logo-sfeir.svg @@ -0,0 +1,18 @@ + + + + + + + + + diff --git a/steps/hands-on-solution/src/assets/images/search-icon.svg b/steps/hands-on-solution/src/assets/images/search-icon.svg new file mode 100644 index 00000000..92e95a18 --- /dev/null +++ b/steps/hands-on-solution/src/assets/images/search-icon.svg @@ -0,0 +1,16 @@ + + + + + + + diff --git a/steps/hands-on-solution/src/environments/environment.prod.ts b/steps/hands-on-solution/src/environments/environment.prod.ts new file mode 100644 index 00000000..f2259a71 --- /dev/null +++ b/steps/hands-on-solution/src/environments/environment.prod.ts @@ -0,0 +1,13 @@ +export const environment = { + production: true, + backend: { + protocol: 'http', + host: '127.0.0.1', + port: '9000', + endpoints: { + allPeople: '/api/peoples', + onePeople: '/api/peoples/:id', + randomPeople: '/api/peoples/random' + } + } +}; diff --git a/steps/hands-on-solution/src/environments/environment.ts b/steps/hands-on-solution/src/environments/environment.ts new file mode 100644 index 00000000..a47a8518 --- /dev/null +++ b/steps/hands-on-solution/src/environments/environment.ts @@ -0,0 +1,18 @@ +// The file contents for the current environment will overwrite these during build. +// The build system defaults to the dev environment which uses `environment.ts`, but if you do +// `ng build --env=prod` then `environment.prod.ts` will be used instead. +// The list of which env maps to which file can be found in `angular-cli.json`. + +export const environment = { + production: false, + backend: { + protocol: 'http', + host: '127.0.0.1', + port: '9000', + endpoints: { + allPeople: '/api/peoples', + onePeople: '/api/peoples/:id', + randomPeople: '/api/peoples/random' + } + } +}; diff --git a/steps/hands-on-solution/src/favicon.ico b/steps/hands-on-solution/src/favicon.ico new file mode 100644 index 00000000..8081c7ce Binary files /dev/null and b/steps/hands-on-solution/src/favicon.ico differ diff --git a/steps/hands-on-solution/src/index.html b/steps/hands-on-solution/src/index.html new file mode 100644 index 00000000..3a109430 --- /dev/null +++ b/steps/hands-on-solution/src/index.html @@ -0,0 +1,21 @@ + + + + + Angular200 + + + + + + + + +
+ + + +
+
+ + diff --git a/steps/hands-on-solution/src/main.ts b/steps/hands-on-solution/src/main.ts new file mode 100644 index 00000000..c7b673cf --- /dev/null +++ b/steps/hands-on-solution/src/main.ts @@ -0,0 +1,12 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.error(err)); diff --git a/steps/hands-on-solution/src/polyfills.ts b/steps/hands-on-solution/src/polyfills.ts new file mode 100644 index 00000000..ee8b84da --- /dev/null +++ b/steps/hands-on-solution/src/polyfills.ts @@ -0,0 +1,80 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; + +/** + * If the application will be indexed by Google Search, the following is required. + * Googlebot uses a renderer based on Chrome 41. + * https://developers.google.com/search/docs/guides/rendering + **/ +// import 'core-js/es6/array'; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** IE10 and IE11 requires the following for the Reflect API. */ +// import 'core-js/es6/reflect'; + +/** + * Web Animations `@angular/platform-browser/animations` + * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. + * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + */ + + // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + + /* + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + */ +// (window as any).__Zone_enable_cross_context_check = true; + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/steps/hands-on-solution/src/styles.css b/steps/hands-on-solution/src/styles.css new file mode 100644 index 00000000..15465c56 --- /dev/null +++ b/steps/hands-on-solution/src/styles.css @@ -0,0 +1,101 @@ +@import "~@angular/material/prebuilt-themes/indigo-pink.css"; + +body { + background: red; + padding: 0; + margin: 0; + font-family: 'Open Sans', sans-serif; + background-color: #FAFAFA; + -webkit-font-smoothing: antialiased; +} +* /deep/ * { + font-family: inherit; + font-size: 14px; + line-height: 1.42857143; + color: inherit; +} +h1, * /deep/ h1 { + font-size: 36px; + margin-top: 20px; + margin-bottom: 10px; +} + +button[mat-fab], a[mat-fab] { + position: fixed; + bottom: 20px; + right: 20px; +} + +[mat-fab] mat-icon { + font-size: 2em; + line-height: 18.6px; +} + +.loader { + position: relative; + margin: 0 auto; + width: 100px; + transform: scale(1.5); +} +.loader:before { + content: ''; + display: block; + padding-top: 100%; +} + +.circular { + animation: rotate 2s linear infinite; + height: 100%; + transform-origin: center center; + width: 100%; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: auto; +} + +.path { + stroke-dasharray: 1, 200; + stroke-dashoffset: 0; + animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite; + stroke-linecap: round; +} + +@keyframes rotate { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +@keyframes dash { + 0% { + stroke-dasharray: 1, 200; + stroke-dashoffset: 0; + } + 50% { + stroke-dasharray: 89, 200; + stroke-dashoffset: -35px; + } + 100% { + stroke-dasharray: 89, 200; + stroke-dashoffset: -124px; + } +} +@keyframes color { + 100%, + 0% { + stroke: #d62d20; + } + 40% { + stroke: #0057e7; + } + 66% { + stroke: #008744; + } + 80%, + 90% { + stroke: #ffa700; + } +} diff --git a/steps/hands-on-solution/tsconfig.app.json b/steps/hands-on-solution/tsconfig.app.json new file mode 100644 index 00000000..bb16c46a --- /dev/null +++ b/steps/hands-on-solution/tsconfig.app.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/app", + "types": [] + }, + "exclude": [ + "test.ts", + "**/*.spec.ts" + ] +} diff --git a/steps/hands-on/src/index.html b/steps/hands-on/src/index.html index 21baa458..3a109430 100644 --- a/steps/hands-on/src/index.html +++ b/steps/hands-on/src/index.html @@ -1,14 +1,21 @@ - + - HandsOn + Angular200 + - + +
+ + + +
+
diff --git a/steps/hands-on/src/styles.css b/steps/hands-on/src/styles.css index 90d4ee00..15465c56 100644 --- a/steps/hands-on/src/styles.css +++ b/steps/hands-on/src/styles.css @@ -1 +1,101 @@ -/* You can add global styles to this file, and also import other style files */ +@import "~@angular/material/prebuilt-themes/indigo-pink.css"; + +body { + background: red; + padding: 0; + margin: 0; + font-family: 'Open Sans', sans-serif; + background-color: #FAFAFA; + -webkit-font-smoothing: antialiased; +} +* /deep/ * { + font-family: inherit; + font-size: 14px; + line-height: 1.42857143; + color: inherit; +} +h1, * /deep/ h1 { + font-size: 36px; + margin-top: 20px; + margin-bottom: 10px; +} + +button[mat-fab], a[mat-fab] { + position: fixed; + bottom: 20px; + right: 20px; +} + +[mat-fab] mat-icon { + font-size: 2em; + line-height: 18.6px; +} + +.loader { + position: relative; + margin: 0 auto; + width: 100px; + transform: scale(1.5); +} +.loader:before { + content: ''; + display: block; + padding-top: 100%; +} + +.circular { + animation: rotate 2s linear infinite; + height: 100%; + transform-origin: center center; + width: 100%; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: auto; +} + +.path { + stroke-dasharray: 1, 200; + stroke-dashoffset: 0; + animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite; + stroke-linecap: round; +} + +@keyframes rotate { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +@keyframes dash { + 0% { + stroke-dasharray: 1, 200; + stroke-dashoffset: 0; + } + 50% { + stroke-dasharray: 89, 200; + stroke-dashoffset: -35px; + } + 100% { + stroke-dasharray: 89, 200; + stroke-dashoffset: -124px; + } +} +@keyframes color { + 100%, + 0% { + stroke: #d62d20; + } + 40% { + stroke: #0057e7; + } + 66% { + stroke: #008744; + } + 80%, + 90% { + stroke: #ffa700; + } +}