import WuhuBase from "../WuhuBase"; import TornStyleBlock from "../utils/TornStyleBlock"; import WuhuConfig from "../WuhuConfig"; import TornStyleSwitch from "../utils/TornStyleSwitch"; export default class StackHelper extends WuhuBase { className = 'StackHelper'; constructor() { super(); let block = new TornStyleBlock('叠E保护').insert2Dom(); let switcher = new TornStyleSwitch('启用'); let input = switcher.getInput(); block.append(switcher.getBase()); input.checked = WuhuConfig.get('SEProtect'); if (input.checked) document.body.classList.add('wh-gym-stack'); // 绑定点击事件 input.onchange = e => { let target = e.target as HTMLInputElement; document.body.classList.toggle('wh-gym-stack'); WuhuConfig.set('SEProtect', target.checked, true); }; } }