Skip to content

Commit

Permalink
chore: Add made components for uploading audio
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitcheljager committed Jun 20, 2024
1 parent 7a61c3e commit c4765a0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
33 changes: 31 additions & 2 deletions app/javascript/src/components/editor/Modals/EnhanceModal.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
<script>
import Modal from "@components/editor/Modals/Modal.svelte"
import EnhanceAudioUploader from "@components/enhance/EnhanceAudioUploader.svelte"
import { onMount } from "svelte"
const audioFiles = []
let loading = true
onMount(fetchUserAudioFiles)
function fetchUserAudioFiles() {
try {
} catch (error) {
} finally {
loading = false
}
}
</script>

<Modal maxWidth="80vw">
<Modal maxWidth="40vw">
<h2 class="mt-0">Enhance</h2>

<p>Enhance allows you to play custom sound effects.</p>
<p>Enhance allows you to upload play custom sound effects. This works by connecting your game to Workshop.codes, triggering specific events in order to play sound effects.</p>

<EnhanceAudioUploader />

<hr class="mt-1/2 mb-1/2" />

{#if loading}
Loading...
{/if}

{#if !loading && !audioFiles.length}
<em class="text-dark">You have not yet uploaded any audio files.</em>
{/if}
</Modal>
13 changes: 13 additions & 0 deletions app/javascript/src/components/enhance/EnhanceAudioUploader.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script>
let name = ""
let files = []
</script>

<hr class="mt-1/2 mb-1/2" />

<div class="form-label mb-0">Upload a new audio file</div>

<div class="form-group-uneven">
<input type="name" class="form-input mt-1/4" bind:value={name} placeholder="File name" />
<input type="file" class="form-input" accept="audio/mpeg, audio/wav, audio/ogg" bind:files />
</div>

0 comments on commit c4765a0

Please sign in to comment.