Skip to content

Commit

Permalink
style: update import with path mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
LKL2017 committed Jan 9, 2024
1 parent b3baac0 commit 370df5c
Show file tree
Hide file tree
Showing 28 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { Routes } from '@angular/router';

export const routes: Routes = [
{ path: '', pathMatch: "full", redirectTo: 'gallery' },
{ path: 'gallery', loadChildren: () => import('../gallery/gallery.module').then(m => m.GalleryModule)},
{ path: 'gallery', loadChildren: () => import('./gallery/gallery.module').then(m => m.GalleryModule)},
];
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {AfterViewInit, Component, ElementRef, OnDestroy, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {ParticleFactory} from "../../di/particle-factory";
import {ParticleService} from "../../services/particle.service";
import {ParticleFactory} from "@di/particle-factory";
import {ParticleService} from "@services/particle.service";
import {GravityHandlerComponent} from "../gallery-handler/gravity-handler/gravity-handler.component";
import {HarmonicHandlerComponent} from "../gallery-handler/harmonic-handler/harmonic-handler.component";
import {ImageHandlerComponent} from "../gallery-handler/image-handler/image-handler.component";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, Input} from '@angular/core';
import {GravityParticleStyle, ParticleGravityService} from "../../../services/particle-gravity.service";
import {GravityParticleStyle, ParticleGravityService} from "@services/particle-gravity.service";

@Component({
selector: 'app-gravity-handler',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, Input, OnInit, ViewChild} from '@angular/core';
import {HarmonicParticleStyle, ParticleHarmonicService} from "../../../services/particle-harmonic.service";
import {HarmonicParticleStyle, ParticleHarmonicService} from "@services/particle-harmonic.service";

@Component({
selector: 'app-harmonic-handler',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, Input} from '@angular/core';
import {ImageParticlePattern, ImageParticleStyle, ParticleImageService} from "../../../services/particle-image.service";
import {ImageParticlePattern, ImageParticleStyle, ParticleImageService} from "@services/particle-image.service";

@Component({
selector: 'app-image-handler',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component, Inject} from '@angular/core';
import {Router} from "@angular/router";
import {Artifact, ArtifactToken, MOCK_ARTIFACTS} from "../../di/mock";
import {Artifact, ArtifactToken, MOCK_ARTIFACTS} from "@di/mock";

@Component({
selector: 'app-gallery-home',
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/di/particle-factory.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {ActivatedRoute} from "@angular/router";
import {ParticleGravityService} from "../services/particle-gravity.service";
import {ParticleHarmonicService} from "../services/particle-harmonic.service";
import {ParticleImageService} from "../services/particle-image.service";
import {ParticleRainingService} from "../services/particle-raining.service";
import {ParticleService} from "../services/particle.service";
import {ParticleGravityService} from "@services/particle-gravity.service";
import {ParticleHarmonicService} from "@services/particle-harmonic.service";
import {ParticleImageService} from "@services/particle-image.service";
import {ParticleRainingService} from "@services/particle-raining.service";
import {ParticleService} from "@services/particle.service";

export const ParticleFactory = (route: ActivatedRoute) => {
console.log('call particle factory')
Expand Down
2 changes: 1 addition & 1 deletion src/services/particle-gravity.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import {radiusToMass} from "../util/math";
import {radiusToMass} from "@util/math";
import {_P5Particle, ParticleService} from "./particle.service";
import P5 from "p5";

Expand Down
2 changes: 1 addition & 1 deletion src/services/particle-harmonic.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import P5 from "p5";
import {genRandomLinearGradient} from "../util/graphic";
import {genRandomLinearGradient} from "@util/graphic";
import {_P5Particle, ParticleService} from "./particle.service";

export type HarmonicParticleStyle = 'circle' | 'rect' | 'toMouse' | 'pulse';
Expand Down
2 changes: 1 addition & 1 deletion src/services/particle-raining.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import P5 from "p5";
import {calcRelativeBrightness} from "../util/graphic";
import {calcRelativeBrightness} from "@util/graphic";
import {_P5Particle, ParticleService} from "./particle.service";

interface RainingParticleModel {
Expand Down
9 changes: 8 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
"lib": [
"ES2022",
"dom"
]
],
"baseUrl": "src",
"paths": {
"@di/*": ["di/*"],
"@services/*": ["services/*"],
"@util/*": ["util/*"],
"@assets/*": ["assets/*"]
}
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
Expand Down

0 comments on commit 370df5c

Please sign in to comment.