Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp committed Dec 26, 2024
1 parent a180491 commit 833c48d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/pages/forge/test/explorer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import Layout from "@/layouts/Layout.astro";
description="An explorer for iphone vt support"
image="/bag.png"
>
<script slot="head">
<style slot="head">
@view-transition {
navigation: auto;
}
</style>
<script is:inline slot="head">
let out = [];
addEventListener("pageswap", (e) => {
if (!history.state) history.replaceState({ index: history.length }, "");
Expand All @@ -16,16 +21,16 @@ import Layout from "@/layouts/Layout.astro";
`pageswap: ${current} ${e.activation?.navigationType} ${e.activation?.from?.index} -> ${e.activation?.entry?.index}`
);
out.push(` ${e.activation?.from?.url} -> ${e.activation?.entry?.url}`);
out.push(e.viewTransition?.types?.length ?? "-");
out.push(e.viewTransition? e.viewTransition?.types?.size : "-");
out.push(``);
sessionStorage.setItem("vtbag-out", JSON.stringify(out));
});
addEventListener("pagereveal", () => {
addEventListener("pagereveal", (e) => {
out = JSON.parse(sessionStorage.getItem("vtbag-out") ?? "[]");
if (!history.state) history.replaceState({ index: history.length }, "");
const current = history.state.index;
out.push(`pagereveal: ${current}`);
out.push(e.viewTransition?.types?.length ?? "-");
out.push(e.viewTransition? e.viewTransition?.types?.size : "-");
output.innerHTML = out.join("<br>");
out = [];
a.href = `/forge/test/explorer/?x=${Math.random()}`;
Expand Down

0 comments on commit 833c48d

Please sign in to comment.