Skip to content

Commit

Permalink
Fix layout for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirko committed Aug 6, 2022
1 parent b1a779d commit 6c75723
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
28 changes: 19 additions & 9 deletions noSpotify-Frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,22 @@ export class AppComponent implements OnInit {
return this.accountService.userValue.id;
}


clickEvent() {
this.status = !this.status;

if (this.screenWidth < 800) {
if (this.status) document.getElementById("page-content-wrapper").style.display = "none"
else document.getElementById("page-content-wrapper").style.display = "block"

}

}


logout() {
if(this.screenWidth<800)
this.clickEvent();
if (this.screenWidth < 800)
this.clickEvent();
this.accountService.logout();

this.snotifyService.success("Logout effettuato", {
Expand Down Expand Up @@ -179,18 +189,18 @@ export class AppComponent implements OnInit {
}

search() {
if(this.screenWidth<800)
this.clickEvent();
setTimeout(() => {
if (this.screenWidth < 800)
this.clickEvent();
setTimeout(() => {
let searchTitle = (document.getElementById("searchBox") as HTMLInputElement).value
this.router.navigate(['search', searchTitle]);
}, 100);

}

onKeyDownEvent(event: any) {
if(this.screenWidth<800)
this.clickEvent();
if (this.screenWidth < 800)
this.clickEvent();
let searchTitle = (document.getElementById("searchBox") as HTMLInputElement).value

this.router.navigate(['search', searchTitle]);
Expand All @@ -208,8 +218,8 @@ export class AppComponent implements OnInit {


openPlaylistList() {
if(this.screenWidth<800)
this.clickEvent();
if (this.screenWidth < 800)
this.clickEvent();

const modalRef = this.modalService.open(PlaylistListComponent, { size: 'xl' });
// modalRef.componentInstance.name = 'World';
Expand Down
2 changes: 1 addition & 1 deletion noSpotify-Frontend/src/app/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="p-4 wrapHome">
<div class="containerHome filterBrightness" style="background-image: url('../../assets//img/backgroundcover.jpg')">

<div class="d-flex justify-content-center align-items-center flex-column h-100 w-100 ">
<div class="d-flex mt-3 justify-content-start align-items-center flex-column h-100 w-100 ">
<!-- <div class=" d-flex justify-content-center"> -->
<img src="../../assets/img/nospotifylogo.png" class="filterShadow wLogoMobile">

Expand Down
4 changes: 2 additions & 2 deletions noSpotify-Frontend/src/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ body {
#sidebar-wrapper {
border-right: 3px solid #bfbaba !important;
min-height: 100vh;
margin-left: -22rem;
margin-left: -21.5rem;
-webkit-transition: margin .25s ease-out;
-moz-transition: margin .25s ease-out;
-o-transition: margin .25s ease-out;
Expand Down Expand Up @@ -164,7 +164,7 @@ body {
}

.hide {
margin-left: -22rem !important;
margin-left: -21.5rem !important;
}
}

Expand Down

0 comments on commit 6c75723

Please sign in to comment.