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") {
|
||||
const el = document.getElementById("existing-games");
|
||||
if (el) {
|
||||
setTimeout(() => {
|
||||
el.scrollIntoView({ behavior: "smooth", block: "start" });
|
||||
}, 100);
|
||||
} else {
|
||||
console.error("Element not found");
|
||||
}
|
||||
}
|
||||
}, [location]);
|
||||
@ -466,7 +470,14 @@ export function GameList() {
|
||||
</style>
|
||||
|
||||
<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">
|
||||
{games.map((game) => {
|
||||
const opinion = opinions.find((op) => op.title === game.title);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user