From f7ffa1607aa4e87a544fbcc8387c7d600fa70d32 Mon Sep 17 00:00:00 2001 From: Liu Xiaoyi Date: Tue, 1 Apr 2025 03:33:46 +0800 Subject: [PATCH] Fixed ctrl again again Signed-off-by: Liu Xiaoyi --- _src/lib/shoot.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/_src/lib/shoot.js b/_src/lib/shoot.js index e8bb791..555475c 100644 --- a/_src/lib/shoot.js +++ b/_src/lib/shoot.js @@ -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'); + } + });