fix: #2052
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2346>
This commit is contained in:
parent
385fc47158
commit
67f21c9861
|
@ -168,7 +168,16 @@ enum CoverType {
|
|||
MILK_DROP
|
||||
}
|
||||
|
||||
let isWebGLSupported = false
|
||||
try {
|
||||
const canvas = document.createElement('canvas')
|
||||
isWebGLSupported = !!canvas.getContext('webgl2')
|
||||
} catch (error) {}
|
||||
|
||||
const coverType = useStorage('queue:cover-type', CoverType.COVER_ART)
|
||||
if (!isWebGLSupported) {
|
||||
coverType.value = CoverType.COVER_ART
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -212,24 +221,28 @@ const coverType = useStorage('queue:cover-type', CoverType.COVER_ART)
|
|||
v-if="!fullscreen || !idle"
|
||||
class="cover-buttons"
|
||||
>
|
||||
<button
|
||||
v-if="coverType === CoverType.COVER_ART"
|
||||
class="ui secondary button"
|
||||
:aria-label="labels.showVisualizer"
|
||||
:title="labels.showVisualizer"
|
||||
@click="coverType = CoverType.MILK_DROP"
|
||||
>
|
||||
<i class="icon signal" />
|
||||
</button>
|
||||
<button
|
||||
v-else-if="coverType === CoverType.MILK_DROP"
|
||||
class="ui secondary button"
|
||||
:aria-label="labels.showCoverArt"
|
||||
:title="labels.showCoverArt"
|
||||
@click="coverType = CoverType.COVER_ART"
|
||||
>
|
||||
<i class="icon image outline" />
|
||||
</button>
|
||||
<tooltip :content="!isWebGLSupported && $t('components.Queue.message.webglUnsupported')">
|
||||
<button
|
||||
v-if="coverType === CoverType.COVER_ART"
|
||||
class="ui secondary button"
|
||||
:aria-label="labels.showVisualizer"
|
||||
:title="labels.showVisualizer"
|
||||
:disabled="!isWebGLSupported"
|
||||
@click="coverType = CoverType.MILK_DROP"
|
||||
>
|
||||
<i class="icon signal" />
|
||||
</button>
|
||||
<button
|
||||
v-else-if="coverType === CoverType.MILK_DROP"
|
||||
class="ui secondary button"
|
||||
:aria-label="labels.showCoverArt"
|
||||
:title="labels.showCoverArt"
|
||||
:disabled="!isWebGLSupported"
|
||||
@click="coverType = CoverType.COVER_ART"
|
||||
>
|
||||
<i class="icon image outline" />
|
||||
</button>
|
||||
</tooltip>
|
||||
|
||||
<button
|
||||
v-if="!fullscreen"
|
||||
|
|
|
@ -1,15 +1,25 @@
|
|||
<script setup lang="ts">
|
||||
|
||||
interface Props {
|
||||
content: string
|
||||
content: string | false
|
||||
tag?: string
|
||||
}
|
||||
|
||||
defineProps<Props>()
|
||||
withDefaults(defineProps<Props>(), {
|
||||
tag: 'span'
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span
|
||||
class="tooltip"
|
||||
<component
|
||||
:is="tag"
|
||||
v-if="content"
|
||||
:data-tooltip="content"
|
||||
><i class="question circle icon" /></span>
|
||||
class="tooltip"
|
||||
>
|
||||
<slot>
|
||||
<i class="question circle icon" />
|
||||
</slot>
|
||||
</component>
|
||||
<slot v-else />
|
||||
</template>
|
||||
|
|
|
@ -178,7 +178,8 @@
|
|||
},
|
||||
"message": {
|
||||
"automaticPlay": "The next track will play automatically in a few seconds…",
|
||||
"radio": "New tracks will be appended here automatically."
|
||||
"radio": "New tracks will be appended here automatically.",
|
||||
"webglUnsupported": "Your browser does not support WebGL2 context"
|
||||
},
|
||||
"warning": {
|
||||
"connectivity": "You may have a connectivity issue."
|
||||
|
|
|
@ -364,6 +364,11 @@
|
|||
opacity: 0;
|
||||
transform: translateY(0.5em);
|
||||
}
|
||||
|
||||
.tooltip {
|
||||
z-index: 2;
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
button {
|
||||
z-index: 2;
|
||||
|
|
Loading…
Reference in New Issue