1
0
Fork 0
muzika-gromche/Frontend/src/components/LoadingScreen.vue

94 lines
2.4 KiB
Vue
Raw Normal View History

WIP: Add frontend web app player & editor in Vue 3 + Vite TODO: - implement viewing & editing. - Add links to deployment, and CHANGELOG. style.css package.json vite config .vscode eslint use --cache .vscode add vite-css-modules editorconfig tsconfig and updated vue-tsc (fixes most of the type checking bugs) fix last type errors audiowaveform gitignore ESLint ESLint: ignore autogenerated JSON lint:fix tsconfig and vite config migrate icon generating script to TS eslint src/lib/ eslint stores eslint src/*.ts eslint audio pnpm update update icon eslint ahh import new tracks json instructions on jq codenames codenames.json fix styles broken by import order eslint audio app error screen footer copyright year global header loading screen transition search field preview track info inspector control controls controls range controls impl controls index eslint no-console off AudioTrack view inspector cards and sliders more controls master volume slider playhead library page player page timeline markers timeline markers header tick timestamp timeline clip index clip empty clip lyrics clip palette clip fadeout clip default import order timeline timeline panel timeline track header timeline trackview clip view clip audio audio waveform scrollsync easy lints eslint store eslint no mutating props off pnpm catalog off add unhead dep use head eslint inspector eslint easy minor stuff eslint audiowaveform easy fix eslint use :key with v-for fix audio waveforms inspector makes more sense season remove debug inspector Merge codenames into main json bump pnpm pnpm in particular enabled monospace Game Over Move JSON to assets to avoid caching issues
2025-11-27 14:57:28 +00:00
<script setup lang="ts">
import { TransitionPresets, useTransition, watchDebounced } from '@vueuse/core'
import { computed, shallowRef, useId } from 'vue'
import ScreenTransition from './ScreenTransition.vue'
const {
visible,
message = 'Loading…',
progress = undefined,
} = defineProps<{
visible: boolean
message?: string
// loading progress, range 0..1
progress?: number | undefined
}>()
// CSS transition on width does not work in Firefox
const zeroProgress = computed(() => progress ?? 0)
const easedProgress = useTransition(zeroProgress, {
duration: 400,
easing: TransitionPresets.easeInOutQuad,
})
const progressId = useId()
// Let the progress animation finish before cutting it off of updates
const actuallyVisible = shallowRef(visible)
watchDebounced(() => visible, () => {
actuallyVisible.value = visible
}, { debounce: 600 })
</script>
<template>
<ScreenTransition :visible="actuallyVisible">
<div class="tw:h-full tw:flex tw:flex-col tw:gap-8 tw:items-center tw:justify-center tw:text-2xl">
<label :for="progressId">
{{ message }}
</label>
<progress :id="progressId" class="progress" max="1" :value="easedProgress">
<template v-if="progress !== undefined">
{{ Math.floor(progress * 100) }} %
</template>
</progress>
</div>
</ScreenTransition>
</template>
<style scoped>
label {
user-select: none;
}
.progress {
appearance: none;
background-color: #1a1a1a;
height: 24px;
padding: 5px;
width: 350px;
border-radius: 5px;
box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;
}
.progress::-webkit-progress-bar {
appearance: none;
background: none;
}
/* for some reason combining these two selector via comma breaks Chromium */
.progress::-webkit-progress-value {
appearance: none;
height: 100%;
border-radius: 3px;
background-color: #444;
box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
background-image: -webkit-linear-gradient(135deg,
transparent 33%, rgba(0, 0, 0, .1) 33%,
rgba(0, 0, 0, .1) 66%, transparent 66%);
background-size: 35px 20px;
}
.progress::-moz-progress-bar {
appearance: none;
background-color: #444;
height: 100%;
border-radius: 3px;
box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
background-image: repeating-linear-gradient(135deg,
transparent 0%, transparent 33%,
rgba(0, 0, 0, .1) 33%, rgba(0, 0, 0, .1) 66%);
background-size: 35px 100%;
}
</style>