From cfb905d54208a6882af79e8d4231ec94e5e97e2b Mon Sep 17 00:00:00 2001 From: Guilherme Borges Bastos Date: Sat, 13 Mar 2021 13:10:09 -0300 Subject: [PATCH 01/10] Add gesture library dependency --- package-lock.json | 5 +++++ package.json | 1 + src/main.ts | 3 +++ 3 files changed, 9 insertions(+) diff --git a/package-lock.json b/package-lock.json index 6c21fadf6..ad753e5fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6476,6 +6476,11 @@ "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "dev": true }, + "hammerjs": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz", + "integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE=" + }, "handle-thing": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", diff --git a/package.json b/package.json index fd8e8d9d7..0454beb4d 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "compass-mixins": "^0.12.10", "elliptic": "^6.5.3", "firebase": "^7.14.2", + "hammerjs": "^2.0.8", "http-proxy": "^1.18.1", "ini": "^1.3.8", "ng-navigator-share": "^1.0.3", diff --git a/src/main.ts b/src/main.ts index 24e4eb9ff..eed995f4c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,7 @@ import { enableProdMode } from "@angular/core"; import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; +import 'hammerjs'; import { AppModule } from "./app/app.module"; import { environment } from "./environments/environment"; @@ -8,5 +9,7 @@ if (environment.production) { enableProdMode(); } + + platformBrowserDynamic().bootstrapModule(AppModule) .catch((err) => console.error(err)); From cd54bb425d5f6c205ca8dd66ce38edbb74fbdee6 Mon Sep 17 00:00:00 2001 From: Guilherme Borges Bastos Date: Sat, 13 Mar 2021 13:11:38 -0300 Subject: [PATCH 02/10] Update Experience Section to handle mobile gesture --- src/app/app.module.ts | 22 +++++++++++++++++--- src/app/experience/experience.component.html | 10 ++++----- src/app/experience/experience.component.ts | 22 ++++++++++++++++++++ src/main.ts | 2 -- 4 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 87c85fce1..664a1552d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -18,10 +18,19 @@ import { AngularFireDatabaseModule } from "@angular/fire/database"; import { AngularFireAnalyticsModule } from "@angular/fire/analytics"; import { environment } from "../environments/environment"; +import { HammerModule, HammerGestureConfig, HAMMER_GESTURE_CONFIG } from "@angular/platform-browser"; +import * as Hammer from "hammerjs"; + +export class MyHammerConfig extends HammerGestureConfig { + overrides = { + swipe: { direction: Hammer.DIRECTION_ALL }, + }; +} + registerLocaleData(localeEn, "en"); registerLocaleData(localePt, "pt-BR", localePtExtra); @NgModule({ - imports: [ + imports: [ BrowserModule, AppRoutingModule, CoreModule, @@ -30,10 +39,17 @@ registerLocaleData(localePt, "pt-BR", localePtExtra); PageNotFoundRoutingModule, AngularFireModule.initializeApp(environment.firebaseConfig), AngularFireDatabaseModule, - AngularFireAnalyticsModule + AngularFireAnalyticsModule, + HammerModule ], declarations: [ AppComponent ], - bootstrap: [ AppComponent ] + bootstrap: [ AppComponent ], + providers: [ + { + provide: HAMMER_GESTURE_CONFIG, + useClass: MyHammerConfig, + }, + ] }) export class AppModule {} \ No newline at end of file diff --git a/src/app/experience/experience.component.html b/src/app/experience/experience.component.html index 530397eb1..1b0aa4a89 100644 --- a/src/app/experience/experience.component.html +++ b/src/app/experience/experience.component.html @@ -6,12 +6,12 @@

Experiences