From 93c050c5adbf2bba865b62fba74207b1b6703912 Mon Sep 17 00:00:00 2001 From: svensken Date: Wed, 16 Nov 2022 03:28:14 +0300 Subject: [PATCH] left menu collapse state added --- projects/ui/src/lib/avatar/avatar.component.scss | 2 +- projects/ui/src/lib/game/game.component.html | 6 +++--- projects/ui/src/lib/game/game.component.scss | 6 +++++- projects/ui/src/lib/game/game.component.ts | 1 + .../ui/src/lib/session/session.component.html | 6 +++--- .../ui/src/lib/session/session.component.scss | 6 +++++- projects/ui/src/lib/session/session.component.ts | 1 + projects/ui/src/lib/tag/tag.component.scss | 2 +- .../loading-screen/loading-screen.component.scss | 1 - .../main/main-menu/main-menu.component.html | 10 +++++----- .../main/main-menu/main-menu.component.scss | 15 ++++++++++++++- .../main/main-menu/main-menu.component.ts | 11 ++++++++++- .../menu-games/menu-games.component.html | 4 +++- .../menu-games/menu-games.component.scss | 5 +++++ .../main-menu/menu-games/menu-games.component.ts | 4 +++- .../menu-profile/menu-profile.component.html | 8 ++++---- .../menu-profile/menu-profile.component.ts | 4 +++- .../menu-sessions/menu-sessions.component.html | 4 +++- .../menu-sessions/menu-sessions.component.scss | 5 +++++ .../menu-sessions/menu-sessions.component.ts | 3 ++- 20 files changed, 77 insertions(+), 27 deletions(-) diff --git a/projects/ui/src/lib/avatar/avatar.component.scss b/projects/ui/src/lib/avatar/avatar.component.scss index 490f184..9ce0eb8 100644 --- a/projects/ui/src/lib/avatar/avatar.component.scss +++ b/projects/ui/src/lib/avatar/avatar.component.scss @@ -22,7 +22,7 @@ --local-size: 50px; } &[data-size="default"] { - --local-size: 42px; + --local-size: 40px; font-weight: 500; } &[data-size="small"] { diff --git a/projects/ui/src/lib/game/game.component.html b/projects/ui/src/lib/game/game.component.html index 368520e..dd39a74 100644 --- a/projects/ui/src/lib/game/game.component.html +++ b/projects/ui/src/lib/game/game.component.html @@ -1,12 +1,12 @@ -
+
-
+
{{game.title}}
description
- +
diff --git a/projects/ui/src/lib/game/game.component.scss b/projects/ui/src/lib/game/game.component.scss index cd01a0e..cd77f47 100644 --- a/projects/ui/src/lib/game/game.component.scss +++ b/projects/ui/src/lib/game/game.component.scss @@ -32,11 +32,15 @@ opacity: 0.5; cursor: pointer; + &.collapsed { + border-radius: 2rem; + } + .sk-game-info { flex: 1; display: flex; flex-direction: column; - gap: var(--sk-gap-m); + gap: var(--sk-gap-s); } } } diff --git a/projects/ui/src/lib/game/game.component.ts b/projects/ui/src/lib/game/game.component.ts index 222385f..609a386 100644 --- a/projects/ui/src/lib/game/game.component.ts +++ b/projects/ui/src/lib/game/game.component.ts @@ -9,6 +9,7 @@ import { LauncherService } from 'src/app/services/launcher.service'; }) export class GameComponent implements OnInit { @Input() game!: Game + @Input() collapsed = false constructor(private launcher: LauncherService) { } diff --git a/projects/ui/src/lib/session/session.component.html b/projects/ui/src/lib/session/session.component.html index fbf5d70..689d7aa 100644 --- a/projects/ui/src/lib/session/session.component.html +++ b/projects/ui/src/lib/session/session.component.html @@ -1,7 +1,7 @@ -
+
-
+
{{session.title}}
@@ -10,6 +10,6 @@ {{session.expires | countdown | async}}
- +
diff --git a/projects/ui/src/lib/session/session.component.scss b/projects/ui/src/lib/session/session.component.scss index 8270f48..6b69869 100644 --- a/projects/ui/src/lib/session/session.component.scss +++ b/projects/ui/src/lib/session/session.component.scss @@ -33,11 +33,15 @@ opacity: 0.5; cursor: pointer; + &.collapsed { + border-radius: 2rem; + } + .sk-session-info { flex: 1; display: flex; flex-direction: column; - gap: var(--sk-gap-m); + gap: var(--sk-gap-s); .info-heading-line { display: flex; diff --git a/projects/ui/src/lib/session/session.component.ts b/projects/ui/src/lib/session/session.component.ts index b01ff58..2096a63 100644 --- a/projects/ui/src/lib/session/session.component.ts +++ b/projects/ui/src/lib/session/session.component.ts @@ -10,6 +10,7 @@ import { LauncherService } from 'src/app/services/launcher.service' }) export class SessionComponent implements OnInit { @Input() session!: Session; + @Input() collapsed = false constructor( private launcher: LauncherService diff --git a/projects/ui/src/lib/tag/tag.component.scss b/projects/ui/src/lib/tag/tag.component.scss index 6f3175c..3c7b10d 100644 --- a/projects/ui/src/lib/tag/tag.component.scss +++ b/projects/ui/src/lib/tag/tag.component.scss @@ -8,7 +8,7 @@ .sk-tag { display: inline-flex; align-items: center; - padding: 2px var(--sk-gap-m); + padding: 0px var(--sk-gap-m); border-radius: var(--sk-br-s); background-color: rgba(255, 255, 255, 0.05); } diff --git a/src/app/components/loading-screen/loading-screen.component.scss b/src/app/components/loading-screen/loading-screen.component.scss index 88a8452..e7957c3 100644 --- a/src/app/components/loading-screen/loading-screen.component.scss +++ b/src/app/components/loading-screen/loading-screen.component.scss @@ -35,7 +35,6 @@ width: 140px; height: 140px; overflow: hidden; - background-color: var(--sk-item-active); mask-image: url('/assets/icon_mask.svg'); mask-size: cover; user-select: none; diff --git a/src/app/components/main/main-menu/main-menu.component.html b/src/app/components/main/main-menu/main-menu.component.html index 32c1f82..f027d23 100644 --- a/src/app/components/main/main-menu/main-menu.component.html +++ b/src/app/components/main/main-menu/main-menu.component.html @@ -1,9 +1,9 @@ @@ -26,8 +26,8 @@ Downloads
--> - - + +
- + diff --git a/src/app/components/main/main-menu/main-menu.component.scss b/src/app/components/main/main-menu/main-menu.component.scss index 917d275..a3dd381 100644 --- a/src/app/components/main/main-menu/main-menu.component.scss +++ b/src/app/components/main/main-menu/main-menu.component.scss @@ -2,6 +2,20 @@ display: block; width: 340px; + &.collapsed { + width: 75px; + + menu { + + .menu-search-panel { + + button { + flex: 1; + } + } + } + } + menu { display: flex; margin: 0; @@ -35,7 +49,6 @@ appearance: none; background: none; border: 0; - transition: 0.1s ease; border-radius: var(--sk-br-m); cursor: pointer; flex-shrink: 0; diff --git a/src/app/components/main/main-menu/main-menu.component.ts b/src/app/components/main/main-menu/main-menu.component.ts index a2850ad..276b2aa 100644 --- a/src/app/components/main/main-menu/main-menu.component.ts +++ b/src/app/components/main/main-menu/main-menu.component.ts @@ -1,5 +1,6 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, HostBinding, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; +import { LocalStorage } from 'ngx-webstorage' @Component({ selector: 'app-main-menu', @@ -9,7 +10,15 @@ import { FormControl } from '@angular/forms'; export class MainMenuComponent implements OnInit { search = new FormControl(''); + @HostBinding('class.collapsed') + @LocalStorage('menu-collapsed', false) + collapsed!: boolean + constructor() {} ngOnInit(): void {} + + toggle () { + this.collapsed = !this.collapsed + } } diff --git a/src/app/components/main/main-menu/menu-games/menu-games.component.html b/src/app/components/main/main-menu/menu-games/menu-games.component.html index c4f11b4..fd46624 100644 --- a/src/app/components/main/main-menu/menu-games/menu-games.component.html +++ b/src/app/components/main/main-menu/menu-games/menu-games.component.html @@ -1,9 +1,11 @@ - + Pinned games
{{games.length}}
+
\ No newline at end of file diff --git a/src/app/components/main/main-menu/menu-games/menu-games.component.scss b/src/app/components/main/main-menu/menu-games/menu-games.component.scss index fcfcd51..a13fedb 100644 --- a/src/app/components/main/main-menu/menu-games/menu-games.component.scss +++ b/src/app/components/main/main-menu/menu-games/menu-games.component.scss @@ -1,6 +1,11 @@ :host { display: block; + skirda-icon { + margin-bottom: 12px; + opacity: 0.5; + } + .games { display: flex; flex-direction: column; diff --git a/src/app/components/main/main-menu/menu-games/menu-games.component.ts b/src/app/components/main/main-menu/menu-games/menu-games.component.ts index 92b0b54..adc8bf0 100644 --- a/src/app/components/main/main-menu/menu-games/menu-games.component.ts +++ b/src/app/components/main/main-menu/menu-games/menu-games.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { Game } from 'src/app/interfaces/game.interface' import { GoGetGames } from 'src/app/services/go'; @@ -24,6 +24,8 @@ export class MenuGamesComponent implements OnInit { games: Game[] = [] + @Input() collapsed: boolean = false + constructor() { } ngOnInit(): void { diff --git a/src/app/components/main/main-menu/menu-profile/menu-profile.component.html b/src/app/components/main/main-menu/menu-profile/menu-profile.component.html index 66638ac..f8b764b 100644 --- a/src/app/components/main/main-menu/menu-profile/menu-profile.component.html +++ b/src/app/components/main/main-menu/menu-profile/menu-profile.component.html @@ -1,13 +1,13 @@ - -
+ +
{{profile.username}} online
-
+ -
+
diff --git a/src/app/components/main/main-menu/menu-profile/menu-profile.component.ts b/src/app/components/main/main-menu/menu-profile/menu-profile.component.ts index 7fa837d..f492145 100644 --- a/src/app/components/main/main-menu/menu-profile/menu-profile.component.ts +++ b/src/app/components/main/main-menu/menu-profile/menu-profile.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { LocalStorage } from 'ngx-webstorage' import { Profile } from 'src/app/interfaces/profile.interface' @@ -14,6 +14,8 @@ export class MenuProfileComponent implements OnInit { @LocalStorage('theme', 'dark') public theme!: string + @Input() collapsed = false + constructor() { } ngOnInit(): void { diff --git a/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.html b/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.html index 2849052..7dc962a 100644 --- a/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.html +++ b/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.html @@ -1,9 +1,11 @@ - + Active sessions
{{sessions.length}}
+
diff --git a/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.scss b/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.scss index b643a78..adb20f8 100644 --- a/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.scss +++ b/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.scss @@ -1,6 +1,11 @@ :host { display: block; + skirda-icon { + margin-bottom: 12px; + opacity: 0.5; + } + .sessions { display: flex; flex-direction: column; diff --git a/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.ts b/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.ts index 48bc2e5..b766194 100644 --- a/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.ts +++ b/src/app/components/main/main-menu/menu-sessions/menu-sessions.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { Session } from 'src/app/interfaces/session.interface'; import { GoGetSessions } from 'src/app/services/go'; @@ -33,6 +33,7 @@ export class MenuSessionsComponent implements OnInit { }, ]; sessions: Session[] = []; + @Input() collapsed = false constructor() {}