Skip to content

Commit 344d79f

Browse files
Fix pixelated badge image and smoother achievement animation
Badge celebration now prefers image_url (full-res) over thumbnail_url. Reduced particles from 40→20 and orbital dots from 8→5. Added will-change and translateZ(0) GPU compositing hints to overlay, card, rings, and badge image for smoother animation playback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5c1131d commit 344d79f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/components/AchievementToast.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ watch(() => backend.notifications.length, (newLen) => {
258258
type: 'badge',
259259
title: '✨ New Achievement!',
260260
subtitle: notif.body || 'You earned a special award!',
261-
icon: notif.thumbnail_url || notif.image_url || '🏆',
262-
isImage: !!(notif.thumbnail_url || notif.image_url),
261+
icon: notif.image_url || notif.thumbnail_url || '🏆',
262+
isImage: !!(notif.image_url || notif.thumbnail_url),
263263
});
264264
fireConfetti('gold', 1.5);
265265
}
@@ -298,7 +298,7 @@ watch(() => backend.pendingBadgeCelebration, (pending) => {
298298
<div class="nge-hero-card">
299299
<!-- Multi-layer particles -->
300300
<div class="nge-hero-particles">
301-
<span v-for="i in 40" :key="i" class="nge-hero-particle" :style="{ '--i': i }"></span>
301+
<span v-for="i in 20" :key="i" class="nge-hero-particle" :style="{ '--i': i }"></span>
302302
</div>
303303

304304
<!-- Rotating holographic rings -->
@@ -310,7 +310,7 @@ watch(() => backend.pendingBadgeCelebration, (pending) => {
310310

311311
<!-- Orbital electron dots -->
312312
<div class="nge-hero-orbits">
313-
<span v-for="i in 8" :key="i" class="nge-hero-orbit-dot" :style="{ '--j': i }"></span>
313+
<span v-for="i in 5" :key="i" class="nge-hero-orbit-dot" :style="{ '--j': i }"></span>
314314
</div>
315315

316316
<!-- Pulsing energy aura -->
@@ -385,6 +385,8 @@ watch(() => backend.pendingBadgeCelebration, (pending) => {
385385
backdrop-filter: blur(8px) saturate(1.5);
386386
cursor: pointer;
387387
overflow: hidden;
388+
will-change: opacity;
389+
transform: translateZ(0);
388390
}
389391
390392
/* ── Hex grid background ── */
@@ -469,6 +471,8 @@ watch(() => backend.pendingBadgeCelebration, (pending) => {
469471
overflow: visible;
470472
z-index: 1;
471473
animation: nge-hero-card-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
474+
will-change: transform, opacity;
475+
transform: translateZ(0);
472476
}
473477
@keyframes nge-hero-card-enter {
474478
0% { transform: scale(0.3) translateY(40px); opacity: 0; filter: brightness(3) blur(10px); }
@@ -510,6 +514,8 @@ watch(() => backend.pendingBadgeCelebration, (pending) => {
510514
inset: 0;
511515
border-radius: 50%;
512516
border: 1px solid transparent;
517+
will-change: transform;
518+
transform: translateZ(0);
513519
}
514520
.nge-hero-ring--1 {
515521
border-color: rgba(0, 200, 255, 0.2);
@@ -624,7 +630,9 @@ watch(() => backend.pendingBadgeCelebration, (pending) => {
624630
width: 360px;
625631
height: 360px;
626632
object-fit: contain;
633+
image-rendering: auto;
627634
animation: nge-hero-badge-materialize 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
635+
will-change: transform, opacity;
628636
}
629637
@keyframes nge-hero-badge-materialize {
630638
0% { transform: scale(0.1) rotate(-20deg); opacity: 0; filter: brightness(4) saturate(0); }

src/components/NotificationFeedPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function openDetail(notif: any) {
7373
backend.pendingBadgeCelebration = {
7474
title: notif.title,
7575
body: notif.body || '',
76-
imageUrl: notif.thumbnail_url || notif.image_url || '',
76+
imageUrl: notif.image_url || notif.thumbnail_url || '',
7777
};
7878
emit('hide');
7979
return;

0 commit comments

Comments
 (0)