FEAT: side A/B
All checks were successful
Deploy App / build (push) Successful in 14s
Deploy App / deploy (push) Successful in 9s

This commit is contained in:
valere
2025-11-15 21:56:37 +01:00
parent 3424d2d6fc
commit 1b8b998622
49 changed files with 563 additions and 822 deletions

View File

@@ -4,5 +4,6 @@
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit" "source.fixAll.eslint": "explicit"
}, },
"eslint.useFlatConfig": true "eslint.useFlatConfig": true,
"svg.preview.background": "editor"
} }

View File

@@ -2,13 +2,15 @@
<article class="box box-scene z-10" ref="scene"> <article class="box box-scene z-10" ref="scene">
<div ref="domBox" class="box-object" :class="{ 'is-draggable': isDraggable }"> <div ref="domBox" class="box-object" :class="{ 'is-draggable': isDraggable }">
<div class="face front relative" ref="frontFace"> <div class="face front relative" ref="frontFace">
<img v-if="box.duration" class="cover absolute" :src="`/${box.id}/cover.jpg`" alt="" /> <img v-if="isCompilation" class="cover absolute" :src="`/${box.id}/${box.activeSide}/cover.jpg`" alt="" />
<div class="size-full flex flex-col justify-center items-center text-7xl" v-html="box.description" v-else /> <div v-else class="size-full flex flex-col justify-center items-center text-7xl text-black"
v-html="box.description" />
</div> </div>
<div class="face back flex flex-col flex-wrap items-start p-4 overflow-hidden" ref="backFace"> <div class="face back flex flex-row flex-wrap items-start p-4 overflow-hidden"
:class="{ 'overflow-y-scroll': !isCompilation }" ref="backFace">
<li class="list-none text-xxs w-1/2 flex flex-row" <li class="list-none text-xxs w-1/2 flex flex-row"
v-for="track in dataStore.getTracksByboxId(box.id).slice(0, -1)" :key="track.id" :track="track"> v-for="track in dataStore.getTracksByboxId(box.id, box.activeSide)" :key="track.id" :track="track">
<span class="" v-if="isNotManifesto"> {{ track.order }}. </span> <span class="text-slate-700" v-if="isNotManifesto"> {{ track.order }}. </span>
<p class="text-left text-slate-700"> <p class="text-left text-slate-700">
<i class="text-slate-950"> <i class="text-slate-950">
{{ track.title }} {{ track.title }}
@@ -21,14 +23,13 @@
<div class="face right" ref="rightFace" /> <div class="face right" ref="rightFace" />
<div class="face left" ref="leftFace" /> <div class="face left" ref="leftFace" />
<div class="face top" ref="topFace"> <div class="face top" ref="topFace">
<template v-if="box.type === 'compilation'"> <template v-if="isCompilation">
<img class="logo h-full p-1" src="/logo.svg" alt="" /> <img class="logo h-full p-3" src="/logo.svg" alt="" />
<img class="absolute block h-9" style="left: 5%" :src="`/${box.id}/title.svg`" alt="" /> <img class="absolute block h-10" style="left: 5%" :src="`/${box.id}/${box.activeSide}/title.svg`" alt="" />
</template> </template>
<template v-if="box.type === 'playlist'"> <template v-if="box.type === 'playlist'">
<span class="absolute block h-1/2 right-6"> playlist </span> <span class="absolute block h-1/2 right-6 text-black"> </span>
<img class="logo h-full p-1" src="/favicon.svg" alt="" /> <span class="absolute block h-1/2 text-black" style="left: 5%">
<span class="absolute block h-1/2" style="left: 5%">
{{ box.name }} {{ box.name }}
</span> </span>
</template> </template>
@@ -55,6 +56,7 @@ const { $isMobile } = useNuxtApp()
const dataStore = useDataStore() const dataStore = useDataStore()
const isDraggable = computed(() => !['box-list', 'box-hidden'].includes(props.box.state)) const isDraggable = computed(() => !['box-list', 'box-hidden'].includes(props.box.state))
const isNotManifesto = computed(() => !props.box.id.startsWith('ES00')) const isNotManifesto = computed(() => !props.box.id.startsWith('ES00'))
const isCompilation = computed(() => props.box.type === 'compilation')
// --- Réfs --- // --- Réfs ---
const scene = ref<HTMLElement>() const scene = ref<HTMLElement>()
@@ -128,6 +130,20 @@ function applyColor() {
bottomFace.value.style.background = props.box.color1 bottomFace.value.style.background = props.box.color1
} }
// --- Rotation complète ---
function rotateBox() {
if (!domBox.value) return
rotateY.value = rotateY.value === 20 ? 380 : 20
applyTransform(0.8)
}
watch(
() => props.box.activeSide,
() => {
rotateBox()
}
)
// --- Inertie --- // --- Inertie ---
function tickInertia() { function tickInertia() {
if (!enableInertia) return if (!enableInertia) return
@@ -296,13 +312,14 @@ watch(isDraggable, (enabled) => (enabled ? addListeners() : removeListeners()))
font-weight: 600; font-weight: 600;
backface-visibility: hidden; backface-visibility: hidden;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid black; // border: 1px solid black;
} }
.front, .front,
.back { .back {
width: 100%; width: 100%;
height: 100%; height: 100%;
filter: brightness(1.1);
} }
.face.top, .face.top,
@@ -319,6 +336,7 @@ watch(isDraggable, (enabled) => (enabled ? addListeners() : removeListeners()))
.face.right { .face.right {
width: var(--depth); width: var(--depth);
height: var(--height); height: var(--height);
filter: brightness(0.8);
} }
.face.front { .face.front {

View File

@@ -5,18 +5,18 @@
aria-label="close the box"> aria-label="close the box">
close close
</button> </button>
<box v-for="(box, i) in dataStore.boxes.slice()" :key="box.id" :tabindex="dataStore.boxes.length - i" :box="box" <box v-for="(box, i) in dataStore.boxes" :key="box.id" :tabindex="dataStore.boxes.length - i"
@click="openBox(box)" class="text-center" :class="box.state" :id="box.id"> :box="getBoxToDisplay(box)" @click="openBox(box)" class="text-center" :class="box.state" :id="box.id">
<playButton @click.stop="playSelectedBox(box)" :objectToPlay="box" class="relative z-40 m-auto" /> <playButton @click.stop="playSelectedBox(box)" :objectToPlay="box" class="relative z-40 m-auto" />
<template v-if="box.state === 'box-selected'"> <template v-if="box.state === 'box-selected'">
<deckCompilation :box="box" class="box-page" v-if="box.type === 'compilation'" @click.stop /> <deckCompilation :box="getBoxToDisplay(box)" class="box-page" v-if="box.type === 'compilation'" @click.stop />
<deckPlaylist :box="box" class="box-page" v-if="box.type === 'playlist'" @click.stop /> <deckPlaylist :box="box" class="box-page" v-if="box.type === 'playlist'" @click.stop />
</template> </template>
</box> </box>
</div> </div>
</template> </template>
<script setup lang="ts"> <script lang="ts" setup>
import type { Box } from '~~/types/types' import type { Box } from '~~/types/types'
import { useDataStore } from '~/store/data' import { useDataStore } from '~/store/data'
import { usePlayerStore } from '~/store/player' import { usePlayerStore } from '~/store/player'
@@ -26,6 +26,19 @@ const dataStore = useDataStore()
const playerStore = usePlayerStore() const playerStore = usePlayerStore()
const uiStore = useUiStore() const uiStore = useUiStore()
// Retourne la box avec les propriétés du côté sélectionné si c'est une compilation
function getBoxToDisplay(box: Box) {
if (box.type !== 'compilation' || !('sides' in box)) return box
const side = box.sides?.[box.activeSide]
if (!side) return box
return {
...box,
...side
}
}
function openBox(box: Box) { function openBox(box: Box) {
if (box.state !== 'box-selected') { if (box.state !== 'box-selected') {
uiStore.selectBox(box.id) uiStore.selectBox(box.id)
@@ -44,32 +57,36 @@ function playSelectedBox(box: Box) {
<style lang="scss" scoped> <style lang="scss" scoped>
.boxes { .boxes {
@apply flex flex-col items-center justify-center text-center w-full; display: flex;
position: absolute; flex-direction: column;
top: 0; align-items: center;
left: 0; justify-content: center;
margin-top: 250px; text-align: center;
transition: margin-top .5s ease; width: 100%;
transition: margin-top 0.5s ease;
min-height: 100vh;
&.box-selected { &.box-selected {
margin-top: 0; justify-content: flex-start;
.box { .box {
@apply w-full; width: 100%;
} }
} }
.box { .box {
.play-button { .play-button {
@apply relative z-40 -bottom-1/2 opacity-0; position: relative;
z-index: 40;
bottom: -50%;
opacity: 0;
} }
&.box-selected .play-button { &.box-selected .play-button {
@apply opacity-100 z-20; opacity: 1;
z-index: 20;
bottom: 20%; bottom: 20%;
transition: transition: bottom 0.7s ease, opacity 0.7s ease;
bottom 0.7s ease,
opacity 0.7s ease;
} }
} }
} }

View File

@@ -6,7 +6,7 @@
<div class="flip-inner"> <div class="flip-inner">
<!-- Face-Up --> <!-- Face-Up -->
<main <main
class="face-up backdrop-blur-sm border-2 border-esyellow z-10 card w-56 h-80 p-3 hover:shadow-xl hover:scale-110 transition-all rounded-2xl shadow-lg flex flex-col overflow-hidden"> class="face-up backdrop-blur-sm border-2 z-10 card w-56 h-80 p-3 hover:shadow-xl hover:scale-110 transition-all rounded-2xl shadow-lg flex flex-col overflow-hidden">
<div class="flex items-center justify-center size-7 absolute top-7 right-7" v-if="isPlaylistTrack"> <div class="flex items-center justify-center size-7 absolute top-7 right-7" v-if="isPlaylistTrack">
<div class="suit text-7xl absolute" <div class="suit text-7xl absolute"
:class="[isRedCard ? 'text-red-600' : 'text-slate-800', props.track.card?.suit]"> :class="[isRedCard ? 'text-red-600' : 'text-slate-800', props.track.card?.suit]">

View File

@@ -6,7 +6,6 @@
<img v-if="playerStore.getCurrentCoverUrl" :src="playerStore.getCurrentCoverUrl as string" alt="Current cover" <img v-if="playerStore.getCurrentCoverUrl" :src="playerStore.getCurrentCoverUrl as string" alt="Current cover"
class="size-16 object-cover object-center rounded"> class="size-16 object-cover object-center rounded">
</NuxtLink> </NuxtLink>
<toggleFavorite v-if="playerStore.currentTrack" :track="playerStore.currentTrack" />
<audio ref="audioRef" class="flex-1" controls /> <audio ref="audioRef" class="flex-1" controls />
</div> </div>
</div> </div>

View File

@@ -1,83 +1,44 @@
<template> <template>
<transition name="fade"> <transition name="fade">
<div <div v-if="ui.showSearch" class="fixed inset-0 z-50 flex items-center justify-center transition-all">
v-if="ui.showSearch"
class="fixed inset-0 z-50 flex items-center justify-center transition-all"
>
<div class="absolute inset-0 bg-black/60 backdrop-blur-md" @click="close"></div> <div class="absolute inset-0 bg-black/60 backdrop-blur-md" @click="close"></div>
<div <div
class="relative w-full max-w-2xl rounded-xl bg-white shadow-xl ring-1 ring-slate-200 dark:bg-slate-900 dark:ring-slate-700" class="relative w-full max-w-2xl rounded-xl bg-white shadow-xl ring-1 ring-slate-200 dark:bg-slate-900 dark:ring-slate-700"
role="dialog" role="dialog" aria-modal="true" @keydown.esc.prevent.stop="close">
aria-modal="true"
@keydown.esc.prevent.stop="close"
>
<div class="flex items-center gap-2 dark:border-slate-700"> <div class="flex items-center gap-2 dark:border-slate-700">
<svg <svg class="ml-4 h-7 w-7 text-slate-500" viewBox="0 0 24 24" fill="none" stroke="currentColor"
class="ml-4 h-7 w-7 text-slate-500" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="11" cy="11" r="8" /> <circle cx="11" cy="11" r="8" />
<path d="m21 21-4.3-4.3" /> <path d="m21 21-4.3-4.3" />
</svg> </svg>
<input <input ref="inputRef" v-model="ui.searchQuery" type="text" placeholder="Rechercher boxes, artistes, tracks..."
ref="inputRef"
v-model="ui.searchQuery"
type="text"
placeholder="Rechercher boxes, artistes, tracks..."
class="flex-1 bg-transparent px-2 py-2 text-slate-900 text-3xl placeholder-slate-400 outline-none dark:text-slate-100" class="flex-1 bg-transparent px-2 py-2 text-slate-900 text-3xl placeholder-slate-400 outline-none dark:text-slate-100"
@keydown.down.prevent="move(1)" @keydown.down.prevent="move(1)" @keydown.up.prevent="move(-1)" @keydown.enter.prevent="confirm" />
@keydown.up.prevent="move(-1)"
@keydown.enter.prevent="confirm"
/>
</div> </div>
<div class="max-h-72 overflow-auto results-scroll"> <div class="max-h-72 overflow-auto results-scroll">
<template v-if="results.length"> <template v-if="results.length">
<ul class="divide-y divide-slate-100 dark:divide-slate-800"> <ul class="divide-y divide-slate-100 dark:divide-slate-800">
<li <li v-for="(resultItem, idx) in results" :key="resultItem.key" :class="[
v-for="(resultItem, idx) in results" 'flex cursor-pointer items-center justify-between gap-3 px-2 py-3 hover:bg-slate-50 dark:hover:bg-slate-800',
:key="resultItem.key" idx === activeIndex ? 'bg-slate-100 dark:bg-slate-800' : ''
:class="[ ]" @mouseenter="activeIndex = idx" @click="selectResult(resultItem)">
'flex cursor-pointer items-center justify-between gap-3 px-2 py-3 hover:bg-slate-50 dark:hover:bg-slate-800',
idx === activeIndex ? 'bg-slate-100 dark:bg-slate-800' : ''
]"
@mouseenter="activeIndex = idx"
@click="selectResult(resultItem)"
>
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<img <img v-if="coverUrlFor(resultItem)" :src="coverUrlFor(resultItem)" alt="" loading="lazy"
v-if="coverUrlFor(resultItem)" class="h-10 w-10 rounded object-cover ring-1 ring-slate-200 dark:ring-slate-700" />
:src="coverUrlFor(resultItem)"
alt=""
loading="lazy"
class="h-10 w-10 rounded object-cover ring-1 ring-slate-200 dark:ring-slate-700"
/>
<span <span
class="inline-flex min-w-[68px] items-center justify-center rounded-md border px-2 py-0.5 text-xs font-semibold uppercase text-slate-600 dark:text-slate-300 dark:border-slate-600" class="inline-flex min-w-[68px] items-center justify-center rounded-md border px-2 py-0.5 text-xs font-semibold uppercase text-slate-600 dark:text-slate-300 dark:border-slate-600">{{
>{{ resultItem.type }}</span resultItem.type }}</span>
>
<span class="text-slate-900 dark:text-slate-100">{{ resultItem.label }}</span> <span class="text-slate-900 dark:text-slate-100">{{ resultItem.label }}</span>
</div> </div>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<span <span v-if="resultItem.sublabel" class="text-sm text-slate-500 dark:text-slate-400">{{
v-if="resultItem.sublabel" resultItem.sublabel }}</span>
class="text-sm text-slate-500 dark:text-slate-400"
>{{ resultItem.sublabel }}</span
>
<toggleFavorite v-if="resultItem.type === 'TRACK'" :track="resultItem.payload" />
</div> </div>
</li> </li>
</ul> </ul>
</template> </template>
<div <div v-else-if="ui.searchQuery" class="px-2 py-6 text-center text-slate-500 dark:text-slate-400">
v-else-if="ui.searchQuery"
class="px-2 py-6 text-center text-slate-500 dark:text-slate-400"
>
Aucun résultat Aucun résultat
</div> </div>
</div> </div>
@@ -91,12 +52,10 @@ import { computed, nextTick, onMounted, ref, watch } from 'vue'
import { useUiStore } from '~/store/ui' import { useUiStore } from '~/store/ui'
import { useDataStore } from '~/store/data' import { useDataStore } from '~/store/data'
import { usePlayerStore } from '~/store/player' import { usePlayerStore } from '~/store/player'
import { useFavoritesStore } from '~/store/favorites'
const ui = useUiStore() const ui = useUiStore()
const data = useDataStore() const data = useDataStore()
const player = usePlayerStore() const player = usePlayerStore()
const fav = useFavoritesStore()
const inputRef = ref<HTMLInputElement | null>(null) const inputRef = ref<HTMLInputElement | null>(null)
const activeIndex = ref(0) const activeIndex = ref(0)
@@ -195,15 +154,10 @@ const selectResult = (ResultItem: ResultItem) => {
} }
} else if (ResultItem.type === 'TRACK') { } else if (ResultItem.type === 'TRACK') {
const track = ResultItem.payload const track = ResultItem.payload
// If the selected track is a favorite, just play it without navigating/selecting its box const box = data.getBoxById(track.boxId)
if (fav.isFavorite(track.id)) { if (box) {
ui.selectBox(box.id)
player.playTrack(track) player.playTrack(track)
} else {
const box = data.getBoxById(track.boxId)
if (box) {
ui.selectBox(box.id)
player.playTrack(track)
}
} }
} }
close() close()

View File

@@ -1,41 +0,0 @@
<template>
<button
class="p-1 rounded hover:bg-slate-100 transition-colors duration-300"
aria-label="Toggle favorite"
@click.stop="fav.toggle(props.track)"
>
<svg
v-if="fav.isFavorite(props.track.id)"
class="h-5 w-5 text-amber-400 hover:text-amber-300"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"
/>
</svg>
<svg
v-else
class="h-5 w-5 text-slate-400"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"
/>
</svg>
</button>
</template>
<script setup lang="ts">
import { useFavoritesStore } from '~/store/favorites'
import type { Track } from '~/../types/types'
const fav = useFavoritesStore()
const props = defineProps<{ track: Track }>()
</script>

View File

@@ -9,13 +9,20 @@
<button @click="distribute">distribute</button> <button @click="distribute">distribute</button>
<button @click="halfOutside">halfOutside</button> <button @click="halfOutside">halfOutside</button>
<button @click="backToBox">backToBox</button> <button @click="backToBox">backToBox</button>
<button @click="selectSide('A')" class="px-4 py-2 text-black"
:class="{ 'bg-white text-black': props.box.activeSide === 'A' }">
Side A
</button>
<button @click="selectSide('B')" class="px-4 py-2"
:class="{ 'bg-white text-black': props.box.activeSide === 'B' }">
Side B
</button>
</li> </li>
</ul> </ul>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, onMounted, ref } from 'vue'
import { useDataStore } from '~/store/data' import { useDataStore } from '~/store/data'
import { useCardStore } from '~/store/card' import { useCardStore } from '~/store/card'
import { usePlayerStore } from '~/store/player' import { usePlayerStore } from '~/store/player'
@@ -31,7 +38,7 @@ const playerStore = usePlayerStore()
const deck = ref() const deck = ref()
const tracks = computed(() => const tracks = computed(() =>
dataStore.getTracksByboxId(props.box.id).sort((a, b) => (a.order ?? 0) - (b.order ?? 0)) dataStore.getTracksByboxId(props.box.id, props.box.activeSide).sort((a, b) => (a.order ?? 0) - (b.order ?? 0))
) )
const isCardRevealed = (trackId: number) => cardStore.isCardRevealed(trackId) const isCardRevealed = (trackId: number) => cardStore.isCardRevealed(trackId)
@@ -58,6 +65,11 @@ const backToBox = () => {
}) })
} }
// Fonction pour sélectionner un côté (A ou B)
const selectSide = (side: 'A' | 'B') => {
dataStore.setActiveSideByBoxId(props.box.id, side)
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -1,31 +1,10 @@
<template> <template>
<div class="w-full min-h-screen flex flex-col items-center bg-gray-50"> <div class="w-full flex flex-col items-center">
<!-- Header avec logo --> <!-- Header avec logo -->
<header <slot />
class="w-full bg-white shadow-sm overflow-hidden transition-all duration-300 ease-in-out"
:class="{ 'h-0 py-0': uiStore.getSelectedBox, 'py-4 h-auto': !uiStore.getSelectedBox }"
>
<div class="max-w-7xl mx-auto w-full flex justify-center">
<a href="/" class="inline-block">
<logo />
</a>
</div>
</header>
<!-- Contenu principal -->
<main>
<slot />
</main>
<!-- Player de musique fixe en bas --> <!-- Player de musique fixe en bas -->
<searchModal /> <searchModal />
<loader /> <loader />
<Player class="w-full border-t border-gray-200" /> <Player class="w-full border-t border-gray-200" />
</div> </div>
</template> </template>
<script setup>
import { useUiStore } from '~/store/ui'
const uiStore = useUiStore()
</script>

View File

@@ -1,45 +0,0 @@
<template>
<div class="deck">
<card
v-for="track in tracks"
:key="track.id"
:track="track"
:is-face-up="track.isFaceUp"
@click="flipCard(track)"
/>
</div>
</template>
<script setup>
import { useDataStore } from '~/store/data'
const tracks = ref([])
definePageMeta({
layout: 'default'
})
onMounted(async () => {
const dataStore = useDataStore()
await dataStore.loadData()
tracks.value = dataStore.getTracksByboxId('ES2025')
})
function flipCard(track) {
track.isFaceUp = !track.isFaceUp
}
</script>
<style lang="scss" scoped>
.logo {
filter: drop-shadow(3px 3px 0 rgb(0 0 0 / 0.7));
}
.deck {
position: relative;
height: 80vh;
.card {
z-index: 10;
position: relative;
}
}
</style>

View File

@@ -2,41 +2,20 @@
<div> <div>
<button <button
class="fixed bottom-4 right-4 bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded-full shadow-lg z-50 transition-colors" class="fixed bottom-4 right-4 bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded-full shadow-lg z-50 transition-colors"
title="Ranger les cartes" title="Ranger les cartes" @click="arrangeCards">
@click="arrangeCards" <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16m-7 6h7" />
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 6h16M4 12h16m-7 6h7"
/>
</svg> </svg>
</button> </button>
<div ref="deck" class="deck"> <div ref="deck" class="deck">
<card <card v-for="track in tracks" :key="track.id" :track="track"
v-for="track in tracks" :class="['card', 'id-' + track.id, { dragging: dragging === track }]" :style="{
:key="track.id"
:track="track"
:class="['card', 'id-' + track.id, { dragging: dragging === track }]"
:style="{
top: track.y + 'px', top: track.y + 'px',
left: track.x + 'px', left: track.x + 'px',
zIndex: track.zIndex || 1, zIndex: track.zIndex || 1,
transform: `rotate(${track.rotation || 0}deg)` transform: `rotate(${track.rotation || 0}deg)`
}" }" :is-face-up="track.isFaceUp" @mousedown="startDrag($event, track)" @click="flipCard(track)" />
:is-face-up="track.isFaceUp"
@mousedown="startDrag($event, track)"
@click="flipCard(track)"
/>
</div> </div>
</div> </div>
</template> </template>
@@ -59,7 +38,7 @@ definePageMeta({ layout: 'default' })
onMounted(async () => { onMounted(async () => {
await dataStore.loadData() await dataStore.loadData()
tracks.value = dataStore.getTracksByboxId('ES2025').map((t, i) => ({ tracks.value = dataStore.getTracksByboxId('ESPLAYLIST').map((t, i) => ({
...t, ...t,
x: t.x ?? 50 + i * 20, x: t.x ?? 50 + i * 20,
y: t.y ?? 50 + i * 20, y: t.y ?? 50 + i * 20,

View File

@@ -1,21 +1,9 @@
<template> <template>
<div class="deck"> <div class="deck">
<draggable <draggable v-model="tracks" item-key="id" class="draggable-container" @start="drag = true" @end="onDragEnd">
v-model="tracks"
item-key="id"
class="draggable-container"
@start="drag = true"
@end="onDragEnd"
>
<template #item="{ element: track }"> <template #item="{ element: track }">
<card <card :key="track.id" :track="track" tabindex="0" :is-face-up="track.isFaceUp" class="draggable-item"
:key="track.id" @click="flipCard(track)" />
:track="track"
tabindex="0"
:is-face-up="track.isFaceUp"
class="draggable-item"
@click="flipCard(track)"
/>
</template> </template>
</draggable> </draggable>
</div> </div>
@@ -35,7 +23,7 @@ definePageMeta({
onMounted(async () => { onMounted(async () => {
const dataStore = useDataStore() const dataStore = useDataStore()
await dataStore.loadData() await dataStore.loadData()
tracks.value = dataStore.getTracksByboxId('ES2025') tracks.value = dataStore.getTracksByboxId('ESPLAYLIST')
}) })
function flipCard(track) { function flipCard(track) {

View File

@@ -2,7 +2,8 @@
<boxes /> <boxes />
</template> </template>
<script setup> <script setup lang="ts">
import { useRoute } from 'vue-router'
import { useUiStore } from '~/store/ui' import { useUiStore } from '~/store/ui'
import { useDataStore } from '~/store/data' import { useDataStore } from '~/store/data'
import { usePlayerStore } from '~/store/player' import { usePlayerStore } from '~/store/player'

View File

@@ -1,6 +0,0 @@
import { useFavoritesStore } from '~/store/favorites'
export default defineNuxtPlugin(() => {
const fav = useFavoritesStore()
fav.load()
})

View File

@@ -1,9 +1,5 @@
import type { Box, Artist, Track } from '~/../types/types' import type { Box, Artist, Track } from '~/../types/types'
import { FAVORITES_BOX_ID, useFavoritesStore } from '~/store/favorites'
// stores/data.ts
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { useUiStore } from '~/store/ui'
export const useDataStore = defineStore('data', { export const useDataStore = defineStore('data', {
state: () => ({ state: () => ({
@@ -37,7 +33,7 @@ export const useDataStore = defineStore('data', {
artistObj = { id: 0, name: a, url: '', coverId: '' } artistObj = { id: 0, name: a, url: '', coverId: '' }
} else if (a && typeof a === 'object' && 'id' in (a as any)) { } else if (a && typeof a === 'object' && 'id' in (a as any)) {
const idVal = (a as any).id as number | undefined const idVal = (a as any).id as number | undefined
artistObj = idVal != null ? (artistMap.get(idVal) ?? (a as Artist)) : (a as Artist) artistObj = idVal != null ? artistMap.get(idVal) ?? (a as Artist) : (a as Artist)
} else { } else {
artistObj = { id: 0, name: '', url: '', coverId: '' } artistObj = { id: 0, name: '', url: '', coverId: '' }
} }
@@ -47,25 +43,17 @@ export const useDataStore = defineStore('data', {
artist: artistObj artist: artistObj
} }
}) })
const favBox: Box = {
id: FAVORITES_BOX_ID,
type: 'playlist',
name: 'Favoris',
duration: 0,
tracks: [],
description: '',
color1: '#0f172a',
color2: '#1e293b',
color3: '#334155',
state: 'box-list'
}
if (!this.boxes.find((b) => b.id === FAVORITES_BOX_ID)) {
this.boxes = [...this.boxes, favBox]
}
this.isLoaded = true this.isLoaded = true
} finally { } finally {
this.isLoading = false this.isLoading = false
} }
},
setActiveSideByBoxId(boxId: string, side: 'A' | 'B') {
const box = this.boxes.find((box) => box.id === boxId.replace(/[AB]$/, ''))
if (box) {
box.activeSide = side
}
} }
}, },
@@ -76,15 +64,16 @@ export const useDataStore = defineStore('data', {
return state.boxes.find((box) => box.id === id) return state.boxes.find((box) => box.id === id)
} }
}, },
// Obtenir toutes les pistes d'une box donnée getTracksByboxId: (state) => (id: string, side?: 'A' | 'B') => {
getTracksByboxId: (state) => (id: string) => { const box = state.boxes.find((box) => box.id === id)
if (id === FAVORITES_BOX_ID) { if (box?.type !== 'compilation' || !side) {
const fav = useFavoritesStore() return state.tracks.filter((track) => track.boxId === id)
return fav.trackIds
.map((tid) => state.tracks.find((t) => t.id === tid))
.filter((t): t is Track => !!t)
} }
return state.tracks.filter((track) => track.boxId === id) return state.tracks.filter((track) => track.boxId === id && track.side === side)
},
getActiveSideByBoxId: (state) => (id: string) => {
const box = state.boxes.find((box) => box.id === id)
return box?.activeSide
}, },
// Filtrer les artistes selon certains critères // Filtrer les artistes selon certains critères
getArtistById: (state) => (id: number) => state.artists.find((artist) => artist.id === id), getArtistById: (state) => (id: number) => state.artists.find((artist) => artist.id === id),
@@ -101,7 +90,7 @@ export const useDataStore = defineStore('data', {
}, },
getFirstTrackOfBox() { getFirstTrackOfBox() {
return (box: Box) => { return (box: Box) => {
const tracks = this.getTracksByboxId(box.id) const tracks = this.getTracksByboxId(box.id, box.activeSide)
.slice() .slice()
.sort((a, b) => (a.order ?? 0) - (b.order ?? 0)) .sort((a, b) => (a.order ?? 0) - (b.order ?? 0))
return tracks.length > 0 ? tracks[0] : null return tracks.length > 0 ? tracks[0] : null
@@ -123,7 +112,7 @@ export const useDataStore = defineStore('data', {
return (track: Track) => { return (track: Track) => {
// Récupérer toutes les tracks de la même box et les trier par ordre // Récupérer toutes les tracks de la même box et les trier par ordre
const tracksInBox = state.tracks const tracksInBox = state.tracks
.filter((t) => t.boxId === track.boxId) .filter((t) => t.boxId === track.boxId && t.side === track.side)
.sort((a, b) => (a.order ?? 0) - (b.order ?? 0)) .sort((a, b) => (a.order ?? 0) - (b.order ?? 0))
// Trouver lindex de la track courante // Trouver lindex de la track courante
@@ -135,7 +124,7 @@ export const useDataStore = defineStore('data', {
getPrevTrack: (state) => { getPrevTrack: (state) => {
return (track: Track) => { return (track: Track) => {
const tracksInBox = state.tracks const tracksInBox = state.tracks
.filter((t) => t.boxId === track.boxId) .filter((t) => t.boxId === track.boxId && t.side === track.side)
.sort((a, b) => (a.order ?? 0) - (b.order ?? 0)) .sort((a, b) => (a.order ?? 0) - (b.order ?? 0))
const index = tracksInBox.findIndex((t) => t.id === track.id) const index = tracksInBox.findIndex((t) => t.id === track.id)

View File

@@ -1,144 +0,0 @@
import { defineStore } from 'pinia'
import type { Track, Box, BoxType, Artist } from '~/../types/types'
export const FAVORITES_BOX_ID = 'FAV'
const STORAGE_KEY = 'evilspins:favorites:v2' // Version changée pour forcer la mise à jour
export const useFavoritesStore = defineStore('favorites', {
state: () => ({
favoritesPlaylist: {
id: FAVORITES_BOX_ID,
type: 'userPlaylist' as BoxType,
name: 'Favoris',
description: 'Vos titres favoris',
color1: '#FFD700',
color2: '#FFA500',
color3: '#FF8C00',
duration: 0,
state: 'box-hidden',
tracks: [] as Track[],
isPublic: false
} as Box,
version: 1
}),
getters: {
trackIds: (state) => state.favoritesPlaylist.tracks?.map((t) => t.id) || [],
tracks: (state) => state.favoritesPlaylist.tracks || [],
isFavorite: (state) => (trackId: number) =>
state.favoritesPlaylist.tracks?.some((t) => t.id === trackId) || false
},
actions: {
load() {
if (!process.client) return
try {
const raw = localStorage.getItem(STORAGE_KEY)
if (raw) {
const data = JSON.parse(raw)
if (data.version === this.version && data.playlist) {
this.favoritesPlaylist = { ...this.favoritesPlaylist, ...data.playlist }
} else if (Array.isArray(data)) {
// Migration depuis l'ancienne version
this.favoritesPlaylist.tracks = data
.filter((x) => typeof x === 'number')
.map((id) => ({ id }) as unknown as Track) // On ne stocke que l'ID, les infos seront complétées par le dataStore
}
}
} catch (error) {
console.error('Error loading favorites:', error)
}
},
save() {
if (!process.client) return
try {
localStorage.setItem(
STORAGE_KEY,
JSON.stringify({
version: this.version,
playlist: this.favoritesPlaylist
})
)
} catch (error) {
console.error('Error saving favorites:', error)
}
},
// Crée une copie virtuelle d'une piste pour les favoris
createVirtualTrack(originalTrack: Track): Track {
// Crée une copie profonde de la piste
const virtualTrack = JSON.parse(JSON.stringify(originalTrack)) as Track
// Marque la piste comme provenant d'une playlist utilisateur
virtualTrack.source = 'userPlaylist'
virtualTrack.originalTrackId = originalTrack.id
virtualTrack.boxId = FAVORITES_BOX_ID
// Si la piste a un artiste sous forme d'objet, on le convertit en chaîne pour éviter les problèmes de référence
if (virtualTrack.artist && typeof virtualTrack.artist === 'object') {
virtualTrack.artist = (virtualTrack.artist as Artist).name
}
return virtualTrack
},
// Ajoute une piste aux favoris si elle n'y est pas déjà
add(track: Track) {
if (!this.isFavorite(track.id)) {
// Crée une copie virtuelle de la piste
const virtualTrack = this.createVirtualTrack(track)
if (!this.favoritesPlaylist.tracks) {
this.favoritesPlaylist.tracks = []
}
// Ajoute la piste virtuelle au début de la liste
this.favoritesPlaylist.tracks.unshift(virtualTrack)
this.updateDuration()
this.save()
}
},
// Supprime une piste des favoris
remove(trackId: number) {
if (this.favoritesPlaylist.tracks) {
const index = this.favoritesPlaylist.tracks.findIndex((t) => t.id === trackId)
if (index >= 0) {
this.favoritesPlaylist.tracks.splice(index, 1)
this.updateDuration()
this.save()
}
}
},
// Bascule l'état favori d'une piste
toggle(track: Track) {
if (this.isFavorite(track.id)) {
this.remove(track.id)
} else {
this.add(track)
}
},
// Met à jour la durée totale de la playlist
updateDuration() {
if (this.favoritesPlaylist.tracks) {
this.favoritesPlaylist.duration = this.favoritesPlaylist.tracks.reduce(
(total, track) => total + (track.duration || 0),
0
)
}
},
// Récupère la piste suivante dans les favoris
getNextTrack(currentTrackId: number): Track | null {
if (!this.favoritesPlaylist.tracks) return null
const currentIndex = this.favoritesPlaylist.tracks.findIndex((t) => t.id === currentTrackId)
if (currentIndex >= 0 && currentIndex < this.favoritesPlaylist.tracks.length - 1) {
const nextTrack = this.favoritesPlaylist.tracks[currentIndex + 1]
return nextTrack ? { ...nextTrack } : null
}
return null
}
}
})

View File

@@ -3,7 +3,6 @@ import { defineStore } from 'pinia'
import type { Track, Box } from '~/../types/types' import type { Track, Box } from '~/../types/types'
import { useDataStore } from '~/store/data' import { useDataStore } from '~/store/data'
import { useCardStore } from '~/store/card' import { useCardStore } from '~/store/card'
import { useFavoritesStore, FAVORITES_BOX_ID } from '~/store/favorites'
export const usePlayerStore = defineStore('player', { export const usePlayerStore = defineStore('player', {
state: () => ({ state: () => ({
@@ -40,18 +39,8 @@ export const usePlayerStore = defineStore('player', {
if (!track) return if (!track) return
const dataStore = useDataStore() const dataStore = useDataStore()
const favoritesStore = useFavoritesStore()
// Vérifier si on est dans la playlist des favoris
if (track.boxId === FAVORITES_BOX_ID) {
const nextTrack = favoritesStore.getNextTrack(track.id)
if (nextTrack) {
await this.playTrack(nextTrack)
return
}
}
// Comportement par défaut pour les playlists standards // Comportement par défaut pour les playlists standards
else if (track.type === 'playlist') { if (track.type === 'playlist') {
const next = dataStore.getNextPlaylistTrack(track) const next = dataStore.getNextPlaylistTrack(track)
if (next && next.boxId === track.boxId) { if (next && next.boxId === track.boxId) {
await this.playTrack(next) await this.playTrack(next)
@@ -85,16 +74,10 @@ export const usePlayerStore = defineStore('player', {
}, },
async playTrack(track: Track) { async playTrack(track: Track) {
// Si c'est une piste de la playlist utilisateur, on utilise directement cette piste // Pour les autres types de pistes, on utilise la logique existante
if (track.boxId === FAVORITES_BOX_ID) { this.isCompilationTrack(track)
this.currentTrack = track ? await this.playCompilationTrack(track)
await this.loadAndPlayTrack(track) : await this.playPlaylistTrack(track)
} else {
// Pour les autres types de pistes, on utilise la logique existante
this.isCompilationTrack(track)
? await this.playCompilationTrack(track)
: await this.playPlaylistTrack(track)
}
}, },
async playCompilationTrack(track: Track) { async playCompilationTrack(track: Track) {
@@ -214,7 +197,6 @@ export const usePlayerStore = defineStore('player', {
async togglePlay() { async togglePlay() {
if (!this.audio) return if (!this.audio) return
try { try {
if (this.audio.paused) { if (this.audio.paused) {
await this.audio.play() await this.audio.play()
@@ -240,11 +222,11 @@ export const usePlayerStore = defineStore('player', {
this.progressionLast = progression this.progressionLast = progression
} }
// update current track when changing time in compilation // update current track when changing time in compilation
const cur = this.currentTrack const currentTrack = this.currentTrack
if (cur && cur.type === 'compilation') { if (currentTrack && currentTrack.type === 'compilation') {
const dataStore = useDataStore() const dataStore = useDataStore()
const tracks = dataStore const tracks = dataStore
.getTracksByboxId(cur.boxId) .getTracksByboxId(currentTrack.boxId, currentTrack.side)
.slice() .slice()
.filter((t) => t.type === 'compilation') .filter((t) => t.type === 'compilation')
.sort((a, b) => (a.start ?? 0) - (b.start ?? 0)) .sort((a, b) => (a.start ?? 0) - (b.start ?? 0))
@@ -261,7 +243,7 @@ export const usePlayerStore = defineStore('player', {
break break
} }
} }
if (nextTrack && nextTrack.id !== cur.id) { if (nextTrack && nextTrack.id !== currentTrack.id) {
// only update metadata reference; do not reload audio // only update metadata reference; do not reload audio
this.currentTrack = nextTrack this.currentTrack = nextTrack

View File

@@ -35,6 +35,7 @@ export const useUiStore = defineStore('ui', {
selectBox(id: string) { selectBox(id: string) {
const dataStore = useDataStore() const dataStore = useDataStore()
dataStore.boxes.forEach((box) => { dataStore.boxes.forEach((box) => {
id = id.replace(/[AB]$/, '')
box.state = box.id === id ? 'box-selected' : 'box-hidden' box.state = box.id === id ? 'box-selected' : 'box-hidden'
}) })
}, },
@@ -57,7 +58,7 @@ export const useUiStore = defineStore('ui', {
// Récupérer la position de l'élément // Récupérer la position de l'élément
const elementRect = boxElement.getBoundingClientRect() const elementRect = boxElement.getBoundingClientRect()
// Calculer la position de défilement (une boîte plus haut) // Calculer la position de défilement (une boîte plus haut)
const offsetPosition = elementRect.top + window.pageYOffset - (elementRect.height * 1.5) const offsetPosition = elementRect.top + window.pageYOffset - elementRect.height * 1.5
// Faire défiler à la nouvelle position // Faire défiler à la nouvelle position
window.scrollTo({ window.scrollTo({
top: offsetPosition, top: offsetPosition,

View File

@@ -1,9 +1,20 @@
import withNuxt from './.nuxt/eslint.config.mjs' import withNuxt from './.nuxt/eslint.config.mjs'
export default withNuxt() export default withNuxt({
.prepend() extends: [
.append({ 'eslint:recommended',
rules: { 'plugin:@typescript-eslint/recommended',
'@typescript-eslint/ban-types': 'off' 'plugin:vue/vue3-recommended'
} ],
}) parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 'latest',
sourceType: 'module'
},
rules: {
'@typescript-eslint/ban-types': 'off',
'vue/multi-word-component-names': 'off',
'vue/script-setup-uses-vars': 'error'
}
})

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

48
public/ES00/A/title.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 177 KiB

View File

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

48
public/ES00/B/title.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.8 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 20 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 149 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 MiB

After

Width:  |  Height:  |  Size: 4.4 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 MiB

After

Width:  |  Height:  |  Size: 2.8 MiB

View File

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 149 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 MiB

After

Width:  |  Height:  |  Size: 4.5 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -14,7 +14,7 @@
<defs <defs
id="defs1"> id="defs1">
<filter id="blur" x="-20%" y="-20%" width="140%" height="140%"> <filter id="blur" x="-20%" y="-20%" width="140%" height="140%">
<feGaussianBlur stdDeviation="1 5" /> <feGaussianBlur stdDeviation="1 3" />
</filter> </filter>
</defs> </defs>
<sodipodi:namedview <sodipodi:namedview

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -1,178 +1,71 @@
import { eventHandler } from 'h3' import { eventHandler } from 'h3'
import type { Box } from '~~/types/types'
const boxes: Box[] = [
{
id: 'ES01',
type: 'compilation',
name: '...',
description: '...',
state: 'box-hidden',
duration: 3487 + 3773, // Somme des durées A et B
sides: {
A: {
name: '...',
description: '...',
duration: 3487,
color1: '#c7b3aa',
color2: '#000100'
},
B: {
name: '... B',
description: '...',
duration: 3773,
color1: '#f7dd01',
color2: '#010103'
}
},
activeSide: 'A'
},
{
id: 'ES00',
type: 'compilation',
name: 'manifeste',
description: 'Zero is for manifesto',
state: 'box-hidden',
duration: 2794 + 2470, // Somme des durées A et B
sides: {
A: {
name: 'manifeste',
description: 'Zero is for manifesto',
duration: 2794,
color1: '#ffffff',
color2: '#48959d'
},
B: {
name: 'manifeste B',
description: 'Even Zero has a b-side',
duration: 2470,
color1: '#0d01b9',
color2: '#3b7589'
}
},
activeSide: 'A'
},
{
id: 'ESPLAYLIST',
type: 'playlist',
name: 'playlists',
duration: 0,
description: '♠♦♣♥',
state: 'box-hidden',
activeSide: 'A'
}
]
export default eventHandler(() => { export default eventHandler(() => {
const boxes = [ return boxes.map((box) => ({
{ ...box,
id: 'ES01B', state: 'box-hidden' as const
type: 'compilation', }))
name: '... B',
duration: 3773,
description: '...',
color1: '#f7dd01',
color2: '#010103',
color3: '#00ff00'
},
{
id: 'ES01A',
type: 'compilation',
name: '...',
duration: 3487,
description: '...',
color1: '#c7b3aa',
color2: '#000100',
color3: '#00ff00'
},
{
id: 'ES00B',
type: 'compilation',
name: 'manifeste B',
duration: 2470,
description: 'Even Zero has a b-side',
color1: '#0d01b9',
color2: '#3b7589',
color3: '#00ff00'
},
{
id: 'ES00A',
type: 'compilation',
name: 'manifeste',
duration: 2794,
description: 'Zero is for manifesto',
color1: '#ffffff',
color2: '#48959d',
color3: '#00ff00'
},
{
id: 'ES2025',
type: 'playlist',
name: '2025',
duration: 0,
description: '🐍<i class="indice">🌳</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2024',
type: 'playlist',
name: '2024',
duration: 0,
description: '🐉<i class="indice">🌳</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2023',
type: 'playlist',
name: '2023',
duration: 0,
description: '🐇<i class="indice">💧</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2022',
type: 'playlist',
name: '2022',
duration: 0,
description: '🐅<i class="indice">💧</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2021',
type: 'playlist',
name: '2021',
duration: 0,
description: '🐃<i class="indice">🪙</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2020',
type: 'playlist',
name: '2020',
duration: 0,
description: '🐀<i class="indice">🪙</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2019',
type: 'playlist',
name: '2019',
duration: 0,
description: '🐖<i class="indice">🌱</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2018',
type: 'playlist',
name: '2018',
duration: 0,
description: '🐕<i class="indice">🌱</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2017',
type: 'playlist',
name: '2017',
duration: 0,
description: '🐓<i class="indice">🔥</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2016',
type: 'playlist',
name: '2016',
duration: 0,
description: '🐒<i class="indice">🔥</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2015',
type: 'playlist',
name: '2015',
duration: 0,
description: '🐐<i class="indice">🌳</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2013',
type: 'playlist',
name: '2013',
duration: 0,
description: '🐍<i class="indice">💧</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
},
{
id: 'ES2012',
type: 'playlist',
name: '2012',
duration: 0,
description: '🐉<i class="indice">💧</i>',
color1: '#ffffff',
color2: '#32021F',
color3: '#00ff00'
}
]
return boxes.map((b) => ({ ...b, state: 'box-hidden' })) // boxes are first hidden to allow the animation to work (hidden -> list -> selected)
}) })

View File

@@ -4,7 +4,8 @@ export default eventHandler(() => {
const tracks = [ const tracks = [
{ {
order: 1, order: 1,
boxId: 'ES00A', boxId: 'ES00',
side: 'A',
title: 'The grinding wheel', title: 'The grinding wheel',
artist: 0, artist: 0,
start: 0, start: 0,
@@ -13,7 +14,8 @@ export default eventHandler(() => {
}, },
{ {
order: 2, order: 2,
boxId: 'ES00A', boxId: 'ES00',
side: 'A',
title: 'Bleach', title: 'Bleach',
artist: 1, artist: 1,
start: 392, start: 392,
@@ -22,7 +24,8 @@ export default eventHandler(() => {
}, },
{ {
order: 3, order: 3,
boxId: 'ES00A', boxId: 'ES00',
side: 'A',
title: 'Televised mind', title: 'Televised mind',
artist: 2, artist: 2,
start: 896, start: 896,
@@ -31,7 +34,8 @@ export default eventHandler(() => {
}, },
{ {
order: 4, order: 4,
boxId: 'ES00A', boxId: 'ES00',
side: 'A',
title: 'In it', title: 'In it',
artist: 3, artist: 3,
start: 1139, start: 1139,
@@ -40,7 +44,8 @@ export default eventHandler(() => {
}, },
{ {
order: 5, order: 5,
boxId: 'ES00A', boxId: 'ES00',
side: 'A',
title: 'Bad michel', title: 'Bad michel',
artist: 4, artist: 4,
start: 1245, start: 1245,
@@ -49,7 +54,8 @@ export default eventHandler(() => {
}, },
{ {
order: 6, order: 6,
boxId: 'ES00A', boxId: 'ES00',
side: 'A',
title: 'Overall', title: 'Overall',
artist: 5, artist: 5,
start: 1394, start: 1394,
@@ -58,7 +64,8 @@ export default eventHandler(() => {
}, },
{ {
order: 7, order: 7,
boxId: 'ES00A', boxId: 'ES00',
side: 'A',
title: 'Blowup', title: 'Blowup',
artist: 6, artist: 6,
start: 1674, start: 1674,
@@ -67,7 +74,8 @@ export default eventHandler(() => {
}, },
{ {
order: 8, order: 8,
boxId: 'ES00A', boxId: 'ES00',
side: 'A',
title: 'Guitar jet', title: 'Guitar jet',
artist: 7, artist: 7,
start: 1880, start: 1880,
@@ -76,7 +84,8 @@ export default eventHandler(() => {
}, },
{ {
order: 9, order: 9,
boxId: 'ES00A', boxId: 'ES00',
side: 'A',
title: 'Intercontinental radio waves', title: 'Intercontinental radio waves',
artist: 8, artist: 8,
start: 2024, start: 2024,
@@ -85,7 +94,8 @@ export default eventHandler(() => {
}, },
{ {
order: 10, order: 10,
boxId: 'ES00A', boxId: 'ES00',
side: 'A',
title: 'Here comes the sun', title: 'Here comes the sun',
artist: 9, artist: 9,
start: 2211, start: 2211,
@@ -94,7 +104,8 @@ export default eventHandler(() => {
}, },
{ {
order: 11, order: 11,
boxId: 'ES00A', boxId: 'ES00',
side: 'A',
title: 'Like in the movies', title: 'Like in the movies',
artist: 10, artist: 10,
start: 2560, start: 2560,
@@ -103,7 +114,8 @@ export default eventHandler(() => {
}, },
{ {
order: 1, order: 1,
boxId: 'ES00B', boxId: 'ES00',
side: 'B',
title: "Ce que révèle l'éclipse", title: "Ce que révèle l'éclipse",
artist: 0, artist: 0,
start: 0, start: 0,
@@ -112,7 +124,8 @@ export default eventHandler(() => {
}, },
{ {
order: 2, order: 2,
boxId: 'ES00B', boxId: 'ES00',
side: 'B',
title: "Bleedin' Gums Mushrool", title: "Bleedin' Gums Mushrool",
artist: 1, artist: 1,
start: 263, start: 263,
@@ -121,7 +134,8 @@ export default eventHandler(() => {
}, },
{ {
order: 3, order: 3,
boxId: 'ES00B', boxId: 'ES00',
side: 'B',
title: 'A lucid dream', title: 'A lucid dream',
artist: 2, artist: 2,
start: 554, start: 554,
@@ -130,7 +144,8 @@ export default eventHandler(() => {
}, },
{ {
order: 4, order: 4,
boxId: 'ES00B', boxId: 'ES00',
side: 'B',
title: 'Lights off', title: 'Lights off',
artist: 3, artist: 3,
start: 781, start: 781,
@@ -139,7 +154,8 @@ export default eventHandler(() => {
}, },
{ {
order: 5, order: 5,
boxId: 'ES00B', boxId: 'ES00',
side: 'B',
title: "I'm sentimental", title: "I'm sentimental",
artist: 4, artist: 4,
start: 969, start: 969,
@@ -148,7 +164,8 @@ export default eventHandler(() => {
}, },
{ {
order: 6, order: 6,
boxId: 'ES00B', boxId: 'ES00',
side: 'B',
title: 'Thrill or trip', title: 'Thrill or trip',
artist: 5, artist: 5,
start: 1128, start: 1128,
@@ -157,7 +174,8 @@ export default eventHandler(() => {
}, },
{ {
order: 7, order: 7,
boxId: 'ES00B', boxId: 'ES00',
side: 'B',
title: 'Redhead', title: 'Redhead',
artist: 6, artist: 6,
start: 1303, start: 1303,
@@ -166,7 +184,8 @@ export default eventHandler(() => {
}, },
{ {
order: 8, order: 8,
boxId: 'ES00B', boxId: 'ES00',
side: 'B',
title: 'Supersonic twist', title: 'Supersonic twist',
artist: 7, artist: 7,
start: 1584, start: 1584,
@@ -175,7 +194,8 @@ export default eventHandler(() => {
}, },
{ {
order: 9, order: 9,
boxId: 'ES00B', boxId: 'ES00',
side: 'B',
title: 'Flowers', title: 'Flowers',
artist: 8, artist: 8,
start: 1749, start: 1749,
@@ -184,7 +204,8 @@ export default eventHandler(() => {
}, },
{ {
order: 10, order: 10,
boxId: 'ES00B', boxId: 'ES00',
side: 'B',
title: 'The shade', title: 'The shade',
artist: 9, artist: 9,
start: 1924, start: 1924,
@@ -193,7 +214,8 @@ export default eventHandler(() => {
}, },
{ {
order: 11, order: 11,
boxId: 'ES00B', boxId: 'ES00',
side: 'B',
title: 'Like in the movies', title: 'Like in the movies',
artist: 10, artist: 10,
start: 2186, start: 2186,
@@ -202,7 +224,8 @@ export default eventHandler(() => {
}, },
{ {
order: 1, order: 1,
boxId: 'ES01A', boxId: 'ES01',
side: 'A',
title: 'He Walked In', title: 'He Walked In',
artist: 11, artist: 11,
start: 0, start: 0,
@@ -211,7 +234,8 @@ export default eventHandler(() => {
}, },
{ {
order: 2, order: 2,
boxId: 'ES01A', boxId: 'ES01',
side: 'A',
title: 'The Third Wave', title: 'The Third Wave',
artist: 12, artist: 12,
start: 841, start: 841,
@@ -220,7 +244,8 @@ export default eventHandler(() => {
}, },
{ {
order: 3, order: 3,
boxId: 'ES01A', boxId: 'ES01',
side: 'A',
title: 'Broadcaster', title: 'Broadcaster',
artist: 13, artist: 13,
start: 1104.5, start: 1104.5,
@@ -229,7 +254,8 @@ export default eventHandler(() => {
}, },
{ {
order: 4, order: 4,
boxId: 'ES01A', boxId: 'ES01',
side: 'A',
title: 'Mourn', title: 'Mourn',
artist: 14, artist: 14,
start: 1441, start: 1441,
@@ -238,7 +264,8 @@ export default eventHandler(() => {
}, },
{ {
order: 5, order: 5,
boxId: 'ES01A', boxId: 'ES01',
side: 'A',
title: 'Let it Blow', title: 'Let it Blow',
artist: 15, artist: 15,
start: 1844.8, start: 1844.8,
@@ -247,7 +274,8 @@ export default eventHandler(() => {
}, },
{ {
order: 6, order: 6,
boxId: 'ES01A', boxId: 'ES01',
side: 'A',
title: 'Sunday Mourning', title: 'Sunday Mourning',
artist: 16, artist: 16,
start: 2091.7, start: 2091.7,
@@ -256,7 +284,8 @@ export default eventHandler(() => {
}, },
{ {
order: 7, order: 7,
boxId: 'ES01A', boxId: 'ES01',
side: 'A',
title: '3030 Instrumental', title: '3030 Instrumental',
artist: 17, artist: 17,
start: 2339.3, start: 2339.3,
@@ -265,7 +294,8 @@ export default eventHandler(() => {
}, },
{ {
order: 8, order: 8,
boxId: 'ES01A', boxId: 'ES01',
side: 'A',
title: 'Immortality Break', title: 'Immortality Break',
artist: 18, artist: 18,
start: 2530.5, start: 2530.5,
@@ -274,7 +304,8 @@ export default eventHandler(() => {
}, },
{ {
order: 9, order: 9,
boxId: 'ES01A', boxId: 'ES01',
side: 'A',
title: 'Lazy Bones', title: 'Lazy Bones',
artist: 19, artist: 19,
start: 2718, start: 2718,
@@ -283,7 +314,8 @@ export default eventHandler(() => {
}, },
{ {
order: 10, order: 10,
boxId: 'ES01A', boxId: 'ES01',
side: 'A',
title: 'On the Train of Aches', title: 'On the Train of Aches',
artist: 20, artist: 20,
start: 2948, start: 2948,
@@ -292,7 +324,8 @@ export default eventHandler(() => {
}, },
{ {
order: 11, order: 11,
boxId: 'ES01A', boxId: 'ES01',
side: 'A',
title: 'Me', title: 'Me',
artist: 21, artist: 21,
start: 3265, start: 3265,
@@ -301,7 +334,8 @@ export default eventHandler(() => {
}, },
{ {
order: 1, order: 1,
boxId: 'ES01B', boxId: 'ES01',
side: 'B',
title: 'Lady Hawke Blues', title: 'Lady Hawke Blues',
artist: 11, artist: 11,
start: 0, start: 0,
@@ -310,7 +344,8 @@ export default eventHandler(() => {
}, },
{ {
order: 2, order: 2,
boxId: 'ES01B', boxId: 'ES01',
side: 'B',
title: 'Dreamscapes', title: 'Dreamscapes',
artist: 12, artist: 12,
start: 235, start: 235,
@@ -319,7 +354,8 @@ export default eventHandler(() => {
}, },
{ {
order: 3, order: 3,
boxId: 'ES01B', boxId: 'ES01',
side: 'B',
title: 'Crispy Skin', title: 'Crispy Skin',
artist: 13, artist: 13,
start: 644.2, start: 644.2,
@@ -328,7 +364,8 @@ export default eventHandler(() => {
}, },
{ {
order: 4, order: 4,
boxId: 'ES01B', boxId: 'ES01',
side: 'B',
title: 'The Boy Who Stood Above The Earth', title: 'The Boy Who Stood Above The Earth',
artist: 14, artist: 14,
start: 1018, start: 1018,
@@ -337,7 +374,8 @@ export default eventHandler(() => {
}, },
{ {
order: 5, order: 5,
boxId: 'ES01B', boxId: 'ES01',
side: 'B',
title: 'Better Off Alone', title: 'Better Off Alone',
artist: 15, artist: 15,
start: 1698, start: 1698,
@@ -346,7 +384,8 @@ export default eventHandler(() => {
}, },
{ {
order: 6, order: 6,
boxId: 'ES01B', boxId: 'ES01',
side: 'B',
title: 'Celebration #1', title: 'Celebration #1',
artist: 16, artist: 16,
start: 2235, start: 2235,
@@ -355,7 +394,8 @@ export default eventHandler(() => {
}, },
{ {
order: 7, order: 7,
boxId: 'ES01B', boxId: 'ES01',
side: 'B',
title: '3030 Instrumental', title: '3030 Instrumental',
artist: 17, artist: 17,
start: 2458.3, start: 2458.3,
@@ -364,7 +404,8 @@ export default eventHandler(() => {
}, },
{ {
order: 8, order: 8,
boxId: 'ES01B', boxId: 'ES01',
side: 'B',
title: 'The Emptiness Of Nothingness', title: 'The Emptiness Of Nothingness',
artist: 18, artist: 18,
start: 2864.5, start: 2864.5,
@@ -373,7 +414,8 @@ export default eventHandler(() => {
}, },
{ {
order: 9, order: 9,
boxId: 'ES01B', boxId: 'ES01',
side: 'B',
title: 'Rising', title: 'Rising',
artist: 19, artist: 19,
start: 3145, start: 3145,
@@ -382,7 +424,8 @@ export default eventHandler(() => {
}, },
{ {
order: 10, order: 10,
boxId: 'ES01B', boxId: 'ES01',
side: 'B',
title: 'The Last Time', title: 'The Last Time',
artist: 22, artist: 22,
start: 3447, start: 3447,
@@ -392,7 +435,8 @@ export default eventHandler(() => {
}, },
{ {
order: 11, order: 11,
boxId: 'ES01B', boxId: 'ES01',
side: 'B',
title: 'Guajira Con Arpa', title: 'Guajira Con Arpa',
artist: 23, artist: 23,
start: 3586, start: 3586,
@@ -404,7 +448,7 @@ export default eventHandler(() => {
return tracks.map((track, index) => ({ return tracks.map((track, index) => ({
id: index + 1, id: index + 1,
...track, ...track,
url: `https://files.erudi.fr/evilspins/${track.boxId}.mp3`, url: `https://files.erudi.fr/evilspins/${track.boxId}${track.side}.mp3`,
coverId: `https://f4.bcbits.com/img/${track.coverId}_4.jpg`, coverId: `https://f4.bcbits.com/img/${track.coverId}_4.jpg`,
type: 'compilation' type: 'compilation'
})) }))

View File

@@ -47,7 +47,8 @@ export default eventHandler(async (event) => {
return { return {
id: Number(`${year}${index + 1}`), id: Number(`${year}${index + 1}`),
boxId: `ES${year}`, boxId: `ESPLAYLIST`,
year,
date, date,
title: title.trim(), title: title.trim(),
artist: artist.trim(), artist: artist.trim(),

View File

@@ -1,20 +1,27 @@
// types.ts // types.ts
export type BoxType = 'playlist' | 'compilation' | 'userPlaylist' export type BoxType = 'playlist' | 'compilation' | 'userPlaylist'
export interface BoxSide {
duration: number
color1: string
color2: string
name?: string
description?: string
}
export interface Box { export interface Box {
id: string id: string
type: BoxType type: BoxType
name: string name: string
description: string
state: BoxState
duration: number duration: number
tracks?: Track[] tracks?: Track[]
description: string sides?: {
color2: string A: BoxSide
color1: string B: BoxSide
color3: string }
state: BoxState activeSide: 'A' | 'B'
// Pour les userPlaylist, on peut ajouter des métadonnées spécifiques
ownerId?: string
isPublic?: boolean
} }
export interface Artist { export interface Artist {
@@ -25,6 +32,7 @@ export interface Artist {
} }
export interface Track { export interface Track {
id: number id: number
side?: 'A' | 'B'
order?: number order?: number
boxId: string boxId: string
title: string title: string
@@ -37,6 +45,7 @@ export interface Track {
card?: { suit: CardSuit; rank: CardRank } card?: { suit: CardSuit; rank: CardRank }
link?: string link?: string
type: BoxType type: BoxType
year?: number
} }
export interface Playlist { export interface Playlist {