diff --git a/astro.config.ts b/astro.config.ts index 37abf82..d1764ff 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -16,7 +16,7 @@ import type { Badge } from 'node_modules/@astrojs/starlight/schemas/badge'; // https://astro.build/config export default defineConfig({ image: { remotePatterns: [{ protocol: "https" }] }, - devToolbar: { enabled: true }, + devToolbar: { enabled: false }, site: 'https://vtbag.dev', compressHTML: false, redirects: { diff --git a/public/image-viewer-og.png b/public/image-viewer-og.png new file mode 100644 index 0000000..0334824 Binary files /dev/null and b/public/image-viewer-og.png differ diff --git a/src/content/docs/tools/turn-signal.mdx b/src/content/docs/tools/turn-signal.mdx index 814bda2..ce1567b 100644 --- a/src/content/docs/tools/turn-signal.mdx +++ b/src/content/docs/tools/turn-signal.mdx @@ -13,6 +13,21 @@ import Logo from "../../../components/Logo.astro"; import CTA from "../../../components/CTA.astro"; import signal from "../../../assets/signal.png"; + + Backward/forward view transitions for intuitive history navigation. @@ -39,15 +54,17 @@ import { CardGrid } from "@astrojs/starlight/components"; -![Turn Signal Demo](@/pages/demo-explainer/_TurnSignalDemo-dark.png) -![Turn Signal Demo](@/pages/demo-explainer/_TurnSignalDemo-light.png) +
[![Turn Signal Demo](@/pages/demo-explainer/_TurnSignalDemo-dark.png)![Turn Signal Demo](@/pages/demo-explainer/_TurnSignalDemo-light.png)](/signal-demo/bag/)
Try the [Turn-Signal Demo](/signal-demo/bag/) to see the _directions script_ in action. Click on the icons to navigate the pages. Then use your browser's back button to return. Notice how the slide animation changes direction based on the order of the pages.
+ -![Image Viewer Demo](@/assets/viewer-demo.png) + +
[![Image Viewer Demo](@/assets/viewer-demo.png)](/viewer-demo/)
+ The [Image Viewer Demo](/viewer-demo/) showcases various animations for the same page: sliding from right or left, resizing, and changing its aspect ratio. Thanks to the _link-types_ script, you can control which animation to use by adding annotations to the links that navigate to the page. @@ -55,7 +72,7 @@ Thanks to the _link-types_ script, you can control which animation to use by add
-![Fishpond Demo](@/assets/pond.png) +
[![Fishpond Demo](@/assets/pond.png)](/link-demo/)
Looking for a more dramatic example of how to control view transition types with your links? @@ -66,11 +83,12 @@ Explore the pond to learn more about how the demo was implemented.
-![forced navigatiom](@/assets/ft.png) + +
[![forced navigatiom](@/assets/ft.png)](https://events-3bg.pages.dev/signal-demo/forcedTraversal/blog/)
To see the _forced traversal_ script in action alongside the _directions script_, head over to the [Vtbot Demo](https://events-3bg.pages.dev/signal-demo/forcedTraversal/blog/)! No matter how many times you click the tabs in the header, your browser history will always have just three or less entries. -You can skip the Astro-specific details on the demo page. Script details are explained [below](#forced-transition) +You can skip the Astro-specific details on the demo page. Script details are explained [below](#forced-traversal)
@@ -163,6 +181,10 @@ Like the _directions script_, the _link types_ script also applies the `old` typ The `forced-traversal` script replaces forward navigation with history traversals if the target pages has been visited before. +:::note +This script only works on browser that [support the Navigation API](https://caniuse.com/mdn-api_navigation ). +::: + Users may be annoyed when a website messes up their history entries, but there are situations where replacing navigation with traversals has its appeal. Use at your own discretion. There are no configuration options and the `forced-traversal` script does not take any parameters. diff --git a/src/pages/link-demo/_Layout.astro b/src/pages/link-demo/_Layout.astro index 40d237e..46b3e28 100644 --- a/src/pages/link-demo/_Layout.astro +++ b/src/pages/link-demo/_Layout.astro @@ -11,22 +11,41 @@ interface Props { const { title } = Astro.props; --- - - - - + + ] + } + - - + + + height: 66vh; + width: auto; + view-transition-name: img; + } + @media (orientation: portrait) { + main img { + width: 100%; + height: auto; + margin-top: 10vh; + } + } + #back { + display: inline-block; + color: black; + border-radius: 8px; + padding: 1rem; + margin: 1rem; + background: linear-gradient(45deg, #ff6b6b, #f06595, #cc5de8); + box-shadow: 0 4px 6px #8888; + } + hr { + border-color: #8888; + } + + diff --git a/src/pages/viewer-demo/_Layout.astro b/src/pages/viewer-demo/_Layout.astro index 2db27d9..b7a3474 100644 --- a/src/pages/viewer-demo/_Layout.astro +++ b/src/pages/viewer-demo/_Layout.astro @@ -11,7 +11,7 @@ const { title } = Astro.props;