Skip to content

Commit

Permalink
chore: cleanup unnecessary things and reformat codes
Browse files Browse the repository at this point in the history
  • Loading branch information
threedalpeng committed Feb 19, 2024
1 parent 8a8f5a8 commit 84a385e
Show file tree
Hide file tree
Showing 22 changed files with 86 additions and 226 deletions.
48 changes: 1 addition & 47 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"@steeze-ui/heroicons": "^2.3.0",
"@steeze-ui/svelte-icon": "^1.5.0",
"idb": "^8.0.0",
"mini-svg-data-uri": "^1.4.4",
"soundfont-player": "^0.12.0"
"mini-svg-data-uri": "^1.4.4"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.1.0",
Expand Down
10 changes: 5 additions & 5 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
2 changes: 1 addition & 1 deletion pwa-assets.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig, minimal2023Preset as preset } from '@vite-pwa/assets-gene

export default defineConfig({
headLinkOptions: {
preset: '2023',
preset: '2023'
},
preset,
images: ['static/vite.svg']
Expand Down
4 changes: 2 additions & 2 deletions src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'vite-plugin-pwa/svelte';
import 'vite-plugin-pwa/info';
import 'vite-plugin-pwa/svelte';
import 'vite-plugin-pwa/types';

// See https://kit.svelte.dev/docs/types#app
Expand All @@ -20,4 +20,4 @@ declare global {
}
}

export {};
export { };
3 changes: 1 addition & 2 deletions src/lib/canvas/core/events.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
type PickByValue<T, Value> = { [P in keyof T as T[P] extends Value | undefined ? P : never]: T[P] };
export interface PointerEventMap extends PickByValue<HTMLElementEventMap, PointerEvent> {}
// const m: PointerEventMap = {};
export const pointerEventTypes: (keyof PointerEventMap)[] = [
'gotpointercapture',
'lostpointercapture',
Expand Down Expand Up @@ -218,7 +217,7 @@ export class CanvasEventHandler {

pointerInfo.hitCode = unpolledInfo.hitCode;
pointerInfo.position = unpolledInfo.position;

hitEventTypes.forEach(([type, button]) => {
if (onHit)
onHit({
Expand Down
44 changes: 0 additions & 44 deletions src/lib/canvas/core/worker.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib/canvas/elements/HitRegion.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import { onCanvasHit } from '../core/hooks';
import type { CanvasPointerEvent } from '../core/events';
import { onCanvasHit } from '../core/hooks';
export let active: boolean = true;
export let render: (ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) => any;
Expand Down
10 changes: 5 additions & 5 deletions src/lib/canvas/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Line from './elements/Line.svelte';
import Circle from './elements/Circle.svelte';
import Canvas from './Canvas.svelte';
import { onCanvasRender } from './core/hooks';
import Circle from './elements/Circle.svelte';
import Clip from './elements/Clip.svelte';
import Crop from './elements/Crop.svelte';
import Ellipse from './elements/Ellipse.svelte';
import Line from './elements/Line.svelte';
import Text from './elements/Text.svelte';
import Crop from './elements/Crop.svelte';
import { onCanvasRender } from './core/hooks';
export { Line, Circle, Canvas, Clip, Ellipse, Text, onCanvasRender, Crop };
export { Canvas, Circle, Clip, Crop, Ellipse, Line, Text, onCanvasRender };
2 changes: 0 additions & 2 deletions src/lib/device/metronome/metronome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class Metronome {
this.beatPerBar = beatPerBar;
this.bpm = bpm;
this.timer.signatureUnit = signatureUnit;
console.log(beatPerBar);
this.timer.onTick(this.#onTick.bind(this));
this.timer.onAudioTick(this.#scheduleAudio.bind(this));
}
Expand All @@ -32,7 +31,6 @@ class Metronome {
return this.timer.beatPerBar;
}
set beatPerBar(value: number) {
console.log('set', value);
this.timer.beatPerBar = value;
this.#onOptionChangeCallbacks.forEach((cb) => cb(this.state));
this.restart();
Expand Down
4 changes: 2 additions & 2 deletions src/lib/guitar/finger-board/FingerBoard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
</script>

<script lang="ts">
import Clip from '$/lib/canvas/elements/Clip.svelte';
import HitRegion from '$/lib/canvas/elements/HitRegion.svelte';
import { Canvas, Circle, Crop, Text } from '$lib/canvas';
import { createEventDispatcher } from 'svelte';
import FingerBoardBackground from './components/FingerBoardBackground.svelte';
import FingerBoardPoisitionIndicator from './components/FingerBoardPoisitionIndicator.svelte';
import { getXFromFretNumber, getYFromStringNumber, setFingerBoardContext } from './context';
import HitRegion from '$/lib/canvas/elements/HitRegion.svelte';
import Clip from '$/lib/canvas/elements/Clip.svelte';
const dispatch = createEventDispatcher<{ click: FingerPosition; hover: FingerPosition }>();
Expand Down
14 changes: 5 additions & 9 deletions src/lib/notation/ChordNotation.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<script lang="ts">
import {
getChordNotations,
type ChordName,
type ChordRoot,
} from "$/utils/music/chords";
import { getChordNotations, type ChordName, type ChordRoot } from '$/utils/music/chords';
export let root: ChordRoot;
export let name: ChordName;
export let root: ChordRoot;
export let name: ChordName;
$: chordNotations = getChordNotations(root, name);
$: chordNotations = getChordNotations(root, name);
</script>

<span class="font-chord">
{chordNotations.default.short}
{chordNotations.default.short}
</span>
2 changes: 1 addition & 1 deletion src/lib/notation/PitchNotation.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { getChordNotations, type ChordName, type ChordRoot } from '$/utils/music/chords';
import { getChordNotations, type ChordRoot } from '$/utils/music/chords';
export let note: ChordRoot;
export let octave: number;
Expand Down
1 change: 0 additions & 1 deletion src/lib/practice/RandomBox/RandomBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export class RandomBox<T> {
this.#indexSelected = [...this.#remains][RandomBox.getRandomInt(0, this.#remains.size)];
selected = this.#items[this.#indexSelected];
this.#remains.delete(this.#indexSelected);
console.log([...this.#remains]);
break;
}
return selected;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/practice/RandomBox/RandomBoxProvider.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" generics="T">
import { onDestroy } from 'svelte';
import { setRandomBoxContext } from './context';
import { RandomBox } from './RandomBox';
import { setRandomBoxContext } from './context';
export let items: T[] = [];
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<br /> I hope it'll open soon :)
</p>
<a
class="cursor-pointer underline text-indigo hover:text-indigo-600"
class="text-indigo cursor-pointer underline hover:text-indigo-600"
href="{base}/practice/render-sample">Here's Sample</a
>
2 changes: 1 addition & 1 deletion src/routes/practice/+page.svelte
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hi
hi
3 changes: 1 addition & 2 deletions src/routes/tools/render-sample/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@
}
};
}) as FingerInfo[];
// $: console.log(nextNotes);
function scheduleScore(score: PracticeScore) {
/** Now scheduleing */
/** Now scheduling */
// 1. board replacement
score.boards.map((board) => {
Expand Down
12 changes: 6 additions & 6 deletions src/types/geometry.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export interface Point {
x: number;
y: number;
x: number;
y: number;
}

export interface Rect {
x: number;
y: number;
width: number;
height: number;
x: number;
y: number;
width: number;
height: number;
}
32 changes: 0 additions & 32 deletions src/utils/audio.ts

This file was deleted.

Loading

0 comments on commit 84a385e

Please sign in to comment.