Compare commits

..

No commits in common. "f9dacf0eb8112d5afcab3abb46f75a4c1a0a12b2" and "618c8d79c4df7a2487cd82be9e866d2bdaa9f8c7" have entirely different histories.

6 changed files with 4 additions and 20 deletions

View file

@ -70,8 +70,8 @@ tabs:
extends: blocks/image
video:
extends: blocks/video
game:
extends: blocks/game
jeu:
extends: blocks/jeu
white-paper:
extends: blocks/white-paper

View file

@ -17,5 +17,5 @@
@import "./blocks/list.css";
@import "./blocks/quote.css";
@import "./blocks/image.css";
@import "./blocks/game.css";
@import "./blocks/jeu.css";
@import "./blocks/white-paper.css";

View file

@ -45,23 +45,7 @@
iframe.style.pointerEvents = 'auto'
container.classList.add('game-active')
overlay.setAttribute('data-state', 'played')
const menuHeight = document.querySelector('header')?.offsetHeight ?? 0
const minTop = menuHeight + 16
const rect = container.getBoundingClientRect()
const centeredTop = (window.innerHeight - rect.height) / 2
const targetTop = Math.max(centeredTop, minTop)
let scrollEl = container.parentElement
while (scrollEl && scrollEl !== document.body) {
const { overflow, overflowY } = getComputedStyle(scrollEl)
if (/auto|scroll/.test(overflow + overflowY)) break
scrollEl = scrollEl.parentElement
}
const base = (!scrollEl || scrollEl === document.body) ? window.scrollY : scrollEl.scrollTop
const target = base + rect.top - targetTop
;(scrollEl && scrollEl !== document.body ? scrollEl : window)
.scrollTo({ top: target, behavior: 'smooth' })
container.scrollIntoView({ behavior: 'smooth', block: 'center' })
})
deactivateBtn?.addEventListener('click', (e) => {