From 4bce077a76792c5073e5d651cf68be1ea26d166a Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Fri, 11 Nov 2022 10:13:19 -0600 Subject: [PATCH] cleanup --- src/app/app-routing.module.ts | 14 ----- src/app/app.component.html | 8 ++- src/app/app.component.ts | 58 +++++++++++++++--- src/app/app.module.ts | 4 -- src/app/fiveoclock/fiveoclock.component.html | 7 --- src/app/fiveoclock/fiveoclock.component.scss | 0 .../fiveoclock/fiveoclock.component.spec.ts | 25 -------- src/app/fiveoclock/fiveoclock.component.ts | 56 ----------------- src/favicon.ico | Bin 0 -> 15406 bytes src/index.html | 2 +- 10 files changed, 59 insertions(+), 115 deletions(-) delete mode 100644 src/app/app-routing.module.ts delete mode 100644 src/app/fiveoclock/fiveoclock.component.html delete mode 100644 src/app/fiveoclock/fiveoclock.component.scss delete mode 100644 src/app/fiveoclock/fiveoclock.component.spec.ts delete mode 100644 src/app/fiveoclock/fiveoclock.component.ts create mode 100644 src/favicon.ico diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts deleted file mode 100644 index 0abf337..0000000 --- a/src/app/app-routing.module.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { FiveoclockComponent } from './fiveoclock/fiveoclock.component'; -import { TimezoneListComponent } from './timezone/components/timezone-list/timezone-list.component'; - -const routes: Routes = [ - { path: '', component: FiveoclockComponent }, -]; - -@NgModule({ - imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] -}) -export class AppRoutingModule { } diff --git a/src/app/app.component.html b/src/app/app.component.html index 90c6b64..f85f4a0 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1 +1,7 @@ - \ No newline at end of file + + diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 5916a01..b2f5015 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,5 +1,9 @@ import { Component } from '@angular/core'; import { NavigationEnd, Router } from '@angular/router'; +import { interval, startWith } from 'rxjs'; +import { GoogleAnalyticsService } from './services/google-analytics.service'; +import { Timezone, GetClosestTimezoneFrom } from './timezone/models/timezone.model'; +import { TimezoneService } from './timezone/services/timezone.service'; declare let gtag: Function; @Component({ @@ -9,13 +13,53 @@ declare let gtag: Function; }) export class AppComponent { - constructor(public router: Router) { - this.router.events.subscribe(event => { - if (event instanceof NavigationEnd) { - gtag('config', 'G-48B6CKS0V6',{ - 'page_path': event.urlAfterRedirects - }); - } + fiveOclocks: Timezone[] = []; + fiveOclock: Timezone | undefined; + + showAll: boolean = false; + + timezones: string[] =[] + + constructor( + private timezoneService: TimezoneService, + private googleAnalyticsService: GoogleAnalyticsService, + private router:Router + ){ + this.router.events.subscribe(event => { + if (event instanceof NavigationEnd) { + gtag('config', 'G-48B6CKS0V6',{ + 'page_path': event.urlAfterRedirects + }); + } + }) + this.timezones = this.timezoneService.getTimezones() + var second = interval(1000).pipe(startWith(0)) + + second.subscribe(()=>{ + this.fiveOclocks = []; + this.timezoneService.getCurrentTimeInTimezones(this.timezones).forEach((timezoneObj)=>{ + if(timezoneObj.time?.hour === 17){ + this.fiveOclocks.push(timezoneObj); + } + }) + this.fiveOclock = GetClosestTimezoneFrom(this.timezoneService.getCurrentTimezone(), this.fiveOclocks) }) + + } + + ngOnInit(): void { } + + toggleView(){ + if(this.showAll){ + this.googleAnalyticsService.emitEvent('select_content', { + 'event_label' : 'timezone_closest', + }) + }else{ + this.googleAnalyticsService.emitEvent('select_content', { + 'event_label' : 'timezone_list', + }) + } + this.showAll = !this.showAll + } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 434a145..10c3180 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -4,20 +4,16 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppComponent } from './app.component'; import { TimezoneService } from './timezone/services/timezone.service'; -import { AppRoutingModule } from './app-routing.module'; import { TimezoneListComponent } from './timezone/components/timezone-list/timezone-list.component'; -import { FiveoclockComponent } from './fiveoclock/fiveoclock.component'; import { GoogleAnalyticsService } from './services/google-analytics.service'; @NgModule({ declarations: [ AppComponent, TimezoneListComponent, - FiveoclockComponent ], imports: [ BrowserModule, BrowserAnimationsModule, - AppRoutingModule ], providers: [ TimezoneService, diff --git a/src/app/fiveoclock/fiveoclock.component.html b/src/app/fiveoclock/fiveoclock.component.html deleted file mode 100644 index f85f4a0..0000000 --- a/src/app/fiveoclock/fiveoclock.component.html +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/src/app/fiveoclock/fiveoclock.component.scss b/src/app/fiveoclock/fiveoclock.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/fiveoclock/fiveoclock.component.spec.ts b/src/app/fiveoclock/fiveoclock.component.spec.ts deleted file mode 100644 index 9b75fdf..0000000 --- a/src/app/fiveoclock/fiveoclock.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { FiveoclockComponent } from './fiveoclock.component'; - -describe('FiveoclockComponent', () => { - let component: FiveoclockComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ FiveoclockComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(FiveoclockComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/fiveoclock/fiveoclock.component.ts b/src/app/fiveoclock/fiveoclock.component.ts deleted file mode 100644 index f8826bb..0000000 --- a/src/app/fiveoclock/fiveoclock.component.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { interval, startWith } from 'rxjs'; -import { GoogleAnalyticsService } from '../services/google-analytics.service'; -import { GetClosestTimezoneFrom, Timezone, TimezoneCompare, TimezoneList } from '../timezone/models/timezone.model'; -import { TimezoneService } from '../timezone/services/timezone.service'; - -@Component({ - selector: 'app-fiveoclock', - templateUrl: './fiveoclock.component.html', - styleUrls: ['./fiveoclock.component.scss'] -}) -export class FiveoclockComponent implements OnInit { - - fiveOclocks: Timezone[] = []; - fiveOclock: Timezone | undefined; - - showAll: boolean = false; - - timezones: string[] =[] - - constructor( - private timezoneService: TimezoneService, - private googleAnalyticsService: GoogleAnalyticsService - ){ - this.timezones = this.timezoneService.getTimezones() - var second = interval(1000).pipe(startWith(0)) - - second.subscribe(()=>{ - this.fiveOclocks = []; - this.timezoneService.getCurrentTimeInTimezones(this.timezones).forEach((timezoneObj)=>{ - if(timezoneObj.time?.hour === 17){ - this.fiveOclocks.push(timezoneObj); - } - }) - this.fiveOclock = GetClosestTimezoneFrom(this.timezoneService.getCurrentTimezone(), this.fiveOclocks) - }) - - } - - ngOnInit(): void { } - - toggleView(){ - if(this.showAll){ - this.googleAnalyticsService.emitEvent('select_content', { - 'event_label' : 'timezone_closest', - }) - }else{ - this.googleAnalyticsService.emitEvent('select_content', { - 'event_label' : 'timezone_list', - }) - } - this.showAll = !this.showAll - - } - -} diff --git a/src/favicon.ico b/src/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8818f96c32df85b8fcc4d15ff0266fe1e8a41d63 GIT binary patch literal 15406 zcmeHOYj9LW7QQa7%9c|2LKmSn3#gz-<;g2N!Xv>XLz4MM+4|o@d^!C|mF@F;Opn zKv8P%R+O2j0~T;-??D3o^1h&lS2xhPyau8nk|Vc)*86KDuaUMeUskP`R@ZB7WFGPQ z+R8lQ5qXC{e(+eB|JQ}RwB*x%weIBidniliyX)Okzpa-R zOZ-Cao$oNeh9|{Jq^GWw9hA&%gvq}N{3rA_{u2&AbnNB&$wjnS~iZ~n><>y2150#Og<$*H^(^kgV9$HC;nQ~d~amtr@=kIaT zt#3Lhsp6WU&4;jl@cX6J+I}E-?%UEs6E-;wxWu|5%L$Y>%b#1N$)8hZlt0tbr^*-m zk&w^((rv(%TQ{)3aT&hpKVwZ zzQ&ftRKAt^AF|M`0>eo4{}C%qODU!4yeFXFSJl4jW0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y%Ce6+{{P2m5@@c)5@42j=9jzw9$s%itF_^NQz4 z@u!v1RGd@Kn9r*0A6~py^Ggd^f-+Y2ug^z6=ay-S^TOB87dqvB zncEi6T*iG9&w}#!W@B!0%Bs=gg?W7Z;h$4XQ^0pl@Cs_i-_p`@=haTzTbJ8yPT5z+ zF~L>eI_T+7+{Auw!OxU^_&hfA@%}l)NWOa5MSn-)e0r%@t;;;z|Cg$-(LYf34BDB; z^Acm>o2O`t$4u=jV#+wKEYV8$!@s)>ayWLmPnOGh89x!-1k79EpY!YI>wpjPF#P*j ze*ETZ;OF0i{+(~L(WQ1RalYak2W9W{&`R)B!r%QpeDcr@oolnxrp6wF9t1W$j^QGn zMdG+Pwlr6K3q2pZ_)|dtD#sUm z2p)60tdD)?y3`niAJ8vu>#4o{l!kFJV1%9nJiBp^_^N`~3+R4aM@PqNkl``Q3HHo- z4pxV;2CKv6jnE7CAplUXSnkMce_c zN!w0SdCm*$Oh*%bj8V|I6d8LQe`sqEt z2L2ZyuX{K$qsZe$TOWpk*IdWxbl!`uTce02tTBRY#(olX*zpgSFJHb3ZTu5saUL}6 fy?8i%*KylH3mLn`Vj1-R53{c0&v6YzQv?480pG*d literal 0 HcmV?d00001 diff --git a/src/index.html b/src/index.html index d6ada37..feb08b4 100644 --- a/src/index.html +++ b/src/index.html @@ -6,7 +6,7 @@ itsfiveoclockwhere - + ng serv