diff --git a/src/app/components/loading-spinner/index.ts b/src/app/components/loading-spinner/index.ts new file mode 100644 index 0000000..9fd9f87 --- /dev/null +++ b/src/app/components/loading-spinner/index.ts @@ -0,0 +1,26 @@ +export default { + setup() { + return this + }, + html: ` + + `, + toString() { + return this.html + }, + getSpinner() { + return document.getElementById('loading')! as HTMLDivElement + }, + show() { + this.getSpinner().classList.remove('hidden') + }, + hide() { + this.getSpinner().classList.add('hidden') + }, +} diff --git a/src/app/components/mp3-player/index.ts b/src/app/components/mp3-player/index.ts index 2396155..fff23b9 100644 --- a/src/app/components/mp3-player/index.ts +++ b/src/app/components/mp3-player/index.ts @@ -1,4 +1,5 @@ import { setupIndicators, setupMp3Buttons } from '@components/mp3-player/setup' +import LoadingSpinner from '../loading-spinner' export default { setup() { @@ -37,13 +38,7 @@ export default { - +${LoadingSpinner}