mirror of
https://github.com/jwetzell/itsfiveoclockwhere.git
synced 2026-08-20 06:18:59 +00:00
add linting remove unimplemented tests
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
<div class="background" [@displayState]="state" (@displayState.start)="animationEvent($event)" (@displayState.done)="animationEvent($event)">
|
||||
<ng-container *ngIf="showAllItems; else single" >
|
||||
<div *ngFor="let timezone of timezones" class="container" [ngStyle]="{'height': timezones.length == 1 ? '100%' : 'auto'}">
|
||||
<h1 class="timezone">{{timezone.name.replace('_', ' ')}}</h1>
|
||||
<h2 class="time">{{timezone.time?.toFormat('tt')}}</h2>
|
||||
</div>
|
||||
</ng-container>
|
||||
<ng-template #single >
|
||||
<div *ngIf="closest" class="single-container">
|
||||
<h1 class="timezone">{{closest.name.replace('_', ' ')}}</h1>
|
||||
<h2 class="time">{{closest.time?.toFormat('tt')}}</h2>
|
||||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
<div
|
||||
class="background"
|
||||
[@displayState]="state"
|
||||
(@displayState.start)="animationEvent($event)"
|
||||
(@displayState.done)="animationEvent($event)">
|
||||
<ng-container *ngIf="showAllItems; else single">
|
||||
<div
|
||||
*ngFor="let timezone of timezones"
|
||||
class="container"
|
||||
[ngStyle]="{ height: timezones.length == 1 ? '100%' : 'auto' }">
|
||||
<h1 class="timezone">{{ timezone.name.replace('_', ' ') }}</h1>
|
||||
<h2 class="time">{{ timezone.time?.toFormat('tt') }}</h2>
|
||||
</div>
|
||||
</ng-container>
|
||||
<ng-template #single>
|
||||
<div *ngIf="closest" class="single-container">
|
||||
<h1 class="timezone">{{ closest.name.replace('_', ' ') }}</h1>
|
||||
<h2 class="time">{{ closest.time?.toFormat('tt') }}</h2>
|
||||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
|
||||
@@ -1,57 +1,57 @@
|
||||
.container {
|
||||
display:flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.single-container {
|
||||
display:flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 350px) {
|
||||
.timezone {
|
||||
font-size: 1.0em;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 0.5em
|
||||
}
|
||||
@media (max-width: 350px) {
|
||||
.timezone {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width:350px) and (max-width: 500px) {
|
||||
.timezone {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 1.0em
|
||||
}
|
||||
@media (min-width: 350px) and (max-width: 500px) {
|
||||
.timezone {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.timezone {
|
||||
font-family: "Open Sans", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
color: whitesmoke;
|
||||
margin-bottom: 0;
|
||||
font-family: 'Open Sans', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
color: whitesmoke;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-family: "Open Sans", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
color: whitesmoke;
|
||||
margin-top: 0;
|
||||
font-family: 'Open Sans', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
color: whitesmoke;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.background {
|
||||
background: #2e2e2e;
|
||||
height: 100%;
|
||||
}
|
||||
background: #2e2e2e;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
import { TimezoneListComponent } from './timezone-list.component';
|
||||
|
||||
describe('TimezoneListComponent', () => {
|
||||
let component: TimezoneListComponent;
|
||||
let fixture: ComponentFixture<TimezoneListComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ BrowserAnimationsModule ],
|
||||
declarations: [ TimezoneListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TimezoneListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
import { trigger, state, style, transition, animate, query, stagger } from '@angular/animations';
|
||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
||||
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
||||
import { Timezone } from '../../models/timezone.model';
|
||||
|
||||
@@ -6,53 +6,53 @@ import { Timezone } from '../../models/timezone.model';
|
||||
selector: 'app-timezone-list',
|
||||
templateUrl: './timezone-list.component.html',
|
||||
styleUrls: ['./timezone-list.component.scss'],
|
||||
animations:[
|
||||
trigger('displayState',[
|
||||
state('show', style({
|
||||
opacity : 1
|
||||
})),
|
||||
state('hide', style({
|
||||
opacity : 0
|
||||
})),
|
||||
animations: [
|
||||
trigger('displayState', [
|
||||
state(
|
||||
'show',
|
||||
style({
|
||||
opacity: 1,
|
||||
})
|
||||
),
|
||||
state(
|
||||
'hide',
|
||||
style({
|
||||
opacity: 0,
|
||||
})
|
||||
),
|
||||
transition('show=>hide', animate('450ms ease-out')),
|
||||
transition('hide=>show', animate('450ms ease-in'))
|
||||
])
|
||||
]
|
||||
transition('hide=>show', animate('450ms ease-in')),
|
||||
]),
|
||||
],
|
||||
})
|
||||
export class TimezoneListComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input() timezones: Timezone[] = [];
|
||||
@Input() closest?: Timezone;
|
||||
@Input() showAll: boolean = true;
|
||||
|
||||
showAllItems = true;
|
||||
|
||||
state: string = 'show'
|
||||
constructor(){}
|
||||
|
||||
state: string = 'show';
|
||||
constructor() {}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if(!!changes['showAll']){
|
||||
if(changes['showAll'].previousValue != changes['showAll'].currentValue){
|
||||
this.state = 'hide'
|
||||
}else{
|
||||
this.state = 'show'
|
||||
if (!!changes['showAll']) {
|
||||
if (changes['showAll'].previousValue != changes['showAll'].currentValue) {
|
||||
this.state = 'hide';
|
||||
} else {
|
||||
this.state = 'show';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
ngOnInit(): void {}
|
||||
|
||||
animationEvent($event: any){
|
||||
animationEvent($event: any) {
|
||||
// console.log(`${this.state} has entered ${$event.phaseName}`);
|
||||
if(this.state == 'hide' && $event.phaseName == 'done'){
|
||||
if (this.state == 'hide' && $event.phaseName == 'done') {
|
||||
this.showAllItems = this.showAll;
|
||||
this.state = 'show'
|
||||
}else if(this.state == 'show' && $event.phaseName == 'done'){
|
||||
|
||||
this.state = 'show';
|
||||
} else if (this.state == 'show' && $event.phaseName == 'done') {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TimezoneService } from './timezone.service';
|
||||
|
||||
describe('TimezoneService', () => {
|
||||
let service: TimezoneService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(TimezoneService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user