Fixed ctrl again again

Signed-off-by: Liu Xiaoyi <circuitcoder0@gmail.com>
This commit is contained in:
Liu Xiaoyi 2025-04-01 03:33:46 +08:00
parent 9b33d82611
commit f7ffa1607a
No known key found for this signature in database
GPG Key ID: A04E02BF7E977471

View File

@ -166,16 +166,6 @@ document.addEventListener('DOMContentLoaded', function() {
lazerSettings();
});
// Recover stored settings
setData('variance', parseInt(window.localStorage.getItem('tomato-variance') ?? 100));
setData('gravity', parseInt(window.localStorage.getItem('tomato-gravity') ?? 400));
setData('init-vy', parseInt(window.localStorage.getItem('tomato-init-vy') ?? -100));
if(window.localStorage.getItem('tomato-hint') === 'true') {
const ctrl = document.getElementsByClassName('field-ctrl')[0];
ctrl.classList.remove('tucked');
ctrl.classList.add('hidden');
}
const variance = document.getElementById('field-variance');
variance.addEventListener('input', function() {
VARIANCE = parseInt(variance.value);
@ -200,4 +190,15 @@ document.addEventListener('DOMContentLoaded', function() {
initVyLabel.innerText = `Initial Velocity: ${INIT_VY}`;
window.localStorage.setItem('tomato-init-vy', INIT_VY);
});
// Recover stored settings
setData('variance', parseInt(window.localStorage.getItem('tomato-variance') ?? 100));
setData('gravity', parseInt(window.localStorage.getItem('tomato-gravity') ?? 400));
setData('init-vy', parseInt(window.localStorage.getItem('tomato-init-vy') ?? -100));
if(window.localStorage.getItem('tomato-hint') === 'true') {
const ctrl = document.getElementsByClassName('field-ctrl')[0];
ctrl.classList.remove('tucked');
ctrl.classList.add('hidden');
}
});