Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2346>
environments/review-docs-nginx-aqlin2/deployments/17397
Kasper Seweryn 2023-02-01 13:59:11 +01:00 zatwierdzone przez Marge
rodzic 8713d3b98a
commit 8d353a27a9
4 zmienionych plików z 53 dodań i 24 usunięć

Wyświetl plik

@ -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"

Wyświetl plik

@ -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>

Wyświetl plik

@ -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."

Wyświetl plik

@ -364,6 +364,11 @@
opacity: 0;
transform: translateY(0.5em);
}
.tooltip {
z-index: 2;
pointer-events: all;
}
button {
z-index: 2;