FEAT: side A/B
This commit is contained in:
@@ -35,6 +35,7 @@ export const useUiStore = defineStore('ui', {
|
||||
selectBox(id: string) {
|
||||
const dataStore = useDataStore()
|
||||
dataStore.boxes.forEach((box) => {
|
||||
id = id.replace(/[AB]$/, '')
|
||||
box.state = box.id === id ? 'box-selected' : 'box-hidden'
|
||||
})
|
||||
},
|
||||
@@ -57,7 +58,7 @@ export const useUiStore = defineStore('ui', {
|
||||
// Récupérer la position de l'élément
|
||||
const elementRect = boxElement.getBoundingClientRect()
|
||||
// Calculer la position de défilement (une boîte plus haut)
|
||||
const offsetPosition = elementRect.top + window.pageYOffset - (elementRect.height * 1.5)
|
||||
const offsetPosition = elementRect.top + window.pageYOffset - elementRect.height * 1.5
|
||||
// Faire défiler à la nouvelle position
|
||||
window.scrollTo({
|
||||
top: offsetPosition,
|
||||
|
||||
Reference in New Issue
Block a user