Idle animations. Closes #14
This commit is contained in:
@@ -4,6 +4,7 @@ import IK from '../kinematics.js';
|
||||
import Settings from '../settings.js';
|
||||
import Motion from '../motion.js';
|
||||
import { buildQuickSequencesHTML, initQuickSequences } from '../quick-sequences.js';
|
||||
import { IdleEffects } from '../idle-effects.js';
|
||||
|
||||
let eventCleanup = [];
|
||||
let isHomed = false;
|
||||
@@ -149,6 +150,16 @@ function buildHTML() {
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-bottom: 12px;">
|
||||
<label class="form-label">Idle Animation</label>
|
||||
<select id="it-idle-mode-select" class="form-input idle-mode-select" style="width:100%;">
|
||||
<option value="none">None</option>
|
||||
<option value="circles">Circles</option>
|
||||
<option value="erratic">Erratic</option>
|
||||
<option value="park-bounce">Park Bounce</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Settings -->
|
||||
<div style="background: var(--surface-2); padding: 10px; border-radius: var(--radius-sm); margin-bottom: 12px;">
|
||||
<div class="setting-row">
|
||||
@@ -266,6 +277,7 @@ async function loadSpots() {
|
||||
if (!parsedSpots.find(s => s.id === 'PARK')) {
|
||||
parsedSpots.push({ id: 'PARK', label: 'Park Position', x: parkPosition.x, y: parkPosition.y });
|
||||
}
|
||||
IdleEffects.setParkPosition(parkPosition.x, parkPosition.y);
|
||||
spots = parsedSpots;
|
||||
|
||||
document.getElementById('bg-image').src = `web/assets/backgrounds/${currentBg}/bg.svg?v=${Date.now()}`;
|
||||
@@ -355,6 +367,15 @@ export default {
|
||||
updateHomingUI();
|
||||
loadSpots();
|
||||
|
||||
// ── Idle Effects Selection ──────────────────────────────────
|
||||
const idleSelect = document.getElementById('it-idle-mode-select');
|
||||
if (idleSelect) {
|
||||
idleSelect.value = IdleEffects.getMode();
|
||||
idleSelect.addEventListener('change', () => {
|
||||
IdleEffects.setMode(idleSelect.value);
|
||||
});
|
||||
}
|
||||
|
||||
// ── Background Selection ──────────────────────────────────
|
||||
const bgSelect = document.getElementById('bg-select');
|
||||
if (bgSelect) {
|
||||
|
||||
Reference in New Issue
Block a user