import { Controller } from '@hotwired/stimulus'; export default class extends Controller { connect() { const main = document.querySelector('main') if (sessionStorage.getItem('size')) { main.classList.toggle('size-max', true) } else { main.classList.toggle('size-max', false) } } resize() { const main = document.querySelector('main') if (main.classList.toggle('size-max')) { sessionStorage.setItem('size', 'size-max') } else { sessionStorage.removeItem('size') } } }