-
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
1 parent
ee2b805
commit 9b97068
Showing
9 changed files
with
104 additions
and
4 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
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,10 +1,13 @@ | ||
export class Artist { | ||
id: string; | ||
name: string; | ||
image: string; | ||
url: string; | ||
constructor(name: string, image: string, url: string) { | ||
constructor(id: string, name: string, image: string, url: string) { | ||
this.id = id; | ||
this.name = name; | ||
this.image = image; | ||
this.url = url; | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
client/src/app/pages/artists/artist-details/artist-details.component.css
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,20 @@ | ||
.overlay { | ||
display: flex; | ||
-webkit-box-pack: center; | ||
justify-content: center; | ||
-webkit-box-align: center; | ||
align-items: center; | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
border-radius: 50%; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
inset: 0; | ||
color: rgb(255, 255, 255); | ||
opacity: 0; | ||
transition: all 0.25s cubic-bezier(0.3, 0, 0.4, 1) 0s; | ||
} | ||
|
||
.img-container:hover .overlay { | ||
opacity: 1; | ||
} |
17 changes: 17 additions & 0 deletions
17
client/src/app/pages/artists/artist-details/artist-details.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,17 @@ | ||
<div class="h-full grid place-items-center" *ngIf="artist$ | async as artist"> | ||
<a class="flex flex-col items-center"> | ||
<div class="relative img-container cursor-pointer"> | ||
<div class="relative w-[200px] h-[200px] md:w-[280px] md:h-[280px] xl:w-[320px] xl:h-[320px] rounded-full overflow-hidden"> | ||
<img class="object-cover" [ngSrc]="artist.image" alt="artist" fill priority> | ||
</div> | ||
<div class="overlay"> | ||
<img ngSrc="/assets/icons/info.svg" class="w-5" alt="info" height="46" width="46"> | ||
</div> | ||
</div> | ||
<a class="mt-5" [href]="artist.url" target="_blank"> | ||
<p | ||
class="text-white text-2xl md:text-5xl xl:text-6xl font-bold cursor-pointer border-b border-transparent hover:border-white transition duration-300"> | ||
{{ artist.name }}</p> | ||
</a> | ||
</a> | ||
</div> |
35 changes: 35 additions & 0 deletions
35
client/src/app/pages/artists/artist-details/artist-details.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,35 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute } from "@angular/router"; | ||
import { Observable } from "rxjs"; | ||
import { Artist } from "../../../models/artist.model"; | ||
import { NgxUiLoaderService } from "ngx-ui-loader"; | ||
import { ArtistService } from "../../../services/artist.service"; | ||
|
||
@Component({ | ||
selector: 'app-artist-details', | ||
templateUrl: './artist-details.component.html', | ||
styleUrls: ['./artist-details.component.css'] | ||
}) | ||
export class ArtistDetailsComponent implements OnInit { | ||
id = ''; | ||
isLoading: boolean = true; | ||
artist$!: Observable<Artist | undefined>; | ||
|
||
constructor(private route: ActivatedRoute, private artistService: ArtistService, private ngxService: NgxUiLoaderService) { | ||
this.route.params.subscribe(params => { | ||
this.id = params['id']; | ||
}); | ||
} | ||
|
||
ngOnInit(): void { | ||
this.ngxService.startLoader("in-app-loader"); | ||
this.artist$ = this.getArtist(); | ||
this.isLoading = false; | ||
this.ngxService.stopLoader("in-app-loader"); | ||
} | ||
|
||
getArtist(): Observable<Artist | undefined> { | ||
return this.artistService.getArtist(this.id); | ||
} | ||
|
||
} |
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