feat: Allow millisecond offset for timeturner

Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
Chaos Rogers 2025-07-29 11:39:46 +01:00
parent a12ee88b9b
commit c712014bb9
6 changed files with 25 additions and 8 deletions

View file

@ -50,7 +50,7 @@
<input type="number" id="hw-offset" name="hw-offset">
</div>
<div class="control-group">
<label>Timeturner Offset:, HH:MM:SS:f</label>
<label>Timeturner Offset: HH:MM:SS:f.ms</label>
<input type="number" id="offset-h" placeholder="H">
<label>:</label>
<input type="number" id="offset-m" placeholder="M">
@ -58,6 +58,8 @@
<input type="number" id="offset-s" placeholder="S">
<label>.</label>
<input type="number" id="offset-f" placeholder="F">
<label>.</label>
<input type="number" id="offset-ms" placeholder="ms">
</div>
<div class="control-group">
<button id="save-config">Save Config</button>

View file

@ -20,6 +20,7 @@ document.addEventListener('DOMContentLoaded', () => {
m: document.getElementById('offset-m'),
s: document.getElementById('offset-s'),
f: document.getElementById('offset-f'),
ms: document.getElementById('offset-ms'),
};
const saveConfigButton = document.getElementById('save-config');
const manualSyncButton = document.getElementById('manual-sync');
@ -84,6 +85,7 @@ document.addEventListener('DOMContentLoaded', () => {
offsetInputs.m.value = data.timeturnerOffset.minutes;
offsetInputs.s.value = data.timeturnerOffset.seconds;
offsetInputs.f.value = data.timeturnerOffset.frames;
offsetInputs.ms.value = data.timeturnerOffset.milliseconds || 0;
nudgeValueInput.value = data.defaultNudgeMs;
} catch (error) {
console.error('Error fetching config:', error);
@ -99,6 +101,7 @@ document.addEventListener('DOMContentLoaded', () => {
minutes: parseInt(offsetInputs.m.value, 10) || 0,
seconds: parseInt(offsetInputs.s.value, 10) || 0,
frames: parseInt(offsetInputs.f.value, 10) || 0,
milliseconds: parseInt(offsetInputs.ms.value, 10) || 0,
}
};