Website/app/frontend/controllers/Components/BurgerMenu_controller.ts
Snoweuph bf11292a85
All checks were successful
Quality Check / QS Backend (push) Successful in 17s
Quality Check / QS Frontend (push) Successful in 34s
Switch to Symfony UX Twig Components, Icons and Stimulus
2024-07-21 20:39:34 +02:00

20 lines
577 B
TypeScript

import {Controller} from '@hotwired/stimulus';
export default class extends Controller {
static targets: Array<string> = ['container'];
declare readonly containerTarget: HTMLElement;
connect(): void {
console.log('Init Burgers');
this.containerTarget.style.left = '';
this.containerTarget.style.right = `-${this.containerTarget.offsetWidth}px`;
}
open(): void {
this.containerTarget.style.right = '0';
}
close(): void {
this.containerTarget.style.right = `-${this.containerTarget.offsetWidth}px`;
}
}