-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add made components for uploading audio
- Loading branch information
1 parent
7a61c3e
commit c4765a0
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
33 changes: 31 additions & 2 deletions
33
app/javascript/src/components/editor/Modals/EnhanceModal.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
13
app/javascript/src/components/enhance/EnhanceAudioUploader.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |