fix(feedback): ring directly on photo img

This commit is contained in:
dev
2026-11-01 22:28:58 +03:00
parent 7185da3c23
commit 63e96bc7b6
2 changed files with 8 additions and 7 deletions
+7 -6
View File
@@ -713,20 +713,21 @@
function applyMarkStripe() {
const el = document.getElementById('fbMarkStripe');
if (!el) return;
const photo = document.getElementById('fbResidentPhoto');
const img = photo ? photo.querySelector('img') : null;
if (!el || !img) return;
const k = normName(document.getElementById('fbResident').value);
const m = k ? workMarks.get(k) : null;
const photo = document.getElementById('fbResidentPhoto');
if (!m) {
el.style.border = '3px solid transparent';
el.style.boxShadow = 'none';
img.style.border = '3px solid transparent';
img.style.boxShadow = 'none';
if (photo) photo.title = 'Увеличить фото';
return;
}
const t = Math.max(-4, Math.min(4, m.total));
const hue = Math.round(120 * (t + 4) / 8);
el.style.border = `3px solid hsl(${hue}, 72%, 45%)`;
el.style.boxShadow = `inset 0 0 10px hsla(${hue}, 72%, 45%, .4)`;
img.style.border = `3px solid hsl(${hue}, 72%, 45%)`;
img.style.boxShadow = `inset 0 0 10px hsla(${hue}, 72%, 45%, .4)`;
if (photo) photo.title = `Отметки работы: ${m.total > 0 ? '+' : ''}${m.total} (отметок: ${m.marks})`;
}