fix(feedback): ring directly on photo img
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
.fb-top-row .fb-mark-wrap { width:100%; }
|
||||
#fbResidentPhoto[hidden] { display:none; }
|
||||
.fb-resident-photo { width:34px; height:34px; flex:none; border-radius:50%; overflow:hidden; border:1px solid var(--border); background:var(--bg); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; position:relative; }
|
||||
.fb-resident-photo img { width:100%; height:100%; object-fit:cover; display:block; }
|
||||
.fb-resident-photo img { width:100%; height:100%; object-fit:cover; display:block; border-radius:50%; box-sizing:border-box; }
|
||||
#fbResidentPhoto .fb-mark-stripe img { width:100%; height:100%; object-fit:cover; display:block; border-radius:50%; }
|
||||
#fbPromptModal { overflow:auto; align-items:flex-start; padding:4vh 16px; }
|
||||
#fbPromptModal > .edit-modal { margin:auto; }
|
||||
|
||||
@@ -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})`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user