cleanup
This commit is contained in:
@@ -91,14 +91,13 @@
|
||||
}
|
||||
el.innerHTML = _slots.map((s, i) => `
|
||||
<div class="slot-row" data-idx="${i}">
|
||||
<span class="slot-num">${i + 1}</span>
|
||||
<div class="slot-pick" style="flex:1;">
|
||||
${s.video
|
||||
? `<span class="slot-video-name">${s.video.description}</span>
|
||||
<button class="btn btn-ghost btn-sm" type="button" data-action="pick" data-idx="${i}" style="margin-left:var(--space-2);">Change</button>`
|
||||
: `<button class="btn btn-ghost btn-sm" type="button" data-action="pick" data-idx="${i}">Pick Video</button>`}
|
||||
</div>
|
||||
<input class="form-input slot-reps" type="number" placeholder="Reps" min="1" value="${s.reps || ''}" data-action="reps" data-idx="${i}" style="width:80px;">
|
||||
<input class="form-input slot-reps" type="number" placeholder="#" min="1" value="${s.reps ?? i + 1}" data-action="reps" data-idx="${i}" style="width:64px;">
|
||||
<button class="btn btn-danger btn-sm" type="button" data-action="remove" data-idx="${i}">✕</button>
|
||||
</div>`).join('');
|
||||
}
|
||||
@@ -172,7 +171,7 @@
|
||||
|
||||
document.getElementById('add-slot-btn').addEventListener('click', () => {
|
||||
if (_slots.length >= MAX_SLOTS) return;
|
||||
_slots.push({ video: null, reps: null });
|
||||
_slots.push({ video: null, reps: _slots.length + 1 });
|
||||
renderSlots();
|
||||
});
|
||||
|
||||
|
||||
@@ -5,15 +5,7 @@ const Display = (() => {
|
||||
let _keepAliveEl = null;
|
||||
|
||||
function renderWorkout(workout) {
|
||||
const nameEl = document.getElementById('display-workout-name');
|
||||
const dateEl = document.getElementById('display-workout-date');
|
||||
const gridEl = document.getElementById('display-video-grid');
|
||||
|
||||
if (nameEl) nameEl.textContent = workout.name || '';
|
||||
if (dateEl && workout.workoutDate) {
|
||||
dateEl.textContent = new Date(workout.workoutDate).toLocaleDateString('en-US', { month: 'long', day: 'numeric' });
|
||||
}
|
||||
|
||||
if (!gridEl) return;
|
||||
|
||||
const slots = (workout.videos || []).filter(s => s.video);
|
||||
@@ -39,9 +31,6 @@ const Display = (() => {
|
||||
? `<video class="display-pane-video" src="${streamSrc}" autoplay loop muted playsinline></video>`
|
||||
: `<div class="display-pane-missing">Missing Video</div>`}
|
||||
${slot.reps ? `<div class="display-pane-corner">${slot.reps}</div>` : ''}
|
||||
<div class="display-pane-overlay">
|
||||
<span class="display-pane-name">${slot.video.description || 'Exercise'}</span>
|
||||
</div>
|
||||
</div>`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
@@ -147,8 +147,8 @@ html, body {
|
||||
}
|
||||
.display-pane-corner {
|
||||
position: absolute;
|
||||
top: var(--space-4);
|
||||
left: var(--space-5);
|
||||
bottom: var(--space-4);
|
||||
right: var(--space-5);
|
||||
font-size: var(--display-font-primary);
|
||||
font-weight: var(--weight-black);
|
||||
color: #fff;
|
||||
@@ -156,23 +156,6 @@ html, body {
|
||||
line-height: 1;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.display-pane-overlay {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: var(--space-4) var(--space-6);
|
||||
background: linear-gradient(transparent, rgba(0,0,0,0.72));
|
||||
}
|
||||
.display-pane-name {
|
||||
font-size: var(--display-font-label);
|
||||
font-weight: var(--weight-bold);
|
||||
color: #fff;
|
||||
text-shadow: 0 1px 4px rgba(0,0,0,0.8);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
line-height: 1.1;
|
||||
}
|
||||
.display-no-videos {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="display-container" id="display-container">
|
||||
<div class="display-status-bar">
|
||||
<span class="display-status-label" id="display-workout-name">Loading…</span>
|
||||
<span class="display-status-right" id="display-workout-date"></span>
|
||||
</div>
|
||||
<div class="display-video-grid" id="display-video-grid"></div>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +20,7 @@
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const id = params.get('id');
|
||||
if (!id) { document.getElementById('display-workout-name').textContent = 'No workout selected.'; return; }
|
||||
if (!id) { document.getElementById('display-video-grid').innerHTML = '<div class="display-no-videos">No workout selected.</div>'; return; }
|
||||
|
||||
Display.startKeepAlive();
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user