-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
2,484 additions
and
983 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { SECONDS_IN_DAY, SECONDS_IN_MONTH, SECONDS_IN_YEAR } from '../constants/time'; | ||
import { TimeThreshold } from './TimeThreshold'; | ||
|
||
const THRESHOLDS: TimeThreshold[] = [ | ||
new TimeThreshold('year', SECONDS_IN_YEAR), | ||
new TimeThreshold('month', SECONDS_IN_MONTH), | ||
new TimeThreshold('day', SECONDS_IN_DAY), | ||
].sort(TimeThreshold.sort); | ||
|
||
export class Duration { | ||
public lastTimeStr!: string; | ||
|
||
public get start(): Date { return this._start; } | ||
|
||
public set start(start: Date) { | ||
this._start = start; | ||
this.updateTimeStr(); | ||
} | ||
|
||
public get end(): Date { return this._end; } | ||
|
||
public set end(end: Date) { | ||
this._end = end; | ||
this.updateTimeStr(); | ||
} | ||
|
||
private updateTimeStr(): void { | ||
this.lastTimeStr = this.asString(); | ||
} | ||
|
||
/** @returns Time between end and start, in milliseconds */ | ||
public msPassed() : number { | ||
return this._end.getTime() - this._start.getTime(); | ||
} | ||
|
||
/** @returns approximate time passed during the duration */ | ||
public asString(): string { | ||
const msPassed = this.msPassed(); | ||
const secondsPassed = msPassed / 1000; | ||
|
||
const matchedThreshold = THRESHOLDS.find((threshold: TimeThreshold) => threshold.durationIsAtLeastThreshold(secondsPassed)) || THRESHOLDS[THRESHOLDS.length - 1]; | ||
|
||
const result: string = matchedThreshold.asString(secondsPassed, 'less than a day'); | ||
|
||
return result; | ||
} | ||
|
||
constructor( | ||
private _start: Date, | ||
private _end: Date, | ||
) { | ||
this.updateTimeStr(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export interface IEmployerOpts { | ||
name: string; | ||
website?: string; | ||
photoUrl?: string; | ||
} | ||
|
||
export class Employer implements IEmployerOpts { | ||
public name!: string; | ||
|
||
public website?: string | undefined; | ||
|
||
public photoUrl?: string | undefined; | ||
|
||
constructor(opts: IEmployerOpts) { | ||
Object.assign(this, opts); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Duration } from './Duration'; | ||
import { Employer } from './Employer'; | ||
|
||
export interface IJobOpts { | ||
title: string; | ||
timespan: Duration; | ||
employer: Employer; | ||
} | ||
|
||
export class Job implements IJobOpts { | ||
public title!: string; | ||
|
||
public timespan!: Duration; | ||
|
||
public employer!: Employer; | ||
|
||
constructor(opts: IJobOpts) { Object.assign(this, opts);} | ||
} |
4 changes: 2 additions & 2 deletions
4
src/app/classes/nav-item.class.ts → src/app/classes/NavItem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* | ||
export class ResumeItem { | ||
public job | ||
} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { IPicture } from '../interfaces/Picture'; | ||
import { Duration } from './Duration'; | ||
|
||
export interface ISkillOpts { | ||
label: string; | ||
description?: string; | ||
picture?: IPicture; | ||
acquired_at: Date; | ||
} | ||
|
||
export interface ISkillClassificationOpts { | ||
label: string; | ||
picture?: IPicture; | ||
skills: ISkillOpts[]; | ||
} | ||
|
||
export class SkillClassification implements ISkillClassificationOpts { | ||
public label!: string; | ||
|
||
public picture?: IPicture; | ||
|
||
public skills: Skill[] = []; | ||
|
||
constructor(opts: ISkillClassificationOpts) { | ||
Object.assign(this, opts); | ||
} | ||
} | ||
|
||
export class Skill implements ISkillOpts { | ||
public label!: string; | ||
|
||
public picture?: IPicture; | ||
|
||
public description?: string; | ||
|
||
public acquired_at!: Date; | ||
|
||
public duration!: Duration; | ||
|
||
constructor(opts: ISkillOpts) { | ||
Object.assign(this, opts); | ||
this.acquired_at = new Date(this.acquired_at); | ||
this.duration = new Duration(this.acquired_at, new Date()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { pluralString } from '../util/string'; | ||
|
||
export class TimeThreshold { | ||
public static sort(a: TimeThreshold, b: TimeThreshold) : -1 | 0 | 1 { | ||
if (a.minimumSeconds === b.minimumSeconds) return 0; | ||
|
||
if (a.minimumSeconds <= b.minimumSeconds) return 1; | ||
|
||
return -1; | ||
} | ||
|
||
public durationIsAtLeastThreshold(seconds: number): boolean { | ||
return this.minimumSeconds <= seconds; | ||
} | ||
|
||
public asString(seconds: number, fallback: string) { | ||
if (!this.durationIsAtLeastThreshold(seconds)) return fallback; | ||
|
||
const numOfDuration = Math.ceil(seconds / this.minimumSeconds); | ||
|
||
return `${numOfDuration} ${pluralString(this.singularBase, numOfDuration, this.pluralSuffix)}`; | ||
} | ||
|
||
|
||
constructor(public singularBase: string, public minimumSeconds: number, public pluralSuffix = 's') {} | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const SECONDS_IN_YEAR = 31536000; | ||
export const SECONDS_IN_MONTH = SECONDS_IN_YEAR / 12; | ||
export const SECONDS_IN_DAY = SECONDS_IN_YEAR / 365.24; |
2 changes: 1 addition & 1 deletion
2
...terfaces/attributed-resource.interface.ts → src/app/interfaces/AttributedResource.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface IFile { | ||
address: string; | ||
} |
2 changes: 1 addition & 1 deletion
2
src/app/interfaces/icon.interface.ts → src/app/interfaces/Icon.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export interface IICon { | ||
iconCode: string; | ||
class: string; | ||
style?: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { IFile } from './File'; | ||
|
||
export interface IImage { | ||
alt_text: string; | ||
file: IFile | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { IICon } from './Icon'; | ||
import { IImage } from './Image'; | ||
|
||
export interface IPicture { | ||
icon?: IICon; | ||
image?: IImage; | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/app/modules/shared/components/attribution/attribution.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/app/modules/shared/page-not-found/page-not-found.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.