mirror of
https://github.com/PhoenixTwoFive/karaoqueue.git
synced 2025-05-20 11:31:49 +02:00
Updates to search page
This commit is contained in:
parent
673fde9ee6
commit
578adaf893
@ -4,7 +4,7 @@ import { Artist } from './artist.model';
|
|||||||
|
|
||||||
export class Song {
|
export class Song {
|
||||||
|
|
||||||
constructor(title: string, artist: Artist, karafun_id: number, duet: boolean, explicit: boolean, id: number, genres: Array<Genre>, languages: Array<Language>) {
|
constructor(title: string, artist: Artist, karafun_id: number, duet: boolean, explicit: boolean, id: number, genres: Array<String>, languages: Array<String>) {
|
||||||
this.title=title;
|
this.title=title;
|
||||||
this.artist=artist;
|
this.artist=artist;
|
||||||
this.karafun_id=karafun_id;
|
this.karafun_id=karafun_id;
|
||||||
@ -21,6 +21,6 @@ export class Song {
|
|||||||
duet: boolean;
|
duet: boolean;
|
||||||
explicit: boolean;
|
explicit: boolean;
|
||||||
id: number;
|
id: number;
|
||||||
genres: Array<Genre>;
|
genres: Array<String>;
|
||||||
languages: Array<Language>;
|
languages: Array<String>;
|
||||||
}
|
}
|
||||||
|
@ -1,30 +1,48 @@
|
|||||||
<mat-form-field>
|
<div class="content">
|
||||||
<mat-label>Suche...</mat-label>
|
<mat-form-field class="search-input">
|
||||||
<input matInput placeholder="Tippe einen Künstler oder Song..."
|
<mat-label>Suche...</mat-label>
|
||||||
|
<mat-icon matSuffix svgIcon="magnify"></mat-icon>
|
||||||
|
<input type="text" matInput placeholder="Tippe einen Künstler oder Song..."
|
||||||
(keyup)="applyFilter($event.target.value)">
|
(keyup)="applyFilter($event.target.value)">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-list *ngFor="let song of songs">
|
</div>
|
||||||
<mat-card>
|
<div class="resultcontainer">
|
||||||
<mat-card-title>{{song.artist.name}} - {{song.title}}</mat-card-title>
|
<mat-list *ngFor="let song of songs">
|
||||||
<mat-card-content>
|
<mat-card class="result">
|
||||||
<ng-template [ngIf]="song.duet==true" [ngIfElse]="nonduet">
|
<div class="card-left">
|
||||||
<mat-icon svgIcon="account-multiple"></mat-icon>
|
<mat-card-title>{{song.artist}} - {{song.title}}</mat-card-title>
|
||||||
</ng-template>
|
<div class="song-info">
|
||||||
<ng-template #nonduet>
|
<div class="info-icons">
|
||||||
<mat-icon svgIcon="account"></mat-icon>
|
<ng-template [ngIf]="song.duet==true" [ngIfElse]="nonduet">
|
||||||
</ng-template>
|
<mat-icon svgIcon="account-multiple"></mat-icon>
|
||||||
<ng-template [ngIf]="song.explicit==true" [ngIfElse]="nonexplicit">
|
</ng-template>
|
||||||
<mat-icon svgIcon="alpha-e-box"></mat-icon>
|
<ng-template #nonduet>
|
||||||
</ng-template>
|
<mat-icon svgIcon="account"></mat-icon>
|
||||||
<ng-template #nonexplicit>
|
</ng-template>
|
||||||
<mat-icon svgIcon="alpha-e-box" style="visibility: hidden;"></mat-icon>
|
<ng-template [ngIf]="song.explicit==true" [ngIfElse]="nonexplicit">
|
||||||
</ng-template>
|
<mat-icon svgIcon="alpha-e-box"></mat-icon>
|
||||||
{{song.genres[0].name}} {{song.languages[0].name}}
|
</ng-template>
|
||||||
</mat-card-content>
|
<ng-template #nonexplicit>
|
||||||
<button mat-flat-button color="accent">
|
<mat-icon svgIcon="alpha-e-box" class="icon-disabled"></mat-icon>
|
||||||
<mat-icon svgIcon="playlist-plus"></mat-icon>
|
</ng-template>
|
||||||
</button>
|
</div>
|
||||||
<mat-card-actions>
|
<div class="genre-list">
|
||||||
</mat-card-actions>
|
<mat-icon svgIcon="music-circle"></mat-icon>
|
||||||
</mat-card>
|
<mat-chip-list *ngFor="let genre of song.genres">
|
||||||
</mat-list>
|
<mat-chip>{{genre}}</mat-chip>
|
||||||
|
</mat-chip-list>
|
||||||
|
</div>
|
||||||
|
<div class="language-list">
|
||||||
|
<mat-icon svgIcon="account-voice"></mat-icon>
|
||||||
|
<mat-chip-list *ngFor="let language of song.languages">
|
||||||
|
<mat-chip>{{language}}</mat-chip>
|
||||||
|
</mat-chip-list>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button mat-flat-button color="accent" class="add-button">
|
||||||
|
<mat-icon svgIcon="playlist-plus"></mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card>
|
||||||
|
</mat-list>
|
||||||
|
</div>
|
||||||
|
@ -0,0 +1,119 @@
|
|||||||
|
.search-input {
|
||||||
|
width: 95%;
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-button {
|
||||||
|
height: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.resultcontainer {
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.result {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
width: 90%;
|
||||||
|
margin-top: 0.2rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: stretch;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-left {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.song-info {
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.song-info > * {
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-disabled {
|
||||||
|
opacity: 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.genre-list > mat-icon {
|
||||||
|
padding-right: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.genre-list mat-chip-list {
|
||||||
|
margin-right: 0.15rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.genre-list {
|
||||||
|
overflow-x: scroll;
|
||||||
|
overflow-y: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
padding-bottom: 0.25rem;
|
||||||
|
align-items: center;
|
||||||
|
-webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 2px,rgba(0,0,0,1) calc(100% - 2px),rgba(0,0,0,0) 100%);
|
||||||
|
mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 2px,rgba(0,0,0,1) calc(100% - 2px),rgba(0,0,0,0) 100%);
|
||||||
|
-ms-overflow-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.language-list > mat-icon {
|
||||||
|
padding-right: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.language-list mat-chip-list {
|
||||||
|
margin-right: 0.15rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.genre-list::-webkit-scrollbar {
|
||||||
|
width: 0px;
|
||||||
|
height: 0px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.language-list {
|
||||||
|
overflow-x: scroll;
|
||||||
|
overflow-y: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
padding-bottom: 0.25rem;
|
||||||
|
align-items: center;
|
||||||
|
-ms-overflow-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.language-list::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$breakpoint-tablet: 768px;
|
||||||
|
@media (min-width: $breakpoint-tablet) {
|
||||||
|
.result {
|
||||||
|
flex-direction: row;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-button {
|
||||||
|
max-height: 100%;
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
}
|
@ -27,7 +27,7 @@ export class SongServiceService {
|
|||||||
|
|
||||||
this.http.get(this.api +"/songs/compl?search="+text).subscribe((data: Observable<JSON>) => {
|
this.http.get(this.api +"/songs/compl?search="+text).subscribe((data: Observable<JSON>) => {
|
||||||
data.forEach(element => {
|
data.forEach(element => {
|
||||||
out.push(new Song(element["Title"],new Artist(42,element["Artist"]),element["Id"],element["Duo"],element["Explicit"],42,[new Genre(42,element["Styles"])],[new Language(42, element["Languages"])]));
|
out.push(new Song(element["title"],element["artist"],element["karafun_id"],element["duo"],element["explicit"],element["_id"],element["styles"],element["languages"]));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user