-
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.
Merge pull request #11 from CerealKiller97/dev
Will finish soon
- Loading branch information
Showing
23 changed files
with
4,197 additions
and
838 deletions.
There are no files selected for viewing
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
Empty file.
1 change: 1 addition & 0 deletions
1
src/app/modules/gaming/components/game-profile/game-profile.component.html
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 @@ | ||
<p>game-profile works!</p> |
25 changes: 25 additions & 0 deletions
25
src/app/modules/gaming/components/game-profile/game-profile.component.spec.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { GameProfileComponent } from './game-profile.component'; | ||
|
||
describe('GameProfileComponent', () => { | ||
let component: GameProfileComponent; | ||
let fixture: ComponentFixture<GameProfileComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ GameProfileComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(GameProfileComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
45 changes: 45 additions & 0 deletions
45
src/app/modules/gaming/components/game-profile/game-profile.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Component, OnInit, OnDestroy } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { GamesService } from '@service/games/games.service'; | ||
import { Subscription } from 'rxjs'; | ||
import { Game } from '@model/Game'; | ||
|
||
@Component({ | ||
selector: 'app-game-profile', | ||
templateUrl: './game-profile.component.html', | ||
styleUrls: ['./game-profile.component.css'] | ||
}) | ||
export class GameProfileComponent implements OnInit, OnDestroy { | ||
private subscriptions: Array<Subscription> = new Array<Subscription>(); | ||
private gameSlug: string; | ||
public game: Game; | ||
|
||
constructor( | ||
private readonly router: Router, | ||
private readonly route: ActivatedRoute, | ||
private readonly gamingService: GamesService | ||
) {} | ||
|
||
public ngOnInit(): void { | ||
this.getGameSlug(); | ||
this.subscriptions.push( | ||
this.gamingService.getGame(this.gameSlug).subscribe((game: Game) => { | ||
console.log(game); | ||
}) | ||
); | ||
} | ||
|
||
private getGameSlug(): void { | ||
this.subscriptions.push( | ||
this.route.paramMap.subscribe(param => { | ||
this.gameSlug = param.get('game'); | ||
}) | ||
); | ||
} | ||
|
||
public ngOnDestroy(): void { | ||
for (const sub of this.subscriptions) { | ||
sub.unsubscribe(); | ||
} | ||
} | ||
} |
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 +1,27 @@ | ||
<p>game works!</p> | ||
<mat-card class="example-card"> | ||
<ng-template #name> | ||
|
||
</ng-template> | ||
|
||
<img mat-card-image [src]="game.background_image" [alt]="game.name" (hover)="imageToVideoReplace(game);" /> | ||
|
||
<mat-card-header> | ||
<div mat-card-avatar class="example-header-image"></div> | ||
<mat-card-title>{{ game.name | uppercase }}</mat-card-title> | ||
<mat-card-subtitle>Dog Breed</mat-card-subtitle> | ||
</mat-card-header> | ||
<mat-card-content> | ||
<p> | ||
The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan. | ||
A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally | ||
bred for hunting. | ||
</p> | ||
</mat-card-content> | ||
<mat-card-actions> | ||
<button mat-raised-button [routerLink]="['/gaming/game', game.slug]" color="primary">Read More</button> | ||
<button mat-raised-button (click)="addToWishList();"> | ||
<span>Add to WishList</span> | ||
<mat-icon>shopping_cart</mat-icon> | ||
</button> | ||
</mat-card-actions> | ||
</mat-card> |
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,11 +1,30 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Component, OnInit, Input } from '@angular/core'; | ||
import { Game } from '@model/Game'; | ||
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; | ||
|
||
@Component({ | ||
selector: 'app-game', | ||
templateUrl: './game.component.html', | ||
styleUrls: ['./game.component.css'] | ||
}) | ||
export class GameComponent implements OnInit { | ||
constructor() {} | ||
@Input() | ||
game: Game; | ||
|
||
constructor(private readonly matSnack: MatSnackBar) {} | ||
ngOnInit(): void {} | ||
|
||
public addToWishList(): void { | ||
const options: MatSnackBarConfig = { | ||
direction: 'ltr', | ||
duration: 4000, | ||
horizontalPosition: 'end', | ||
panelClass: ['success'] | ||
}; | ||
this.matSnack.open('Successfully added to your wishlist', null, options); | ||
} | ||
|
||
public imageToVideoReplace(game: Game) { | ||
console.log(game); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
.light-text { | ||
font-weight: 100 !important; | ||
} | ||
|
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,17 +1,16 @@ | ||
<mat-grid-list cols="1" rowHeight="2:1"> | ||
<mat-grid-tile> | ||
<h1 class="light-text">Welcome to VideoGamer</h1> | ||
<br /> | ||
<h5>Discover your new favorite game.</h5> | ||
<mat-form-field> | ||
<input matInput placeholder="label" value="value"> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Cars</mat-label> | ||
<select matNativeControl required> | ||
<option value="volvo">Volvo</option> | ||
</select> | ||
</mat-form-field> | ||
<button mat-raised-button color="primary" (click)="onClick();">Explore</button> | ||
</mat-grid-tile> | ||
</mat-grid-list> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col col-lg-6"> | ||
<h1 class="light-text">Welcome to VideoGamer</h1> | ||
<h5 class="ligt-text">Discover your new favorite game.</h5> | ||
<button mat-raised-button color="primary" (click)="onClick();">Explore</button> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<h1 class="light-text text-center">Most popular games</h1> | ||
<div class="col col-lg-4 col-sm-6"> | ||
<app-game *ngFor="let game of games" [game]="game"> | ||
</app-game> | ||
</div> | ||
</div> | ||
</div> |
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
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
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,7 +1,17 @@ | ||
import { Team } from '@model/Team'; | ||
import { Genre } from '@model/Genre.model'; | ||
import { Screenshoot } from '@model/Screenshot.model'; | ||
import { Platform } from '@model/Platform.model'; | ||
|
||
export interface Game { | ||
id: number; | ||
date: Date; | ||
homeTeam: Team; | ||
name: string; | ||
background_image: string; | ||
dominantColor: string; | ||
genres: Genre[]; | ||
metacritic: number; | ||
screenshots: Screenshoot[]; | ||
platforms: Platform[]; | ||
playtime: number; | ||
slug: string; | ||
realeseData: string; | ||
} |
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 @@ | ||
export interface Genre { | ||
id: number; | ||
backgroundImage: string; | ||
name: string; | ||
slug: string; | ||
} |
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,9 @@ | ||
export interface Platform { | ||
id: number; | ||
image: string | null; | ||
imageBackground: string | null; | ||
name: string; | ||
slug: string; | ||
yearEnd: any; | ||
yearStart: 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,4 @@ | ||
export interface Screenshoot { | ||
id: number; | ||
path: string; | ||
} |
Oops, something went wrong.
a62fd2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully aliased the URL https://ng-videogamer-bp1pcdnw5.now.sh to the following aliases: