From 72189cd6eba7e8ef1e921d1df1a0ba3e60ec585d Mon Sep 17 00:00:00 2001 From: filvanh Date: Wed, 2 Oct 2024 14:34:13 +0200 Subject: [PATCH] Omstrukturer mapper, filer og navngiving --- src/app/app.component.ts | 2 +- src/app/game/game-draw/game-draw.component.ts | 2 +- .../game-drawing-feedback.component.ts | 2 +- .../correct-guess/correct-guess.component.ts | 2 +- .../game-example-drawings.component.ts | 2 +- .../wrong-guess/wrong-guess.component.ts | 2 +- .../game-multiplayer/lobby/lobby.component.ts | 2 +- .../game-pick-difficulty.component.ts | 2 +- .../game/game-result/game-result.component.ts | 2 +- .../game-welcome/game-welcome.component.html} | 0 .../game-welcome/game-welcome.component.scss} | 2 +- .../game-welcome/game-welcome.component.ts} | 28 +++++++++---------- .../game-word-to-draw.component.ts | 2 +- src/app/game/game.component.html | 2 +- src/app/game/game.component.ts | 4 +-- .../idle-timeout/idle-timeout.component.html | 0 .../idle-timeout/idle-timeout.component.scss | 2 +- .../idle-timeout/idle-timeout.component.ts | 2 +- .../speech-bubble.component.html | 0 .../speech-bubble.component.scss | 2 +- .../speech-bubble/speech-bubble.component.ts | 0 src/app/routes.ts | 4 +-- src/app/splash/splash.component.ts | 2 +- 23 files changed, 34 insertions(+), 34 deletions(-) rename src/app/{welcome/welcome.component.html => game/game-welcome/game-welcome.component.html} (100%) rename src/app/{welcome/welcome.component.scss => game/game-welcome/game-welcome.component.scss} (92%) rename src/app/{welcome/welcome.component.ts => game/game-welcome/game-welcome.component.ts} (84%) rename src/app/game/{ => shared-components}/idle-timeout/idle-timeout.component.html (100%) rename src/app/game/{ => shared-components}/idle-timeout/idle-timeout.component.scss (92%) rename src/app/game/{ => shared-components}/idle-timeout/idle-timeout.component.ts (93%) rename src/app/game/{ => shared-components}/speech-bubble/speech-bubble.component.html (100%) rename src/app/game/{ => shared-components}/speech-bubble/speech-bubble.component.scss (94%) rename src/app/game/{ => shared-components}/speech-bubble/speech-bubble.component.ts (100%) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 755fd735..53398f9b 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,7 +3,7 @@ import { Subject } from 'rxjs'; import { Router } from '@angular/router'; import { MatDialog } from '@angular/material/dialog'; import { RouterOutlet } from '@angular/router'; -import { IdleTimeoutComponent } from './game/idle-timeout/idle-timeout.component'; +import { IdleTimeoutComponent } from './game/shared-components/idle-timeout/idle-timeout.component'; import { routeTransitionAnimations } from './route-transition-animations'; import { environment } from '../environments/environment'; import { GameStateService } from './game/services/game-state-service'; diff --git a/src/app/game/game-draw/game-draw.component.ts b/src/app/game/game-draw/game-draw.component.ts index f9fadb96..582a74b1 100644 --- a/src/app/game/game-draw/game-draw.component.ts +++ b/src/app/game/game-draw/game-draw.component.ts @@ -22,7 +22,7 @@ import { TranslationService } from '@/app/core/translation.service'; import { TranslatePipe } from '@/app/core/translation.pipe'; import { GameStateService } from '../services/game-state-service'; import { CustomColorsIO } from '@/app/shared/customColors'; -import { SpeechBubbleComponent } from '../speech-bubble/speech-bubble.component'; +import { SpeechBubbleComponent } from '../shared-components/speech-bubble/speech-bubble.component'; import { OAvatarComponent } from '@/assets/avatars/o-avatar/o-avatar.component'; import { IAvatarComponent } from '@/assets/avatars/i-avatar/i-avatar.component'; import { ViewChild } from '@angular/core'; diff --git a/src/app/game/game-intermediate-result/game-drawing-feedback/game-drawing-feedback.component.ts b/src/app/game/game-intermediate-result/game-drawing-feedback/game-drawing-feedback.component.ts index 94f5d311..3d8eca6f 100644 --- a/src/app/game/game-intermediate-result/game-drawing-feedback/game-drawing-feedback.component.ts +++ b/src/app/game/game-intermediate-result/game-drawing-feedback/game-drawing-feedback.component.ts @@ -1,5 +1,5 @@ import { TranslatePipe } from '@/app/core/translation.pipe'; -import { SpeechBubbleComponent } from '../../speech-bubble/speech-bubble.component'; +import { SpeechBubbleComponent } from '../../shared-components/speech-bubble/speech-bubble.component'; import { Component, OnInit } from '@angular/core'; import { ArrowAlignment, PointerSide } from '@/app/shared/models/interfaces'; import { CustomColorsIO } from '../../../shared/customColors'; diff --git a/src/app/game/game-intermediate-result/game-example-drawings/correct-guess/correct-guess.component.ts b/src/app/game/game-intermediate-result/game-example-drawings/correct-guess/correct-guess.component.ts index 2ef3a556..b9edf267 100644 --- a/src/app/game/game-intermediate-result/game-example-drawings/correct-guess/correct-guess.component.ts +++ b/src/app/game/game-intermediate-result/game-example-drawings/correct-guess/correct-guess.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { SpeechBubbleComponent } from '@/app/game/speech-bubble/speech-bubble.component'; +import { SpeechBubbleComponent } from '@/app/game/shared-components/speech-bubble/speech-bubble.component'; import { OAvatarComponent } from '@/assets/avatars/o-avatar/o-avatar.component'; import { ArrowAlignment, PointerSide } from '@/app/shared/models/interfaces'; import { CustomColorsIO } from '@/app/shared/customColors'; diff --git a/src/app/game/game-intermediate-result/game-example-drawings/game-example-drawings.component.ts b/src/app/game/game-intermediate-result/game-example-drawings/game-example-drawings.component.ts index 15622316..c208f519 100644 --- a/src/app/game/game-intermediate-result/game-example-drawings/game-example-drawings.component.ts +++ b/src/app/game/game-intermediate-result/game-example-drawings/game-example-drawings.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { SpeechBubbleComponent } from '../../speech-bubble/speech-bubble.component'; +import { SpeechBubbleComponent } from '../../shared-components/speech-bubble/speech-bubble.component'; import { TranslatePipe } from '@/app/core/translation.pipe'; import { DrawingService } from '../../services/drawing.service'; import { OAvatarComponent } from '@/assets/avatars/o-avatar/o-avatar.component'; diff --git a/src/app/game/game-intermediate-result/game-example-drawings/wrong-guess/wrong-guess.component.ts b/src/app/game/game-intermediate-result/game-example-drawings/wrong-guess/wrong-guess.component.ts index 86e4c516..ec88a8e2 100644 --- a/src/app/game/game-intermediate-result/game-example-drawings/wrong-guess/wrong-guess.component.ts +++ b/src/app/game/game-intermediate-result/game-example-drawings/wrong-guess/wrong-guess.component.ts @@ -1,5 +1,5 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; -import { SpeechBubbleComponent } from '@/app/game/speech-bubble/speech-bubble.component'; +import { SpeechBubbleComponent } from '@/app/game/shared-components/speech-bubble/speech-bubble.component'; import { OAvatarComponent } from '@/assets/avatars/o-avatar/o-avatar.component'; import { ArrowAlignment, Certainty, PointerSide } from '@/app/shared/models/interfaces'; import { CustomColorsIO } from '@/app/shared/customColors'; diff --git a/src/app/game/game-multiplayer/lobby/lobby.component.ts b/src/app/game/game-multiplayer/lobby/lobby.component.ts index d717167d..53cb173e 100644 --- a/src/app/game/game-multiplayer/lobby/lobby.component.ts +++ b/src/app/game/game-multiplayer/lobby/lobby.component.ts @@ -8,7 +8,7 @@ import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslationService } from '@/app/core/translation.service'; import { TranslatePipe } from '@/app/core/translation.pipe'; import { GameStateService } from '../../services/game-state-service'; -import { SpeechBubbleComponent } from '../../speech-bubble/speech-bubble.component'; +import { SpeechBubbleComponent } from '../../shared-components/speech-bubble/speech-bubble.component'; import { CustomColorsIO } from '@/app/shared/customColors'; import { PointerSide, ArrowAlignment } from '@/app/shared/models/interfaces'; import { IAvatarComponent } from '@/assets/avatars/i-avatar/i-avatar.component'; diff --git a/src/app/game/game-pick-difficulty/game-pick-difficulty.component.ts b/src/app/game/game-pick-difficulty/game-pick-difficulty.component.ts index 657f0979..c53b8547 100644 --- a/src/app/game/game-pick-difficulty/game-pick-difficulty.component.ts +++ b/src/app/game/game-pick-difficulty/game-pick-difficulty.component.ts @@ -8,7 +8,7 @@ import { TranslationService } from '@/app/core/translation.service'; import { TranslatePipe } from '@/app/core/translation.pipe'; import { GameLevelConfig, GAMESTATE } from '@/app/shared/models/interfaces'; import { GameStateService } from '../services/game-state-service'; -import { SpeechBubbleComponent } from '../../game/speech-bubble/speech-bubble.component'; +import { SpeechBubbleComponent } from '../shared-components/speech-bubble/speech-bubble.component'; import { CustomColorsIO } from '../../shared/customColors'; import { ArrowAlignment, PointerSide } from '@/app/shared/models/interfaces'; import { trigger, state, style, animate, transition } from '@angular/animations'; diff --git a/src/app/game/game-result/game-result.component.ts b/src/app/game/game-result/game-result.component.ts index 407be41b..c82f22c0 100644 --- a/src/app/game/game-result/game-result.component.ts +++ b/src/app/game/game-result/game-result.component.ts @@ -18,7 +18,7 @@ import { // ... } from '@angular/animations'; import { HighscoreData } from '@/app/shared/models/backend-interfaces'; -import { SpeechBubbleComponent } from '../speech-bubble/speech-bubble.component'; +import { SpeechBubbleComponent } from '../shared-components/speech-bubble/speech-bubble.component'; import { CustomColorsIO } from '@/app/shared/customColors'; import { MatIcon } from '@angular/material/icon'; import { GameStateService } from '../services/game-state-service'; diff --git a/src/app/welcome/welcome.component.html b/src/app/game/game-welcome/game-welcome.component.html similarity index 100% rename from src/app/welcome/welcome.component.html rename to src/app/game/game-welcome/game-welcome.component.html diff --git a/src/app/welcome/welcome.component.scss b/src/app/game/game-welcome/game-welcome.component.scss similarity index 92% rename from src/app/welcome/welcome.component.scss rename to src/app/game/game-welcome/game-welcome.component.scss index 94952e14..93b24308 100644 --- a/src/app/welcome/welcome.component.scss +++ b/src/app/game/game-welcome/game-welcome.component.scss @@ -1,4 +1,4 @@ -@import '../../variables.scss'; +@import '../../../variables.scss'; .container { position: relative; diff --git a/src/app/welcome/welcome.component.ts b/src/app/game/game-welcome/game-welcome.component.ts similarity index 84% rename from src/app/welcome/welcome.component.ts rename to src/app/game/game-welcome/game-welcome.component.ts index 8f09e075..63536617 100644 --- a/src/app/welcome/welcome.component.ts +++ b/src/app/game/game-welcome/game-welcome.component.ts @@ -1,27 +1,27 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; -import { MultiplayerService } from '../game/services/multiplayer.service'; -import { DrawingService } from '../game/services/drawing.service'; +import { MultiplayerService } from '../services/multiplayer.service'; +import { DrawingService } from '../services/drawing.service'; import { Router, RouterLink, RouterLinkActive } from '@angular/router'; import { MatIcon } from '@angular/material/icon'; import { MatButton } from '@angular/material/button'; -import { TranslationService } from '../core/translation.service'; -import { TranslatePipe } from '../core/translation.pipe'; +import { TranslationService } from '../../core/translation.service'; +import { TranslatePipe } from '../../core/translation.pipe'; import { Observable, Subject, takeUntil } from 'rxjs'; import { CommonModule } from '@angular/common'; -import { GAMESTATE } from '../shared/models/interfaces'; -import { GameStateService } from '../game/services/game-state-service'; -import { SupportedLanguages } from '../shared/models/interfaces'; +import { GAMESTATE } from '../../shared/models/interfaces'; +import { GameStateService } from '../services/game-state-service'; +import { SupportedLanguages } from '../../shared/models/interfaces'; import { ArrowAlignment, PointerSide } from '@/app/shared/models/interfaces'; import { trigger, state, style, animate, transition } from '@angular/animations'; -import { SpeechBubbleComponent } from '../game/speech-bubble/speech-bubble.component'; -import { CustomColorsIO } from '../shared/customColors'; -import { CustomButtonComponent } from '../game/shared-components/custom-button/custom-button.component'; +import { SpeechBubbleComponent } from '../shared-components/speech-bubble/speech-bubble.component'; +import { CustomColorsIO } from '../../shared/customColors'; +import { CustomButtonComponent } from '../shared-components/custom-button/custom-button.component'; import { ButtonStyleClass } from '@/app/shared/buttonStyles'; @Component({ - selector: 'app-welcome', - templateUrl: './welcome.component.html', - styleUrls: ['./welcome.component.scss'], + selector: 'app-game-welcome', + templateUrl: './game-welcome.component.html', + styleUrls: ['./game-welcome.component.scss'], standalone: true, imports: [ RouterLink, @@ -53,7 +53,7 @@ import { ButtonStyleClass } from '@/app/shared/buttonStyles'; ]), ], }) -export class WelcomeComponent implements OnInit, OnDestroy { +export class GameWelcomeComponent implements OnInit, OnDestroy { currentLang$: Observable; private destroy$ = new Subject(); private animationTimeouts: NodeJS.Timeout[] = []; diff --git a/src/app/game/game-word-to-draw/game-word-to-draw.component.ts b/src/app/game/game-word-to-draw/game-word-to-draw.component.ts index 1332bd51..44cfb7d4 100644 --- a/src/app/game/game-word-to-draw/game-word-to-draw.component.ts +++ b/src/app/game/game-word-to-draw/game-word-to-draw.component.ts @@ -17,7 +17,7 @@ import { GameStateService } from '../services/game-state-service'; import { ExampleDrawingService } from '../services/example-drawing.service'; import { Router } from '@angular/router'; import { IAvatarComponent } from '@/assets/avatars/i-avatar/i-avatar.component'; -import { SpeechBubbleComponent } from '../speech-bubble/speech-bubble.component'; +import { SpeechBubbleComponent } from '../shared-components/speech-bubble/speech-bubble.component'; import { CustomColorsIO } from '@/app/shared/customColors'; import { PointerSide, ArrowAlignment } from '@/app/shared/models/interfaces'; import { CustomButtonComponent } from '../shared-components/custom-button/custom-button.component'; diff --git a/src/app/game/game.component.html b/src/app/game/game.component.html index 5c37b838..78abe02b 100644 --- a/src/app/game/game.component.html +++ b/src/app/game/game.component.html @@ -16,6 +16,6 @@ } @case (GAMESTATE.lobby) {
- +
} } diff --git a/src/app/game/game.component.ts b/src/app/game/game.component.ts index 40f1e20b..46297cc8 100644 --- a/src/app/game/game.component.ts +++ b/src/app/game/game.component.ts @@ -9,7 +9,7 @@ import { GameInfoComponent } from './game-info/game-info.component'; import { GamePickDifficultyComponent } from './game-pick-difficulty/game-pick-difficulty.component'; import { GameStateService } from './services/game-state-service'; import { LobbyComponent } from './game-multiplayer/lobby/lobby.component'; -import { WelcomeComponent } from '../welcome/welcome.component'; +import { GameWelcomeComponent } from '../game/game-welcome/game-welcome.component'; @Component({ selector: 'app-game', @@ -49,7 +49,7 @@ import { WelcomeComponent } from '../welcome/welcome.component'; GameResultComponent, GameWordToDrawComponent, LobbyComponent, - WelcomeComponent, + GameWelcomeComponent, ], }) export class GameComponent implements OnInit { diff --git a/src/app/game/idle-timeout/idle-timeout.component.html b/src/app/game/shared-components/idle-timeout/idle-timeout.component.html similarity index 100% rename from src/app/game/idle-timeout/idle-timeout.component.html rename to src/app/game/shared-components/idle-timeout/idle-timeout.component.html diff --git a/src/app/game/idle-timeout/idle-timeout.component.scss b/src/app/game/shared-components/idle-timeout/idle-timeout.component.scss similarity index 92% rename from src/app/game/idle-timeout/idle-timeout.component.scss rename to src/app/game/shared-components/idle-timeout/idle-timeout.component.scss index ab1ff365..33d41131 100644 --- a/src/app/game/idle-timeout/idle-timeout.component.scss +++ b/src/app/game/shared-components/idle-timeout/idle-timeout.component.scss @@ -1,4 +1,4 @@ -@import '../../../variables.scss'; +@import '../../../../variables.scss'; .cdk-overlay-backdrop.cdk-overlay-dark-backdrop.cdk-overlay-backdrop-showing { background: rgba(20, 33, 61, 0.8); diff --git a/src/app/game/idle-timeout/idle-timeout.component.ts b/src/app/game/shared-components/idle-timeout/idle-timeout.component.ts similarity index 93% rename from src/app/game/idle-timeout/idle-timeout.component.ts rename to src/app/game/shared-components/idle-timeout/idle-timeout.component.ts index 38c8cd60..20e0b3da 100644 --- a/src/app/game/idle-timeout/idle-timeout.component.ts +++ b/src/app/game/shared-components/idle-timeout/idle-timeout.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; import { MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { ViewEncapsulation } from '@angular/core'; -import { routes } from '../../shared/models/routes'; +import { routes } from '../../../shared/models/routes'; import { MatIcon } from '@angular/material/icon'; import { MatButton } from '@angular/material/button'; import { CdkScrollable } from '@angular/cdk/scrolling'; diff --git a/src/app/game/speech-bubble/speech-bubble.component.html b/src/app/game/shared-components/speech-bubble/speech-bubble.component.html similarity index 100% rename from src/app/game/speech-bubble/speech-bubble.component.html rename to src/app/game/shared-components/speech-bubble/speech-bubble.component.html diff --git a/src/app/game/speech-bubble/speech-bubble.component.scss b/src/app/game/shared-components/speech-bubble/speech-bubble.component.scss similarity index 94% rename from src/app/game/speech-bubble/speech-bubble.component.scss rename to src/app/game/shared-components/speech-bubble/speech-bubble.component.scss index 1ae092bb..c7a5aa27 100644 --- a/src/app/game/speech-bubble/speech-bubble.component.scss +++ b/src/app/game/shared-components/speech-bubble/speech-bubble.component.scss @@ -1,4 +1,4 @@ -@import '../../../variables.scss'; +@import '../../../../variables.scss'; * { text-align: center; diff --git a/src/app/game/speech-bubble/speech-bubble.component.ts b/src/app/game/shared-components/speech-bubble/speech-bubble.component.ts similarity index 100% rename from src/app/game/speech-bubble/speech-bubble.component.ts rename to src/app/game/shared-components/speech-bubble/speech-bubble.component.ts diff --git a/src/app/routes.ts b/src/app/routes.ts index eb8285d2..3f630b50 100644 --- a/src/app/routes.ts +++ b/src/app/routes.ts @@ -1,6 +1,6 @@ import { Routes } from '@angular/router'; import { SplashComponent } from './splash/splash.component'; -import { WelcomeComponent } from './welcome/welcome.component'; +import { GameWelcomeComponent } from './game/game-welcome/game-welcome.component'; import { GameComponent } from './game/game.component'; import { routes as r } from './shared/models/routes'; import { GameResultComponent } from './game/game-result/game-result.component'; @@ -18,7 +18,7 @@ export const routes: Routes = [ }, { path: r.WELCOME, - component: WelcomeComponent, + component: GameWelcomeComponent, data: { animationState: 'welcome' }, }, { diff --git a/src/app/splash/splash.component.ts b/src/app/splash/splash.component.ts index d54cdd2d..134b9427 100644 --- a/src/app/splash/splash.component.ts +++ b/src/app/splash/splash.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; import { CommonModule } from '@angular/common'; import { HttpClient } from '@angular/common/http'; -import { SpeechBubbleComponent } from '../game/speech-bubble/speech-bubble.component'; +import { SpeechBubbleComponent } from '../game/shared-components/speech-bubble/speech-bubble.component'; import { CustomColorsIO } from '../shared/customColors'; import { ArrowAlignment, PointerSide } from '../shared/models/interfaces'; import { trigger, state, style, animate, transition } from '@angular/animations';