+
@@ -42,6 +43,8 @@ const autoplay = props.autoplay ?? false
// State
const isLoadingTrack = ref(false)
const isFirstPlay = ref(true)
+const isEndOfTrack = ref(false)
+
const progressPercentage = ref(0)
const currentTurns = ref(0)
const totalTurns = ref(0)// Refs pour les instances
@@ -111,6 +114,7 @@ const updateTurns = () => {
currentTurns.value = newTurns
totalTurns.value = newTotalTurns
progressPercentage.value = newProgressPercentage
+ isEndOfTrack.value = disc.value.secondsPlayed + 0.1 >= (disc.value as any)._duration
}
}
@@ -171,6 +175,9 @@ const cleanup = () => {
}
const Power = (e: MouseEvent) => {
+ if (isEndOfTrack.value) {
+ Rewind()
+ }
togglePlay()
}
@@ -221,6 +228,7 @@ const Rewind = async () => {
}
requestAnimationFrame(slowDown)
+ play()
}
const performRewind = () => {
@@ -324,6 +332,7 @@ watch(() => props.card, (newCard) => {
.platine {
overflow: hidden;
position: relative;
+ display: flex;
width: 100%;
height: 100%;
@@ -365,12 +374,12 @@ watch(() => props.card, (newCard) => {
transform-origin: center;
width: 33%;
height: 33%;
- border-radius: 999px;
+ border-radius: 100%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
- .macaron {
+ .Macaron {
position: absolute;
filter: grayscale(1);
transition: transform 0.1s, filter 0.8s;
@@ -382,13 +391,13 @@ watch(() => props.card, (newCard) => {
}
&:active {
- .macaron {
+ .Macaron {
transform: scale(0.8);
}
}
}
- &.playing .power-button .macaron {
+ &.playing .power-button .Macaron {
filter: grayscale(0);
}
@@ -426,7 +435,7 @@ watch(() => props.card, (newCard) => {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
- @apply relative bg-black bg-opacity-30 backdrop-blur-sm rounded-full;
+ @apply relative bg-black bg-opacity-60 backdrop-blur-sm rounded-full;
}
}
diff --git a/app/components/PlayingCard.vue b/app/components/PlayingCard.vue
index a8edc21..dfc20f5 100644
--- a/app/components/PlayingCard.vue
+++ b/app/components/PlayingCard.vue
@@ -1,5 +1,5 @@
-
+
@@ -15,7 +15,9 @@ const props = defineProps<{ card: Card, isFaceUp: boolean }>()
const platineOpen = ref(false)
const clickOnCard = () => {
- platineOpen.value = !platineOpen.value
+ setTimeout(() => {
+ platineOpen.value = !platineOpen.value
+ }, 600);
}
@@ -23,16 +25,23 @@ const clickOnCard = () => {
$open-speed: 0.4s;
.playing-card {
- display: flex;
- justify-content: center;
- align-items: center;
+ @apply size-card;
+ position: relative;
+
+ .card,
+ .platine {
+ height: 100%;
+ width: 100%;
+ transition: width $open-speed, height $open-speed, min-width $open-speed,
+ min-height $open-speed, transform 0.1s;
+ }
:deep(.card) {
- transition: width $open-speed, height $open-speed, transform 0.1s;
+ // transition: width $open-speed, height $open-speed, transform 0.1s;
position: absolute;
.face-up,
- .pochette {
+ .cover {
transition: border-radius $open-speed, box-shadow $open-speed;
&:active {
@@ -43,7 +52,13 @@ $open-speed: 0.4s;
}
}
- &--platine-open {
+ &.platine-open {
+ $open-size: 20rem;
+ width: $open-size;
+ height: $open-size;
+ min-height: $open-size;
+ min-width: $open-size;
+
.card {
pointer-events: none;
@@ -52,19 +67,13 @@ $open-speed: 0.4s;
}
}
- .card,
- .platine {
- width: 100vmin;
- height: 100vmin;
- }
-
&:deep(.card) {
.face-up {
- border-radius: 999px;
+ border-radius: 100%;
@apply shadow-xl;
- .pochette {
- border-radius: 999px;
+ .cover {
+ border-radius: 100%;
}
.rank,
diff --git a/app/components/UI/CloseButton.vue b/app/components/UI/CloseButton.vue
index 428bd00..620e53a 100644
--- a/app/components/UI/CloseButton.vue
+++ b/app/components/UI/CloseButton.vue
@@ -1,6 +1,6 @@