track > variation : add bg color

This commit is contained in:
isUnknown 2025-06-06 12:22:59 +02:00
parent 099479dc45
commit 760e17287e
5 changed files with 15 additions and 4 deletions

View file

@ -4,6 +4,11 @@ tabs:
contentTab: contentTab:
label: Contenu label: Contenu
fields: fields:
backgroundColor:
label: Couleur de fond
type: color
default: "#E6E6E6"
placeholder: "#E6E6E6"
views: views:
label: Rendu label: Rendu
type: files type: files

View file

@ -103,6 +103,7 @@ class ProjectPage extends NotificationsPage {
$trackData = [ $trackData = [
'title' => (string) $track->title(), 'title' => (string) $track->title(),
'slug' => (string) $track->slug(), 'slug' => (string) $track->slug(),
'backgroundColor' => (string) $track->backgroundColor(),
'files' => [], 'files' => [],
]; ];

View file

@ -35,7 +35,11 @@
v-if="activeTrack.files.length > 1" v-if="activeTrack.files.length > 1"
:activeTrack="activeTrack" :activeTrack="activeTrack"
/> />
<SingleImage v-else :file="activeTrack.files[0]" /> <SingleImage
v-else
:file="activeTrack.files[0]"
:backgroundColor="activeTrack.backgroundColor"
/>
</template> </template>
<div <div
v-if="isCompareModeEnabled && activeTracks.length < 2" v-if="isCompareModeEnabled && activeTracks.length < 2"

View file

@ -1,5 +1,5 @@
<template> <template>
<figure> <figure :style="'--bg-color:' + activeTrack.backgroundColor">
<div <div
@mousedown="enableDragToRotate" @mousedown="enableDragToRotate"
@touchstart="enableDragToRotate" @touchstart="enableDragToRotate"

View file

@ -1,5 +1,5 @@
<template> <template>
<figure> <figure :style="'--bg-color:' + backgroundColor">
<img :src="file.url" alt="" /> <img :src="file.url" alt="" />
</figure> </figure>
</template> </template>
@ -9,7 +9,8 @@ import { storeToRefs } from 'pinia';
import { useVirtualSampleStore } from '../../../stores/virtualSample'; import { useVirtualSampleStore } from '../../../stores/virtualSample';
import { watch } from 'vue'; import { watch } from 'vue';
const { file } = defineProps({ const { file, backgroundColor } = defineProps({
backgroundColor: String,
file: Object, file: Object,
}); });