Rework folder structure in frontend
Pages are now grouped per group they appear in on in the header (where possible) Utilities used by multiple pages in the project are grouped in folders such as services/pipes/etc
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {MatButton, MatIconButton} from "@angular/material/button";
|
||||
import {MatCard, MatCardContent, MatCardHeader, MatCardTitle} from "@angular/material/card";
|
||||
import {MatTab, MatTabGroup} from "@angular/material/tabs";
|
||||
import {NgForOf, NgIf} from "@angular/common";
|
||||
import {ParticleData} from '../../models/particle.model';
|
||||
import {MatIcon} from '@angular/material/icon';
|
||||
import {ParticleManagerService} from '../../services/particle-manager.service';
|
||||
import {FrameManagerService} from '../../services/frame-manager.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-frames',
|
||||
imports: [
|
||||
MatButton,
|
||||
MatCard,
|
||||
MatCardContent,
|
||||
MatCardHeader,
|
||||
MatCardTitle,
|
||||
MatIcon,
|
||||
MatIconButton,
|
||||
MatTab,
|
||||
MatTabGroup,
|
||||
NgForOf,
|
||||
NgIf
|
||||
],
|
||||
templateUrl: './frames.component.html',
|
||||
styleUrl: './frames.component.scss'
|
||||
})
|
||||
export class FramesComponent {
|
||||
|
||||
constructor(
|
||||
private particleManagerService: ParticleManagerService,
|
||||
private frameManagerService: FrameManagerService) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the particle data
|
||||
*/
|
||||
public get particleData(): ParticleData {
|
||||
return this.particleManagerService.getParticleData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current frame
|
||||
*/
|
||||
public get currentFrame(): string {
|
||||
return this.particleManagerService.getCurrentFrame();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all frames
|
||||
*/
|
||||
public get frames(): string[] {
|
||||
return this.particleManagerService.getFrames();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new frame
|
||||
*/
|
||||
public addFrame(): void {
|
||||
this.frameManagerService.addFrame();
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch to a different frame
|
||||
*/
|
||||
public switchFrame(frameId: string): void {
|
||||
this.frameManagerService.switchFrame(frameId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a particle
|
||||
*/
|
||||
public removeParticle(frameId: string, index: number): void {
|
||||
this.particleManagerService.removeParticle(frameId, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a frame
|
||||
*/
|
||||
public removeFrame(frameId: string): void {
|
||||
this.frameManagerService.removeFrame(frameId);
|
||||
}
|
||||
|
||||
|
||||
public highlightParticle(frameId: string, i: number) {
|
||||
this.particleManagerService.highlightParticle(frameId, i);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user