left menu collapse state added
This commit is contained in:
parent
1c009c5d3e
commit
93c050c5ad
@ -22,7 +22,7 @@
|
|||||||
--local-size: 50px;
|
--local-size: 50px;
|
||||||
}
|
}
|
||||||
&[data-size="default"] {
|
&[data-size="default"] {
|
||||||
--local-size: 42px;
|
--local-size: 40px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
&[data-size="small"] {
|
&[data-size="small"] {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<a [routerLink]="['/game/' + game.gameId]" routerLinkActive="active">
|
<a [routerLink]="['/game/' + game.gameId]" routerLinkActive="active">
|
||||||
<div class="sk-game">
|
<div class="sk-game" [ngClass]="{collapsed}">
|
||||||
<skirda-image-icon [src]="game.image"></skirda-image-icon>
|
<skirda-image-icon [src]="game.image"></skirda-image-icon>
|
||||||
<div class="sk-game-info">
|
<div class="sk-game-info" *ngIf="!collapsed">
|
||||||
<div class="info-game-line">
|
<div class="info-game-line">
|
||||||
<skirda-heading size="6">{{game.title}}</skirda-heading>
|
<skirda-heading size="6">{{game.title}}</skirda-heading>
|
||||||
</div>
|
</div>
|
||||||
<skirda-text>description</skirda-text>
|
<skirda-text>description</skirda-text>
|
||||||
</div>
|
</div>
|
||||||
<skirda-icon name="play" size="24" (click)="run(game)" color="var(--sk-primary-accent)"></skirda-icon>
|
<skirda-icon *ngIf="!collapsed" name="play" size="24" (click)="run(game)" color="var(--sk-primary-accent)"></skirda-icon>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -32,11 +32,15 @@
|
|||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
&.collapsed {
|
||||||
|
border-radius: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
.sk-game-info {
|
.sk-game-info {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--sk-gap-m);
|
gap: var(--sk-gap-s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import { LauncherService } from 'src/app/services/launcher.service';
|
|||||||
})
|
})
|
||||||
export class GameComponent implements OnInit {
|
export class GameComponent implements OnInit {
|
||||||
@Input() game!: Game
|
@Input() game!: Game
|
||||||
|
@Input() collapsed = false
|
||||||
|
|
||||||
constructor(private launcher: LauncherService) { }
|
constructor(private launcher: LauncherService) { }
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<a [routerLink]="['/session/' + session.gameId]" routerLinkActive="active" [title]="session.status ?? 'No status'">
|
<a [routerLink]="['/session/' + session.gameId]" routerLinkActive="active" [title]="session.status ?? 'No status'">
|
||||||
<div class="sk-session">
|
<div class="sk-session" [ngClass]="{collapsed}">
|
||||||
<skirda-image-icon [src]="session.icon"></skirda-image-icon>
|
<skirda-image-icon [src]="session.icon"></skirda-image-icon>
|
||||||
<div class="sk-session-info">
|
<div class="sk-session-info" *ngIf="!collapsed">
|
||||||
<div class="info-heading-line">
|
<div class="info-heading-line">
|
||||||
<skirda-heading size="6">{{session.title}}</skirda-heading>
|
<skirda-heading size="6">{{session.title}}</skirda-heading>
|
||||||
</div>
|
</div>
|
||||||
@ -10,6 +10,6 @@
|
|||||||
<skirda-tag>{{session.expires | countdown | async}}</skirda-tag>
|
<skirda-tag>{{session.expires | countdown | async}}</skirda-tag>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<skirda-icon name="play" size="24" (click)="run(session)" color="var(--sk-primary-accent)"></skirda-icon>
|
<skirda-icon *ngIf="!collapsed" name="play" size="24" (click)="run(session)" color="var(--sk-primary-accent)"></skirda-icon>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -33,11 +33,15 @@
|
|||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
&.collapsed {
|
||||||
|
border-radius: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
.sk-session-info {
|
.sk-session-info {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--sk-gap-m);
|
gap: var(--sk-gap-s);
|
||||||
|
|
||||||
.info-heading-line {
|
.info-heading-line {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -10,6 +10,7 @@ import { LauncherService } from 'src/app/services/launcher.service'
|
|||||||
})
|
})
|
||||||
export class SessionComponent implements OnInit {
|
export class SessionComponent implements OnInit {
|
||||||
@Input() session!: Session;
|
@Input() session!: Session;
|
||||||
|
@Input() collapsed = false
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private launcher: LauncherService
|
private launcher: LauncherService
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
.sk-tag {
|
.sk-tag {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 2px var(--sk-gap-m);
|
padding: 0px var(--sk-gap-m);
|
||||||
border-radius: var(--sk-br-s);
|
border-radius: var(--sk-br-s);
|
||||||
background-color: rgba(255, 255, 255, 0.05);
|
background-color: rgba(255, 255, 255, 0.05);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
width: 140px;
|
width: 140px;
|
||||||
height: 140px;
|
height: 140px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: var(--sk-item-active);
|
|
||||||
mask-image: url('/assets/icon_mask.svg');
|
mask-image: url('/assets/icon_mask.svg');
|
||||||
mask-size: cover;
|
mask-size: cover;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<menu>
|
<menu>
|
||||||
<div class="menu-search-panel">
|
<div class="menu-search-panel">
|
||||||
<skirda-input [formControl]="search" size="l" placeholder="Quick search">
|
<skirda-input *ngIf="!collapsed" [formControl]="search" size="l" placeholder="Quick search">
|
||||||
<skirda-icon name="search" size="18" role="left"></skirda-icon>
|
<skirda-icon name="search" size="18" role="left"></skirda-icon>
|
||||||
</skirda-input>
|
</skirda-input>
|
||||||
<button>
|
<button (click)="toggle()">
|
||||||
<skirda-icon name="menu-panel" color="var(--sk-primary-accent)"></skirda-icon>
|
<skirda-icon name="menu-panel" color="var(--sk-primary-accent)"></skirda-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -26,8 +26,8 @@
|
|||||||
<skirda-heading size="6">Downloads</skirda-heading>
|
<skirda-heading size="6">Downloads</skirda-heading>
|
||||||
</skirda-section>
|
</skirda-section>
|
||||||
</div> -->
|
</div> -->
|
||||||
<app-menu-games></app-menu-games>
|
<app-menu-games [collapsed]="collapsed"></app-menu-games>
|
||||||
<app-menu-sessions></app-menu-sessions>
|
<app-menu-sessions [collapsed]="collapsed"></app-menu-sessions>
|
||||||
</div>
|
</div>
|
||||||
<app-menu-profile></app-menu-profile>
|
<app-menu-profile [collapsed]="collapsed"></app-menu-profile>
|
||||||
</menu>
|
</menu>
|
||||||
|
@ -2,6 +2,20 @@
|
|||||||
display: block;
|
display: block;
|
||||||
width: 340px;
|
width: 340px;
|
||||||
|
|
||||||
|
&.collapsed {
|
||||||
|
width: 75px;
|
||||||
|
|
||||||
|
menu {
|
||||||
|
|
||||||
|
.menu-search-panel {
|
||||||
|
|
||||||
|
button {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
menu {
|
menu {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -35,7 +49,6 @@
|
|||||||
appearance: none;
|
appearance: none;
|
||||||
background: none;
|
background: none;
|
||||||
border: 0;
|
border: 0;
|
||||||
transition: 0.1s ease;
|
|
||||||
border-radius: var(--sk-br-m);
|
border-radius: var(--sk-br-m);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, HostBinding, OnInit } from '@angular/core';
|
||||||
import { FormControl } from '@angular/forms';
|
import { FormControl } from '@angular/forms';
|
||||||
|
import { LocalStorage } from 'ngx-webstorage'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-main-menu',
|
selector: 'app-main-menu',
|
||||||
@ -9,7 +10,15 @@ import { FormControl } from '@angular/forms';
|
|||||||
export class MainMenuComponent implements OnInit {
|
export class MainMenuComponent implements OnInit {
|
||||||
search = new FormControl<string>('');
|
search = new FormControl<string>('');
|
||||||
|
|
||||||
|
@HostBinding('class.collapsed')
|
||||||
|
@LocalStorage('menu-collapsed', false)
|
||||||
|
collapsed!: boolean
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
ngOnInit(): void {}
|
ngOnInit(): void {}
|
||||||
|
|
||||||
|
toggle () {
|
||||||
|
this.collapsed = !this.collapsed
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
<skirda-section-label>
|
<skirda-section-label *ngIf="!collapsed">
|
||||||
Pinned games <div class="count">{{games.length}}</div>
|
Pinned games <div class="count">{{games.length}}</div>
|
||||||
</skirda-section-label>
|
</skirda-section-label>
|
||||||
|
<skirda-icon name="library" size="20" *ngIf="collapsed"></skirda-icon>
|
||||||
<div class="games">
|
<div class="games">
|
||||||
<skirda-game
|
<skirda-game
|
||||||
*ngFor="let game of games; index as i"
|
*ngFor="let game of games; index as i"
|
||||||
[game]="game"
|
[game]="game"
|
||||||
|
[collapsed]="collapsed"
|
||||||
></skirda-game>
|
></skirda-game>
|
||||||
</div>
|
</div>
|
@ -1,6 +1,11 @@
|
|||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
|
skirda-icon {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
.games {
|
.games {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -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 { Game } from 'src/app/interfaces/game.interface'
|
||||||
import { GoGetGames } from 'src/app/services/go';
|
import { GoGetGames } from 'src/app/services/go';
|
||||||
|
|
||||||
@ -24,6 +24,8 @@ export class MenuGamesComponent implements OnInit {
|
|||||||
|
|
||||||
games: Game[] = []
|
games: Game[] = []
|
||||||
|
|
||||||
|
@Input() collapsed: boolean = false
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<a [routerLink]="['profile']" routerLinkActive="active" class="profile-area">
|
<a [routerLink]="['profile']" routerLinkActive="active" class="profile-area">
|
||||||
<skirda-avatar [username]="profile.username" size="small"></skirda-avatar>
|
<skirda-avatar [username]="profile.username" size="default"></skirda-avatar>
|
||||||
<div class="profile-info">
|
<div class="profile-info" *ngIf="!collapsed">
|
||||||
<skirda-heading size="6">{{profile.username}}</skirda-heading>
|
<skirda-heading size="6">{{profile.username}}</skirda-heading>
|
||||||
<skirda-text>online</skirda-text>
|
<skirda-text>online</skirda-text>
|
||||||
</div>
|
</div>
|
||||||
<a [routerLink]="['settings']">
|
<a [routerLink]="['settings']" *ngIf="!collapsed">
|
||||||
<skirda-icon name="settings" color="var(--sk-primary-accent)"></skirda-icon>
|
<skirda-icon name="settings" color="var(--sk-primary-accent)"></skirda-icon>
|
||||||
</a>
|
</a>
|
||||||
</a>
|
</a>
|
||||||
<div class="theme-toggle" (click)="toggleTheme()" [ngClass]="{'active': theme === 'light'}">
|
<div class="theme-toggle" *ngIf="!collapsed" (click)="toggleTheme()" [ngClass]="{'active': theme === 'light'}">
|
||||||
<skirda-icon name="sun" color="var(--sk-primary-accent)"></skirda-icon>
|
<skirda-icon name="sun" color="var(--sk-primary-accent)"></skirda-icon>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { LocalStorage } from 'ngx-webstorage'
|
import { LocalStorage } from 'ngx-webstorage'
|
||||||
import { Profile } from 'src/app/interfaces/profile.interface'
|
import { Profile } from 'src/app/interfaces/profile.interface'
|
||||||
|
|
||||||
@ -14,6 +14,8 @@ export class MenuProfileComponent implements OnInit {
|
|||||||
@LocalStorage('theme', 'dark')
|
@LocalStorage('theme', 'dark')
|
||||||
public theme!: string
|
public theme!: string
|
||||||
|
|
||||||
|
@Input() collapsed = false
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
<skirda-section-label>
|
<skirda-section-label *ngIf="!collapsed">
|
||||||
Active sessions <div class="count">{{sessions.length}}</div>
|
Active sessions <div class="count">{{sessions.length}}</div>
|
||||||
</skirda-section-label>
|
</skirda-section-label>
|
||||||
|
<skirda-icon name="server" size="20" *ngIf="collapsed"></skirda-icon>
|
||||||
<div class="sessions">
|
<div class="sessions">
|
||||||
<skirda-session
|
<skirda-session
|
||||||
*ngFor="let session of sessions; index as i"
|
*ngFor="let session of sessions; index as i"
|
||||||
[session]="session"
|
[session]="session"
|
||||||
|
[collapsed]="collapsed"
|
||||||
></skirda-session>
|
></skirda-session>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
|
skirda-icon {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
.sessions {
|
.sessions {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -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 { Session } from 'src/app/interfaces/session.interface';
|
||||||
import { GoGetSessions } from 'src/app/services/go';
|
import { GoGetSessions } from 'src/app/services/go';
|
||||||
|
|
||||||
@ -33,6 +33,7 @@ export class MenuSessionsComponent implements OnInit {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
sessions: Session[] = [];
|
sessions: Session[] = [];
|
||||||
|
@Input() collapsed = false
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user