Skip to content

Commit

Permalink
hide and seek
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp committed Nov 14, 2024
1 parent a553979 commit 1a7666b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions src/pages/tips/hide-and-seek/problem.astro
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ import "./_problem_styles.css";
];

addEventListener("pagereveal", (event) => {
const from = new URL(navigation.activation.from.url, location.href);
if (
event.viewTransition &&
from.pathname !== "/tips/hide-and-seek/problem/"
) {
event.viewTransition.skipTransition?.();
if (event.viewTransition) {
if (
new URL(navigation.activation.from.url, location.href).pathname !==
"/tips/hide-and-seek/problem/"
) {
event.viewTransition.skipTransition?.();
}
}
const scrollInfo = JSON.parse(
sessionStorage.getItem("vtbag-hide-seek") ||
Expand Down
13 changes: 7 additions & 6 deletions src/pages/tips/hide-and-seek/solution.astro
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ import "./_solution_styles.css";
];

addEventListener("pagereveal", (event) => {
const from = new URL(navigation.activation.from.url, location.href);
if (
event.viewTransition &&
from.pathname !== "/tips/hide-and-seek/solution/"
) {
event.viewTransition.skipTransition?.();
if (event.viewTransition) {
if (
new URL(navigation.activation.from.url, location.href).pathname !==
"/tips/hide-and-seek/solution/"
) {
event.viewTransition.skipTransition?.();
}
}
const scrollInfo = JSON.parse(
sessionStorage.getItem("vtbag-hide-seek") ||
Expand Down

0 comments on commit 1a7666b

Please sign in to comment.