Hello, {{ title }}
-Congratulations! Your app is running. 🎉
-Congratulations! Your app is running. 🎉
-Select an option:
+ + \ No newline at end of file diff --git a/src/app/components/menu/menu.component.ts b/src/app/components/menu/menu.component.ts new file mode 100644 index 0000000..31900e7 --- /dev/null +++ b/src/app/components/menu/menu.component.ts @@ -0,0 +1,19 @@ +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-menu', + templateUrl: './menu.component.html', + styleUrls: ['./menu.component.css'], +}) +export class MenuComponent { + constructor(private router: Router) {} + + navigateToGame(): void { + this.router.navigate(['/game']); + } + + navigateToOptions(): void { + this.router.navigate(['/options'], { state: { mode: 'full' } }); + } +} \ No newline at end of file diff --git a/src/app/components/options/options.component.css b/src/app/components/options/options.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/options/options.component.html b/src/app/components/options/options.component.html new file mode 100644 index 0000000..d0726db --- /dev/null +++ b/src/app/components/options/options.component.html @@ -0,0 +1,2 @@ +Configure your preferences here.
\ No newline at end of file diff --git a/src/app/components/options/options.component.ts b/src/app/components/options/options.component.ts new file mode 100644 index 0000000..b8057e1 --- /dev/null +++ b/src/app/components/options/options.component.ts @@ -0,0 +1,19 @@ +import { Component, Input } from '@angular/core'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-options', + templateUrl: './options.component.html', + styleUrls: ['./options.component.css'], +}) +export class OptionsComponent { + @Input() mode: 'modal' | 'full' = 'full'; + + constructor(private router: Router) {} + + ngOnInit(): void { + const nav = this.router.getCurrentNavigation(); + const state = nav?.extras?.state as { mode: 'modal' | 'full' }; + this.mode = state?.mode || 'full'; + } +} diff --git a/src/app/components/splash/splash.component.css b/src/app/components/splash/splash.component.css new file mode 100644 index 0000000..1637aa7 --- /dev/null +++ b/src/app/components/splash/splash.component.css @@ -0,0 +1,4 @@ +h1 { + color: blue; + text-align: center; + } \ No newline at end of file diff --git a/src/app/components/splash/splash.component.html b/src/app/components/splash/splash.component.html new file mode 100644 index 0000000..d7b55ea --- /dev/null +++ b/src/app/components/splash/splash.component.html @@ -0,0 +1 @@ +