Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
paator committed Jan 20, 2024
1 parent a32fc11 commit dc7faee
Show file tree
Hide file tree
Showing 12 changed files with 110 additions and 109 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: Node.js CI

on:
pull_request:
branches: [ main ]
pull_request:
branches: [main]

jobs:
build:
build:
runs-on: ubuntu-latest

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: npm ci
- run: npm run build --if-present
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: npm ci
- run: npm run build --if-present
76 changes: 38 additions & 38 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,50 @@
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Runs on pushes targeting the default branch
push:
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true
group: 'pages'
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload dist repository
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload dist repository
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
2 changes: 1 addition & 1 deletion src/app.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind utilities;
2 changes: 1 addition & 1 deletion src/components/ModuleEditor/Border.svelte
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<span class="border border-slate-900" />
<span class="border border-slate-900" />
10 changes: 5 additions & 5 deletions src/components/ModuleEditor/Cell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@
export let yPositionInGrid: number;
function cursorToCellPosition() {
if(xPositionInGrid === undefined) return;
if (xPositionInGrid === undefined) return;
cursorPosition.setPosition(xPositionInGrid, yPositionInGrid);
}
$: isValueOrDefault =
(defaultDisplayValue && str === '0' && !allowZero) || str == defaultDisplayValue;
$: isPositionMatched =
xPositionInGrid === $cursorPosition.posX &&
yPositionInGrid === $cursorPosition.posY
xPositionInGrid === $cursorPosition.posX && yPositionInGrid === $cursorPosition.posY;
$: displayValue = isValueOrDefault ? defaultDisplayValue : str;
</script>
Expand All @@ -27,6 +26,7 @@
class:text-slate-500={isValueOrDefault}
class:bg-blue-50={isPositionMatched}
class:text-black={isPositionMatched}
class:animate-[pulse_1.2s_linear_infinite]={isPositionMatched}>
class:animate-[pulse_1.2s_linear_infinite]={isPositionMatched}
>
{displayValue}
</span>
</span>
4 changes: 2 additions & 2 deletions src/components/ModuleEditor/ModuleEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import PatternEditor from './PatternEditor.svelte';
import { quintOut } from 'svelte/easing';
import { flip } from 'svelte/animate';
import { fade } from 'svelte/transition'
import { fade } from 'svelte/transition';
function switchPattern(index: number) {
currentPatternIndex.set(index);
Expand Down Expand Up @@ -44,7 +44,7 @@
{#each $patterns as pattern, i (i)}
<button
in:fade
animate:flip={{duration: 200, easing: quintOut}}
animate:flip={{ duration: 200, easing: quintOut }}
class="w-8 flex-shrink-0 {i === $currentPatternIndex
? 'cursor-default rounded-sm border border-blue-400 bg-blue-600 text-slate-200'
: 'cursor-pointer rounded-sm border border-slate-400 bg-slate-500 text-slate-900 hover:bg-slate-400'}"
Expand Down
5 changes: 1 addition & 4 deletions src/components/ModuleEditor/PatternEditor.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<script lang="ts">
import { onMount } from 'svelte';
import EditorRow from './EditorRow.svelte';
import {
cursorPosition,
currentPattern
} from '../../stores/stores.js';
import { cursorPosition, currentPattern } from '../../stores/stores.js';
onMount(() => {
cursorPosition.setPosition(0, 0);
Expand Down
8 changes: 4 additions & 4 deletions src/models/channel.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type ChannelRow from './channel-row';

export default class Channel {
channelRows: ChannelRow[];
channelRows: ChannelRow[];

constructor(channelRows: ChannelRow[] = []) {
this.channelRows = channelRows;
}
constructor(channelRows: ChannelRow[] = []) {
this.channelRows = channelRows;
}
}
13 changes: 6 additions & 7 deletions src/models/mappings.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import NoteData, { Note } from "./note-data";
import NoteData, { Note } from './note-data';

export default function toModuleNote(noteString: string) {
if (noteString.length < 3) return new NoteData(Note.None, 0);
if (noteString.length < 3) return new NoteData(Note.None, 0);

const noteLabel = noteString.substring(0, 2);
const noteLabel = noteString.substring(0, 2);

const note =
Object.values(Note).find((value) => value === noteLabel) || Note.None;
const note = Object.values(Note).find((value) => value === noteLabel) || Note.None;

const octave = Number(noteString.substring(2)) || 0;
return new NoteData(note, octave);
const octave = Number(noteString.substring(2)) || 0;
return new NoteData(note, octave);
}
50 changes: 25 additions & 25 deletions src/models/note-data.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
export default class NoteData {
note: Note;
octave: number;
note: Note;
octave: number;

constructor(note: Note, octave: number) {
this.note = note;
this.octave = octave;
}
constructor(note: Note, octave: number) {
this.note = note;
this.octave = octave;
}

toString() {
return `${this.note}${
this.note === Note.None || this.note === Note.Off ? "-" : this.octave
}`;
}
toString() {
return `${this.note}${
this.note === Note.None || this.note === Note.Off ? '-' : this.octave
}`;
}
}

export enum Note {
None = "--",
C = "C-",
Csharp = "C#",
D = "D-",
Dsharp = "D#",
E = "E-",
F = "F-",
Fsharp = "F#",
G = "G-",
Gsharp = "G#",
A = "A-",
Asharp = "A#",
B = "B-",
Off = "R-",
None = '--',
C = 'C-',
Csharp = 'C#',
D = 'D-',
Dsharp = 'D#',
E = 'E-',
F = 'F-',
Fsharp = 'F#',
G = 'G-',
Gsharp = 'G#',
A = 'A-',
Asharp = 'A#',
B = 'B-',
Off = 'R-'
}
4 changes: 2 additions & 2 deletions src/models/pattern-row.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default class PatternRow {
envelopeValue = 0;
noiseValue = 0;
envelopeValue = 0;
noiseValue = 0;
}
20 changes: 13 additions & 7 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang='ts'>
import EditorButton from "../components/EditorMenu/EditorButton.svelte";
import EditorMenu from "../components/EditorMenu/EditorMenu.svelte";
import Module from "../models/module";
import VortexModuleConverter from "../services/vt-converter";
<script lang="ts">
import EditorButton from '../components/EditorMenu/EditorButton.svelte';
import EditorMenu from '../components/EditorMenu/EditorMenu.svelte';
import Module from '../models/module';
import VortexModuleConverter from '../services/vt-converter';
import { currentPatternIndex, setCurrentModule } from '../stores/stores.js';
import ModuleEditor from '../components/ModuleEditor/ModuleEditor.svelte';
Expand Down Expand Up @@ -40,6 +40,12 @@
<EditorButton on:click={newModule}>New Track</EditorButton>
<EditorButton on:click={loadModule}>Load Module</EditorButton>
</EditorMenu>
<ModuleEditor/>
<ModuleEditor />
</div>
<input bind:this={fileLoaderInput} hidden type="file" accept=".vt2,.pt3" on:change={handleFileSelect} />
<input
bind:this={fileLoaderInput}
hidden
type="file"
accept=".vt2,.pt3"
on:change={handleFileSelect}
/>

0 comments on commit dc7faee

Please sign in to comment.