diff --git a/frontend/js/pet-sprite.js b/frontend/js/pet-sprite.js index 359d1f7..90ac1f4 100644 --- a/frontend/js/pet-sprite.js +++ b/frontend/js/pet-sprite.js @@ -5,6 +5,10 @@ * dashboard.html используют window.PetSprite.render(...) — без дублей. */ (function () { + // Счётчик для УНИКАЛЬНЫХ id градиентов/клипов спрайта. Иначе два питомца с + // одинаковыми level/mood/colorKey дают совпадающие id, и url(#id) заливки тела + // резолвится в чужой (возможно display:none) градиент → тело без заливки. + let _petUidSeq = 0; const PET_PALETTES = { purple:'#9B5DE5', cyan:'#06D6E0', gold:'#F9C74F', red:'#F94144', green:'#38D95A', blue:'#4A90D9', @@ -24,7 +28,7 @@ const col = PET_PALETTES[colorKey] || '#9B5DE5'; const dark = shadeColor(col, -45); const light = shadeColor(col, 52); - const uid = `pg${level}${mood[0]}${colorKey[0]}`; + const uid = `pg${(++_petUidSeq).toString(36)}`; const bodyPath = 'M55,22 C70,22 86,37 87,56 C89,75 78,94 55,97 C32,94 21,75 23,56 C24,37 40,22 55,22 Z'; const eyeY = 52, eyeX1 = 40, eyeX2 = 70;