setting up front 1

This commit is contained in:
elvira
2026-07-31 17:41:55 +03:00
parent b88fde739c
commit bf8b9219fc
48 changed files with 2250 additions and 11 deletions
+21
View File
@@ -0,0 +1,21 @@
import { Controller } from '@hotwired/stimulus'
export default class extends Controller {
static targets = ['button', 'panel']
show(event) {
this.#activate(event.currentTarget.dataset.panel)
}
#activate(panelId) {
this.buttonTargets.forEach(btn => {
const active = btn.dataset.panel === panelId
btn.classList.toggle('is-active', active)
btn.setAttribute('aria-selected', String(active))
})
this.panelTargets.forEach(panel => {
panel.hidden = panel.id !== `tab-panel-${panelId}`
})
}
}