feat: Enhance existing games anchor scrolling with a delay and add heading scroll margin.
This commit is contained in:
parent
484be7fbd4
commit
59b23586bc
@ -60,7 +60,11 @@ export function GameList() {
|
|||||||
if (location.hash === "#existing-games") {
|
if (location.hash === "#existing-games") {
|
||||||
const el = document.getElementById("existing-games");
|
const el = document.getElementById("existing-games");
|
||||||
if (el) {
|
if (el) {
|
||||||
|
setTimeout(() => {
|
||||||
el.scrollIntoView({ behavior: "smooth", block: "start" });
|
el.scrollIntoView({ behavior: "smooth", block: "start" });
|
||||||
|
}, 100);
|
||||||
|
} else {
|
||||||
|
console.error("Element not found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [location]);
|
}, [location]);
|
||||||
@ -466,7 +470,14 @@ export function GameList() {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div style={{ marginTop: "3rem" }}>
|
<div style={{ marginTop: "3rem" }}>
|
||||||
<h3 id="existing-games">Existing Games</h3>
|
<h3
|
||||||
|
id="existing-games"
|
||||||
|
style={{
|
||||||
|
scrollMarginBottom: "0",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Existing Games
|
||||||
|
</h3>
|
||||||
<ul className="grid-container">
|
<ul className="grid-container">
|
||||||
{games.map((game) => {
|
{games.map((game) => {
|
||||||
const opinion = opinions.find((op) => op.title === game.title);
|
const opinion = opinions.find((op) => op.title === game.title);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user