diff --git a/resources/js/Pages/Tools/SFX.vue b/resources/js/Pages/Tools/SFX.vue index 0ea4895..596ffb0 100644 --- a/resources/js/Pages/Tools/SFX.vue +++ b/resources/js/Pages/Tools/SFX.vue @@ -7,6 +7,9 @@ import {computed, onBeforeMount, onMounted, ref, watch} from "vue"; import Icon from "@/Components/Icon.vue"; import Lightbox from "@/Components/Lightbox.vue"; import {useMediaQuery} from "@vueuse/core"; +import Dropdown from "@/Jetstream/Dropdown.vue"; +import Checkbox from "@/Jetstream/Checkbox.vue"; +import Label from "@/Jetstream/Label.vue"; const props = defineProps({ library: Object @@ -21,10 +24,14 @@ const lg = useMediaQuery('(min-width: 1024px)') watch(md, (value) => { columns.value = value ? [0, 1] : [0] +}, { + immediate: true }) watch(lg, (value) => { columns.value = value ? [0, 1, 2] : [0, 1] +}, { + immediate: true }) const panels = computed(() => { @@ -63,11 +70,7 @@ const audioLoaded = ref(false); watch(currentFile, (value) => { const url = new URL(window.location.href); - if (value) { - url.searchParams.set('file', value); - } else { - url.searchParams.delete('file'); - } + value ? url.searchParams.set('file', value) : url.searchParams.delete('file'); window.history.replaceState(null, '', url.toString()); if (audio.value && value) { @@ -116,24 +119,7 @@ watch(path, (value) => { onBeforeMount(() => { const params = new URLSearchParams(window.location.search); - let _path = params.get('path'); let file = params.get('file'); - if (_path) { - _path = _path.split('/') - _path.unshift(); // Might not be needed - - // while (_path.join('/') !== path.value.join()) { - // - // } - - let last = _path[_path.length - 1]; - for (let folder in props.library.folders) { - if (props.library.folders[folder].name === last) { - console.log(3) - selectFolder(folder); - } - } - } if (file && props.library.files.hasOwnProperty(file)) { file = file|0; currentFile.value = file; @@ -147,10 +133,15 @@ onMounted(() => { audio.value.src = `https://geometrydashfiles.b-cdn.net/sfx/s${currentFile.value}.ogg`; } }) + +const options = ref({ + pruneResults: false, + instantPlay: true, +});