refactor: absolute paths
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
"format": "prettier --write --cache ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.0.1",
|
||||
"@types/three": "^0.182.0",
|
||||
"prettier": "^3.7.4",
|
||||
"typescript": "~5.9.3",
|
||||
|
||||
26
pnpm-lock.yaml
generated
26
pnpm-lock.yaml
generated
@@ -14,6 +14,9 @@ importers:
|
||||
specifier: ^0.182.0
|
||||
version: 0.182.0
|
||||
devDependencies:
|
||||
"@types/node":
|
||||
specifier: ^25.0.1
|
||||
version: 25.0.1
|
||||
"@types/three":
|
||||
specifier: ^0.182.0
|
||||
version: 0.182.0
|
||||
@@ -25,7 +28,7 @@ importers:
|
||||
version: 5.9.3
|
||||
vite:
|
||||
specifier: npm:rolldown-vite@7.2.5
|
||||
version: rolldown-vite@7.2.5
|
||||
version: rolldown-vite@7.2.5(@types/node@25.0.1)
|
||||
|
||||
packages:
|
||||
"@dimforge/rapier3d-compat@0.12.0":
|
||||
@@ -214,6 +217,12 @@ packages:
|
||||
integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==,
|
||||
}
|
||||
|
||||
"@types/node@25.0.1":
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-czWPzKIAXucn9PtsttxmumiQ9N0ok9FrBwgRWrwmVLlp86BrMExzvXRLFYRJ+Ex3g6yqj+KuaxfX1JTgV2lpfg==,
|
||||
}
|
||||
|
||||
"@types/stats.js@0.17.4":
|
||||
resolution:
|
||||
{
|
||||
@@ -504,6 +513,12 @@ packages:
|
||||
engines: { node: ">=14.17" }
|
||||
hasBin: true
|
||||
|
||||
undici-types@7.16.0:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==,
|
||||
}
|
||||
|
||||
snapshots:
|
||||
"@dimforge/rapier3d-compat@0.12.0": {}
|
||||
|
||||
@@ -587,6 +602,10 @@ snapshots:
|
||||
tslib: 2.8.1
|
||||
optional: true
|
||||
|
||||
"@types/node@25.0.1":
|
||||
dependencies:
|
||||
undici-types: 7.16.0
|
||||
|
||||
"@types/stats.js@0.17.4": {}
|
||||
|
||||
"@types/three@0.182.0":
|
||||
@@ -679,7 +698,7 @@ snapshots:
|
||||
|
||||
prettier@3.7.4: {}
|
||||
|
||||
rolldown-vite@7.2.5:
|
||||
rolldown-vite@7.2.5(@types/node@25.0.1):
|
||||
dependencies:
|
||||
"@oxc-project/runtime": 0.97.0
|
||||
fdir: 6.5.0(picomatch@4.0.3)
|
||||
@@ -689,6 +708,7 @@ snapshots:
|
||||
rolldown: 1.0.0-beta.50
|
||||
tinyglobby: 0.2.15
|
||||
optionalDependencies:
|
||||
"@types/node": 25.0.1
|
||||
fsevents: 2.3.3
|
||||
|
||||
rolldown@1.0.0-beta.50:
|
||||
@@ -724,3 +744,5 @@ snapshots:
|
||||
optional: true
|
||||
|
||||
typescript@5.9.3: {}
|
||||
|
||||
undici-types@7.16.0: {}
|
||||
|
||||
@@ -2,7 +2,7 @@ import "./style.css";
|
||||
|
||||
import * as THREE from "three";
|
||||
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
||||
import { NDS } from "./nds";
|
||||
import { NDS } from "~/nds";
|
||||
|
||||
// initialize scene
|
||||
const scene = new THREE.Scene();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
|
||||
import { ScreenManager } from "./screen-manager";
|
||||
import { ScreenManager } from "~/screen-manager";
|
||||
|
||||
const SCREEN_SOURCE_TEX_SIZE = 1024;
|
||||
const TOP_SCREEN_SOURCE_TEX_HEIGHT = SCREEN_SOURCE_TEX_SIZE / 404;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Screen } from "./screen";
|
||||
import { HomeScreen } from "./screens/home";
|
||||
import type { Screen } from "~/screen";
|
||||
import { HomeScreen } from "~/screens/home";
|
||||
|
||||
export class ScreenManager {
|
||||
private currentScreen: Screen;
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import type { Screen, ScreenContext } from "../screen";
|
||||
import { HomeScreen } from "./home";
|
||||
|
||||
export class ContactScreen implements Screen {
|
||||
renderTop(ctx: CanvasRenderingContext2D) {
|
||||
ctx;
|
||||
}
|
||||
|
||||
renderBottom(ctx: CanvasRenderingContext2D) {
|
||||
ctx.fillStyle = "#ffffff";
|
||||
ctx.font = "10px NDS10";
|
||||
ctx.textAlign = "left";
|
||||
ctx.textBaseline = "bottom";
|
||||
ctx.fillText("< Back", 1, 191);
|
||||
}
|
||||
|
||||
handleTouch(x: number, y: number, context: ScreenContext): void {
|
||||
if (x >= 0 && x <= 51 && y >= 178 && y <= 192) {
|
||||
context.navigate(new HomeScreen());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ImageLoader } from "../../../utils/loadImages";
|
||||
import { ButtonNavigation } from "../../../utils/buttonNavigation";
|
||||
import { ButtonSelector } from "../../../utils/buttonSelector";
|
||||
import { HomeScreen } from "../../home";
|
||||
import type { ContactScreenContext } from "../index";
|
||||
import { ImageLoader } from "~/utils/loadImages";
|
||||
import { ButtonNavigation } from "~/utils/buttonNavigation";
|
||||
import { ButtonSelector } from "~/utils/buttonSelector";
|
||||
import { HomeScreen } from "~/screens/home";
|
||||
import type { ContactScreenContext } from "~/screens/contact";
|
||||
|
||||
type ContactButton = "github" | "email" | "website" | "cv";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Screen, ScreenContext } from "../../screen";
|
||||
import type { Screen, ScreenContext } from "~/screen";
|
||||
import { ContactTopScreen } from "./top";
|
||||
import { ContactBottomScreen } from "./bottom";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ImageLoader } from "../../../utils/loadImages";
|
||||
import { ImageLoader } from "~/utils/loadImages";
|
||||
|
||||
export class ContactTopScreen {
|
||||
private images = new ImageLoader({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ImageLoader } from "../../../utils/loadImages";
|
||||
import { ButtonNavigation } from "../../../utils/buttonNavigation";
|
||||
import { ButtonSelector } from "../../../utils/buttonSelector";
|
||||
import type { ScreenContext } from "../../../screen";
|
||||
import { ContactScreen } from "../../contact";
|
||||
import { ImageLoader } from "~/utils/loadImages";
|
||||
import { ButtonNavigation } from "~/utils/buttonNavigation";
|
||||
import { ButtonSelector } from "~/utils/buttonSelector";
|
||||
import type { ScreenContext } from "~/screen";
|
||||
import { ContactScreen } from "~/screens/contact";
|
||||
|
||||
type HomeButton = "projects" | "contact" | "downloadPlay" | "settings";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Screen, ScreenContext } from "../../screen";
|
||||
import type { Screen, ScreenContext } from "~/screen";
|
||||
import { HomeTopScreen } from "./top";
|
||||
import { HomeBottomScreen } from "./bottom";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ImageLoader } from "../../../utils/loadImages";
|
||||
import { ImageLoader } from "~/utils/loadImages";
|
||||
|
||||
export class Calendar {
|
||||
private images = new ImageLoader({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ImageLoader } from "../../../utils/loadImages";
|
||||
import { ImageLoader } from "~/utils/loadImages";
|
||||
|
||||
const CENTER_X = 63;
|
||||
const CENTER_Y = 95;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ImageLoader } from "../../../utils/loadImages";
|
||||
import { ImageLoader } from "~/utils/loadImages";
|
||||
import { StatusBar } from "./statusBar";
|
||||
import { Clock } from "./clock";
|
||||
import { Calendar } from "./calendar";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ImageLoader } from "../../../utils/loadImages";
|
||||
import { ImageLoader } from "~/utils/loadImages";
|
||||
|
||||
export class StatusBar {
|
||||
private images = new ImageLoader({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ImageLoader } from "./loadImages";
|
||||
import type { ButtonRect } from "./buttonNavigation";
|
||||
import { ImageLoader } from "~/utils/loadImages";
|
||||
import type { ButtonRect } from "~/utils/buttonNavigation";
|
||||
|
||||
const ANIMATION_SPEED = 0.25;
|
||||
|
||||
|
||||
@@ -20,7 +20,13 @@
|
||||
"noUnusedParameters": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
"noUncheckedSideEffectImports": true,
|
||||
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"~/*": ["./src/*"],
|
||||
"~/": ["./src/index.ts"]
|
||||
}
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
|
||||
10
vite.config.ts
Normal file
10
vite.config.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { resolve } from "path";
|
||||
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
"~": resolve(__dirname, "./src"),
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user