Skip to content

Commit ecbbca8

Browse files
committed
fix: replace transition: all with specific properties for GPU compositing
Fixes rendering glitches on Intel Macs where the UI fragments during card animations due to GPU compositor overload. - Replace transition: all with specific animated properties - Add CSS custom properties for transition durations - Add prefers-reduced-motion support - Fix malformed CSS (missing 's' unit in two transitions) - Remove unused .gameCard class Resolves #1328
1 parent ab164d5 commit ecbbca8

6 files changed

Lines changed: 29 additions & 19 deletions

File tree

src/App.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ export default {
6262
<style lang="scss">
6363
@use '@/sass/typography';
6464
65+
:root {
66+
--transition-duration: 1s;
67+
--transition-duration-fast: 0.3s;
68+
}
69+
70+
@media (prefers-reduced-motion: reduce) {
71+
:root {
72+
--transition-duration: 0s;
73+
--transition-duration-fast: 0s;
74+
}
75+
}
76+
6577
.gradient-text {
6678
background: linear-gradient(268.89deg, rgba(98, 2, 238, 0.87) 73.76%, rgba(253, 98, 34, 0.87) 99.59%);
6779
background-clip: text;

src/components/PlayerReadyIndicator.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default {
116116
position: absolute;
117117
top: 0;
118118
left: 0;
119-
transition: all 0.4s ease-in-out;
119+
transition: rotate 0.4s ease-in-out;
120120
backface-visibility: hidden;
121121
}
122122
.card-back {

src/routes/game/GameView.vue

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ export default {
10601060
// Transitions //
10611061
/////////////////
10621062
.transition-all {
1063-
transition: all 1s;
1063+
transition: opacity var(--transition-duration), transform var(--transition-duration);
10641064
}
10651065
// All list transitions leave with position absolute
10661066
.slide-below-leave-active,
@@ -1107,11 +1107,6 @@ export default {
11071107
opacity: 0;
11081108
transform: translateY(-32px);
11091109
}
1110-
.gameCard {
1111-
position: absolute;
1112-
transition: all 1s ease-out;
1113-
}
1114-
11151110
////////////
11161111
// Styles //
11171112
////////////
@@ -1242,7 +1237,7 @@ export default {
12421237
flex-direction: column;
12431238
justify-content: center;
12441239
align-items: center;
1245-
transition: all 0.3 ease-in-out;
1240+
transition: width var(--transition-duration-fast) ease-in-out;
12461241
background-image: url('/img/game/bg-deck.png');
12471242
12481243
&.reveal-top-two {
@@ -1406,7 +1401,10 @@ export default {
14061401
background: rgba(0, 0, 0, 0.46);
14071402
overflow-y: hidden;
14081403
border-radius: 4px;
1409-
transition: all 1s;
1404+
transition:
1405+
border-color var(--transition-duration),
1406+
box-shadow var(--transition-duration),
1407+
background var(--transition-duration);
14101408
&.my-turn {
14111409
border: 4px solid rgba(var(--v-theme-accent));
14121410
box-shadow:

src/routes/game/components/GameCard.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export default {
221221
& .scuttled-by-card {
222222
height: 95%;
223223
left: 16px;
224-
transition: all 1s ease;
224+
transition: opacity var(--transition-duration) ease, transform var(--transition-duration) ease;
225225
position: absolute;
226226
z-index: 1;
227227
&.scuttled-by-opponent {
@@ -281,7 +281,7 @@ export default {
281281
right: 0;
282282
background: rgba(#00a5ff, 0.25);
283283
opacity: 1;
284-
transition: all 0.3s linear;
284+
transition: opacity var(--transition-duration-fast) linear;
285285
}
286286
287287
&:hover:after {
@@ -307,8 +307,8 @@ export default {
307307
transform: translateY(-32px);
308308
}
309309
310-
.card-flip-enter-active{
311-
transition: all 1s;
310+
.card-flip-enter-active {
311+
transition: transform var(--transition-duration);
312312
}
313313
.card-flip-enter-from{
314314
transform: rotateY(-90deg);

src/routes/game/components/MoveChoiceCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export default {
9494
background-color: rgba(var(--v-theme-surface-1));
9595
color: rgba(var(--v-theme-surface-2)) !important;
9696
border: 2px solid rgba(var(--v-theme-surface-2));;
97-
transition: all 0.5s ease;
97+
transition: background-color .5s ease, color .5s ease;
9898
opacity: .95;
9999
}
100100
.move-choice-card:hover {

src/routes/game/components/ScrapPile.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function openDialog(e) {
186186
flex-direction: column;
187187
justify-content: center;
188188
align-items: center;
189-
transition: all 0.3 ease-in-out; // for tidying/messing up pile
189+
transition: transform var(--transition-duration-fast) ease-in-out;
190190
cursor: pointer;
191191
user-select: none;
192192
@@ -234,7 +234,7 @@ function openDialog(e) {
234234
// Entering Scrap Transition //
235235
///////////////////////////////
236236
#scrap .scrap-card.scrap-enter-active {
237-
transition: all .8s ease-out;
237+
transition: opacity .8s ease-out, transform .8s ease-out;
238238
}
239239
240240
#scrap .scrap-card.scrap-enter-from {
@@ -247,7 +247,7 @@ function openDialog(e) {
247247
//////////////////////
248248
#scrap .threes-player-enter-active,
249249
#scrap .threes-opponent-enter-active {
250-
transition: all .5s ease-in;
250+
transition: opacity .5s ease-in, transform .5s ease-in, rotate .5s ease-in;
251251
}
252252
253253
#scrap .threes-player-enter-from,
@@ -259,7 +259,7 @@ function openDialog(e) {
259259
260260
#scrap .threes-player-leave-active,
261261
#scrap .threes-opponent-leave-active {
262-
transition: all 1.2s ease-out;
262+
transition: opacity 1.2s ease-out, transform 1.2s ease-out;
263263
}
264264
265265
// Leaving towards player hand
@@ -278,7 +278,7 @@ function openDialog(e) {
278278
////////////////////////////////////////
279279
#scrap .scrap-empty-enter-active,
280280
#scrap .scrap-empty-leave-active {
281-
transition: all .5s ease-in;
281+
transition: opacity .5s ease-in, rotate .5s ease-in;
282282
}
283283
284284
#scrap .scrap-empty-leave-to {

0 commit comments

Comments
 (0)