- @if (shownMenu == EInteractionMenuState.Pantry) {
-
- }
- @if (shownMenu == EInteractionMenuState.Inventory) {
-
- }
+
+
+
+
{{
lang.game.actions.giveItem
diff --git a/src/app/pages/interactions/interactions.component.ts b/src/app/pages/interactions/interactions.component.ts
index 7558df2..30fabd7 100644
--- a/src/app/pages/interactions/interactions.component.ts
+++ b/src/app/pages/interactions/interactions.component.ts
@@ -1,4 +1,4 @@
-import { Component, computed, effect, inject, input, InputSignal, signal, Signal, WritableSignal } from '@angular/core';
+import { Component, computed, effect, inject, input, InputSignal, OnDestroy, signal, Signal, WritableSignal } from '@angular/core';
import { HeaderComponent } from "../../components/ui-elements/header/header.component";
import { ERouteKey } from '../../types/route-key';
import { Chibi, ChibiId } from '../../types/chibi/chibi';
@@ -12,7 +12,7 @@ import { IBrain } from '../../logic/chibi-behaviour/brain';
import { BRAIN_MAP } from '../../logic/chibi-behaviour/brain-map';
import { TranslateableComponent } from '../../components/translateable.component';
import { Food } from '../../types/food';
-import { interval } from 'rxjs';
+import { interval, Subscribable, Subscription } from 'rxjs';
import { RandomService } from '../../logic/random.service';
import { ChibiInteraction } from '../../logic/chibi-behaviour/brains/aperio.brain';
@@ -29,7 +29,7 @@ const THINKING_INTERVAL: number = 2000;
imports: [HeaderComponent, InteractionCanvasComponent, FoodPantryComponent, InventoryComponent, ButtonComponent],
templateUrl: './interactions.component.html',
})
-export class InteractionsComponent extends TranslateableComponent {
+export class InteractionsComponent extends TranslateableComponent implements OnDestroy {
public readonly chibiId: InputSignal = input.required();
private readonly chibiStore: ChibiStore = inject(ChibiStore);
@@ -46,6 +46,8 @@ export class InteractionsComponent extends TranslateableComponent {
private brain!: IBrain;
+ private sub: Subscription = new Subscription();
+
constructor() {
super();
effect(() => {
@@ -54,9 +56,13 @@ export class InteractionsComponent extends TranslateableComponent {
this.brain.init(this.chibi(), this.randomService);
}
})
- interval(THINKING_INTERVAL).subscribe(() => {
+ this.sub.add(interval(THINKING_INTERVAL).subscribe(() => {
this.brain.exist();
- })
+ }));
+ }
+
+ ngOnDestroy() {
+ this.sub.unsubscribe();
}
public interact(interaction: EChibiInteraction, item?: Food): void {
diff --git a/src/styles.scss b/src/styles.scss
index e92f17f..35a1476 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -26,4 +26,24 @@
--color-secondary-900: #651e71;
--color-secondary-950: #41074b;
+
+ --animate-slide-in: slide-in 0.3s ease-in-out;
+ @keyframes slide-in {
+ from {
+ transform: translateX(-100%);
+ }
+ to {
+ transform: translateX(0);
+ }
+ }
+
+ --animate-slide-out: slide-out 0.3s ease-in-out;
+ @keyframes slide-out {
+ from {
+ transform: translateX(0);
+ }
+ to {
+ transform: translateX(-100%);
+ }
+ }
}