├── .changeset ├── README.md ├── config.json └── grumpy-mice-dance.md ├── .editorconfig ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug-report.yml │ ├── config.yml │ └── feature-request.yml ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── build.yml │ └── cf_pages.yml ├── .gitignore ├── .prettierignore ├── .prettierrc.cjs ├── .vscode └── extensions.json ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── astro.config.ts ├── bin ├── build ├── check_links.sh ├── gv ├── headers.sh └── relocate.sh ├── ec.config.mjs ├── package-lock.json ├── package.json ├── public ├── astro.svg ├── blog-placeholder-about.jpg ├── bot1.png ├── camera-shutter-199580.mp3 ├── d2 │ └── docs │ │ └── jotter │ │ ├── astro │ │ ├── scripts-0.svg │ │ └── scripts-1.svg │ │ ├── history-0.svg │ │ ├── history-1.svg │ │ ├── history-2.svg │ │ ├── history-3.svg │ │ ├── history-4.svg │ │ ├── history-5.svg │ │ └── history-6.svg ├── deep-strange-whoosh-183845.mp3 ├── favicon.ico ├── favicon.png ├── favicon.svg ├── hero.png ├── heroine.png ├── large-steampunk-factory-machine-188048.mp3 ├── portrait.webp ├── robots.txt ├── social.png ├── swoosh-6428.mp3 ├── thumb_hero.png ├── thumb_heroine.png ├── view-transitions.mp4 └── winter.mp3 ├── remark-heading-id.d.ts ├── sizes ├── Nothing.astro ├── UseAnimationStyle.astro ├── UseAutoNameSelected.astro ├── UseBorderControl.astro ├── UseBrakePad.astro ├── UseLinter.astro ├── UseLoading.astro ├── UseMove.astro ├── UseMove2.astro ├── UseNoScroll.astro ├── UsePageOffset.astro ├── UsePointerOnNavigation.astro ├── UsePortal.astro ├── UseReplacementSwap.astro ├── UseSwapSound.astro ├── UseSwing.astro ├── UseSwing2.astro ├── UseVtBotDebug.astro ├── UseZoom.astro ├── UseZoom2.astro ├── astro.config.ts ├── sizes └── src │ ├── .gitignore │ ├── env.d.ts │ └── pages │ └── Mini.astro ├── src ├── assets │ ├── ViewTransitionRouter.png │ ├── big-fi.png │ ├── ch.png │ ├── chamber.png │ ├── components.png │ ├── demos.png │ ├── devToolbar.png │ ├── fi.png │ ├── fish.png │ ├── gv │ │ ├── .gitignore │ │ ├── common.dot │ │ └── migration.gv │ ├── linter.dark.png │ ├── linter.light.png │ ├── outback.png │ ├── starlight.structure_dark.png │ ├── starlight.structure_light.png │ ├── svgs │ │ └── migration.svg │ ├── vtd1.dark.png │ ├── vtd1.light.png │ ├── vtd2.dark.png │ ├── vtd2.light.png │ └── winter.png ├── common.d2 ├── components │ ├── AnimateImages.astro │ ├── BoT.astro │ ├── CanIUseVT.astro │ ├── Card.astro │ ├── Carousel.astro │ ├── CarouselNav.astro │ ├── Carsel.astro │ ├── CircleAnimation.astro │ ├── DemosAndComponents.astro │ ├── EagerImageLoading.astro │ ├── ExampleCarsel.astro │ ├── ExampleForm.astro │ ├── Gallery.astro │ ├── Logo.astro │ ├── ThemeChanger1.astro │ ├── ThemeChanger2.astro │ ├── VtDemo.astro │ ├── VtbotEye.astro │ ├── bot │ │ ├── AutoCollapse.astro │ │ ├── AutoCollapseToggle.astro │ │ ├── LightBox.astro │ │ ├── MarkTitle.astro │ │ └── shadow-root-utils.ts │ ├── form │ │ └── TextInput.astro │ ├── iframe-theme.ts │ ├── mouse-coords.ts │ ├── navigate.ts │ └── starlight │ │ ├── DemoHead3.astro │ │ ├── FeelBack.astro │ │ ├── Head.astro │ │ ├── LastUpdated.astro │ │ ├── PageTitle.astro │ │ ├── PagefindToTextFragments.astro │ │ └── SidebarSelect.astro ├── content.config.ts ├── content │ └── docs │ │ ├── blog │ │ └── demo-post.mdx │ │ └── jotter │ │ ├── api │ │ ├── BasicVt.astro │ │ ├── MorphVt.astro │ │ ├── ZoomVt.astro │ │ ├── details.mdx │ │ ├── example.mdx │ │ ├── index.mdx │ │ ├── references.mdx │ │ └── test-page.mdx │ │ ├── astro-view-transitions.mdx │ │ ├── astro │ │ ├── differences.mdx │ │ ├── directives.mdx │ │ ├── flow-events.mdx │ │ ├── index.mdx │ │ ├── loader-swap.mdx │ │ └── scripts.mdx │ │ ├── components.mdx │ │ ├── demos.mdx │ │ ├── feature-comparison.mdx │ │ ├── history-of-changes.mdx │ │ ├── history.css │ │ ├── history.mdx │ │ ├── index.mdx │ │ ├── migrate.mdx │ │ ├── same-doc.mdx │ │ ├── snippets │ │ ├── apg.mdx │ │ ├── css-tricks-pitfalls.mdx │ │ └── things-to-write-about.mdx │ │ ├── starlight │ │ ├── guide.mdx │ │ ├── index.mdx │ │ └── inner-workings │ │ │ ├── app-state.mdx │ │ │ ├── index.mdx │ │ │ ├── integration.mdx │ │ │ ├── sidebar.mdx │ │ │ ├── splash1.mdx │ │ │ ├── splash2.mdx │ │ │ └── transitions.mdx │ │ ├── styling.mdx │ │ └── toolbar.png ├── css │ └── light-dark.css ├── dom-view-transitions-level2.d.ts ├── env.d.ts ├── later │ ├── fryuni-load.mdx │ ├── random.mdx │ ├── styling.mdx │ └── vt-emu.mdx ├── layouts │ ├── AnimationMdxLayout.astro │ ├── CarouselLayout.astro │ ├── CircleLayout.astro │ ├── ColorfulLayout.astro │ ├── FishPondLayout.astro │ ├── GalleryMdxLayout.astro │ ├── Layout.astro │ ├── LibraryMdxLayout.astro │ ├── LoadingLayout.astro │ ├── MdxLayout.astro │ ├── MorphLayout.astro │ ├── NavBarMdxLayout.astro │ ├── NoResetLayout.astro │ ├── NoScrollLayout.astro │ ├── PortalMdxLayout.astro │ ├── PrefetchLayout.astro │ ├── ProgressBarLayout.astro │ ├── ScrollToTopLayout.astro │ └── iframes │ │ └── vtscrollLayout.astro ├── mdx │ ├── animations │ │ ├── move1.mdx │ │ ├── move2.mdx │ │ ├── move3.mdx │ │ ├── swing0.mdx │ │ ├── swing1.mdx │ │ ├── swing2.mdx │ │ ├── swing3.mdx │ │ ├── zoom1.mdx │ │ ├── zoom2.mdx │ │ └── zoom3.mdx │ ├── components.mdx │ ├── demos.mdx │ ├── hero-prefetch │ │ └── overview.mdx │ ├── loading │ │ ├── one.mdx │ │ └── two.mdx │ ├── morph │ │ └── three.mdx │ ├── no-reset │ │ └── four.mdx │ ├── no-scroll │ │ ├── one.mdx │ │ └── two.mdx │ ├── scroll-to-top │ │ └── two.mdx │ └── winter │ │ ├── one.mdx │ │ └── two.mdx ├── pages │ ├── 0.astro │ ├── animations │ │ ├── one.mdx │ │ └── two.mdx │ ├── carousel │ │ ├── four.astro │ │ ├── one.astro │ │ ├── three.astro │ │ └── two.astro │ ├── circular │ │ ├── one.astro │ │ └── two.astro │ ├── components.astro │ ├── demos.astro │ ├── docs │ │ └── Jotter.astro │ ├── fish-pond │ │ ├── center.astro │ │ ├── east.astro │ │ ├── index.astro │ │ ├── north.astro │ │ ├── south.astro │ │ └── west.astro │ ├── hero-prefetch │ │ ├── hero.astro │ │ ├── heroine.astro │ │ └── overview.astro │ ├── iframes │ │ ├── _RocketLayout.astro │ │ ├── _outline.css │ │ ├── _rocket.css │ │ ├── rocket-[kind]-[outline]-[theme]-2.astro │ │ ├── rocket-[kind]-[outline]-[theme].astro │ │ ├── vtdemo-[theme].astro │ │ ├── vtdemo2-[theme].astro │ │ ├── vtdemo3-[theme].astro │ │ ├── vtdemo4-[theme].astro │ │ ├── vtscroll1-[duration]-[theme].astro │ │ └── vtscroll2-[duration]-[theme].astro │ ├── image-gallery │ │ └── index.mdx │ ├── index.astro │ ├── inspection-chamber-demo │ │ ├── _ChamberLayout.astro │ │ ├── first-page.astro │ │ └── second-page.astro │ ├── intra-page │ │ └── only-page.astro │ ├── ken-guru.astro │ ├── library │ │ ├── Activator.mdx │ │ ├── AnimationStyle.mdx │ │ ├── AutoNameSelected.mdx │ │ ├── BorderControl.mdx │ │ ├── BrakePad.mdx │ │ ├── CamShaft.mdx │ │ ├── ElementCrossing.mdx │ │ ├── InspectionChamber.mdx │ │ ├── Installation.mdx │ │ ├── Linter.mdx │ │ ├── LoadingIndicator.mdx │ │ ├── Move.mdx │ │ ├── NoScroll.mdx │ │ ├── PageOffset.mdx │ │ ├── PointerOnNavigation.mdx │ │ ├── Portal.mdx │ │ ├── ReplacementSwap.mdx │ │ ├── StarlightPlugin.mdx │ │ ├── SwapSound.mdx │ │ ├── Swing.mdx │ │ ├── TurnSignal.mdx │ │ ├── VtBotDebug.mdx │ │ ├── Zoom.mdx │ │ └── perspective.mdx │ ├── loading │ │ ├── one.astro │ │ ├── progress-bar │ │ │ ├── colorful1.mdx │ │ │ ├── colorful2.mdx │ │ │ ├── one.mdx │ │ │ └── two.mdx │ │ └── two.astro │ ├── morph │ │ ├── one.astro │ │ ├── three.astro │ │ └── two.astro │ ├── no-reset │ │ ├── four.astro │ │ ├── one.astro │ │ ├── three.astro │ │ └── two.astro │ ├── no-scroll │ │ ├── one.astro │ │ └── two.astro │ ├── portal │ │ ├── one.mdx │ │ ├── page.astro │ │ └── two.mdx │ ├── rocket-api │ │ ├── _Layout.astro │ │ ├── page1.astro │ │ └── page2.astro │ ├── rocket-cr │ │ ├── _Layout.astro │ │ ├── page1.astro │ │ └── page2.astro │ ├── scroll-to-top │ │ ├── one.astro │ │ └── two.astro │ ├── signal-demo │ │ ├── _components │ │ │ ├── BaseHead.astro │ │ │ ├── Footer.astro │ │ │ ├── FormattedDate.astro │ │ │ └── HeaderLink.astro │ │ ├── _consts.ts │ │ ├── _styles │ │ │ └── global.css │ │ ├── forcedTraversal │ │ │ ├── _BaseHead.astro │ │ │ ├── _BlogPost.astro │ │ │ ├── _Header.astro │ │ │ ├── _explainer.md │ │ │ ├── about.astro │ │ │ ├── blog.astro │ │ │ └── index.astro │ │ ├── forwardOnly │ │ │ ├── _BlogPost.astro │ │ │ ├── _Header.astro │ │ │ ├── _explainer.md │ │ │ ├── about.astro │ │ │ ├── blog.astro │ │ │ └── index.astro │ │ ├── index.mdx │ │ ├── link-types │ │ │ ├── _BaseHead.astro │ │ │ ├── _BlogPost.astro │ │ │ ├── _Header.astro │ │ │ ├── _explainer.mdx │ │ │ ├── about.astro │ │ │ ├── blog.astro │ │ │ └── index.astro │ │ ├── multipleDirections │ │ │ ├── _BaseHead.astro │ │ │ ├── _BlogPost.astro │ │ │ ├── _Header.astro │ │ │ ├── _explainer.md │ │ │ ├── about.astro │ │ │ ├── blog.astro │ │ │ └── index.astro │ │ ├── pageOrder │ │ │ ├── _BaseHead.astro │ │ │ ├── _BlogPost.astro │ │ │ ├── _Header.astro │ │ │ ├── _explainer.md │ │ │ ├── about.astro │ │ │ ├── blog.astro │ │ │ └── index.astro │ │ └── same │ │ │ ├── _BaseHead.astro │ │ │ ├── _BlogPost.astro │ │ │ ├── _Header.astro │ │ │ ├── _explainer.mdx │ │ │ ├── about.astro │ │ │ ├── blog.astro │ │ │ └── index.astro │ ├── styles │ │ └── view-transition.css │ └── winter │ │ ├── one.astro │ │ └── two.astro └── styles │ ├── custom.css │ ├── ec.s8bdm.css │ ├── view-transition.css │ └── vt.css └── tsconfig.json /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", 3 | "changelog": "@changesets/cli/changelog", 4 | "commit": false, 5 | "fixed": [], 6 | "linked": [], 7 | "access": "public", 8 | "baseBranch": "main", 9 | "updateInternalDependencies": "patch", 10 | "ignore": [] 11 | } 12 | -------------------------------------------------------------------------------- /.changeset/grumpy-mice-dance.md: -------------------------------------------------------------------------------- 1 | --- 2 | "astro-vtbot-website": patch 3 | --- 4 | 5 | Prepare for v1.5.0 of the bag 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = tab 8 | insert_final_newline = true 9 | trim_trailing_whitespace = false 10 | 11 | [{.*,*.md,*.json,*.toml,*.yml,}] 12 | indent_style = space 13 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: martrapp 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | name: "\U0001F41B Website Bug Report" 2 | description: Report an issue or possible bug with the WEBSITE for The Bag 👜✨. Please report issues for the npm package on the astro-vtbot Library Repository, see link three lines below. 3 | labels: [] 4 | assignees: [] 5 | body: 6 | - type: textarea 7 | id: bug-description 8 | attributes: 9 | label: Describe the Bug 10 | description: A clear and concise description of what the bug is. 11 | validations: 12 | required: true 13 | - type: textarea 14 | id: bug-expectation 15 | attributes: 16 | label: What's the expected result? 17 | description: Describe what you expect to happen. 18 | validations: 19 | required: true 20 | - type: checkboxes 21 | id: will-pr 22 | attributes: 23 | label: Participation 24 | options: 25 | - label: I am willing to submit a pull request for this issue. 26 | required: false 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: astro-vtbot Library Repository 4 | url: https://github.com/martrapp/astro-vtbot 5 | about: You are in the repository of the WEBSITE for The Bag 👜✨. Is your problem, query or discussion related to the astro-vtbot library rather than the website? Then please visit the library repository by clicking the button on the right. 6 | - name: GitHub Discussions 7 | url: https://github.com/martrapp/astro-vtbot/discussions 8 | about: Does the issue involve a lot of explanation, or are you not sure how it can be split into actionable tasks? Consider starting a discussion on the astro-vtbot repository first. 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | name: "✨ Website Feature Request" 2 | description: You have new ideas how to improve the website? 3 | labels: [enhancement] 4 | assignees: [] 5 | body: 6 | - type: textarea 7 | id: feature-description 8 | attributes: 9 | label: Describe the Request 10 | description: A clear and concise description of what the new feature should be. 11 | validations: 12 | required: true 13 | - type: checkboxes 14 | id: will-pr 15 | attributes: 16 | label: Participation 17 | options: 18 | - label: I am willing to contribute a PR to make this happen. 19 | required: false 20 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | ### Description 3 | 4 | - Summarize your changes in one or two sentences. 5 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | 9 | # Maintain dependencies for GitHub Actions 10 | - package-ecosystem: "github-actions" 11 | directory: "/" 12 | schedule: 13 | interval: "weekly" 14 | 15 | # Maintain dependencies for npm 16 | - package-ecosystem: "npm" 17 | directory: "/" 18 | schedule: 19 | interval: "weekly" 20 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # Sample workflow for building and deploying an Astro site to GitHub Pages 2 | # 3 | # To get started with Astro see: https://docs.astro.build/en/getting-started/ 4 | # 5 | name: Build 6 | 7 | on: 8 | # Allows you to run this workflow manually from the Actions tab 9 | workflow_dispatch: 10 | pull_request: 11 | branches: [ main ] 12 | 13 | jobs: 14 | build: 15 | name: Build 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v4 20 | 21 | - name: Setup Node 22 | uses: actions/setup-node@v4 23 | with: 24 | node-version: "18" 25 | cache: npm 26 | cache-dependency-path: ./package-lock.json 27 | 28 | - name: Cache .astro 29 | uses: actions/cache@v4 30 | with: 31 | path: ./node_modules 32 | key: astro-cache-${{ github.run_id }} 33 | restore-keys: astro-cache 34 | 35 | - name: Install dependencies 36 | run: npm install 37 | 38 | - name: Build with Astro 39 | run: npm run build 40 | 41 | -------------------------------------------------------------------------------- /.github/workflows/cf_pages.yml: -------------------------------------------------------------------------------- 1 | # Sample workflow for building and deploying an Astro site to GitHub Pages 2 | # 3 | # To get started with Astro see: https://docs.astro.build/en/getting-started/ 4 | # 5 | name: Build & Deploy 6 | 7 | on: 8 | push: 9 | branches: 10 | - main 11 | # Allows you to run this workflow manually from the Actions tab 12 | workflow_dispatch: 13 | 14 | 15 | jobs: 16 | build: 17 | name: Build 18 | if: ${{ github.repository_owner == 'martrapp' }} 19 | runs-on: ubuntu-latest 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v4 23 | with: 24 | fetch-depth: 0 25 | 26 | - name: Setup Node 27 | uses: actions/setup-node@v4 28 | with: 29 | node-version: "18" 30 | cache: npm 31 | cache-dependency-path: ./package-lock.json 32 | 33 | - name: Cache .astro 34 | uses: actions/cache@v4 35 | with: 36 | path: ./node_modules 37 | key: astro-cache-${{ github.run_id }} 38 | restore-keys: astro-cache 39 | 40 | - name: Install dependencies 41 | run: npm install 42 | 43 | - name: Build with Astro 44 | run: npm run build 45 | env: 46 | GS: ${{ secrets.GS }} 47 | 48 | - name: Publish to Cloudflare Pages 49 | uses: cloudflare/pages-action@v1 50 | with: 51 | apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} 52 | accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} 53 | projectName: events 54 | directory: ./dist 55 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | tmp 4 | exclude 5 | 6 | dist 7 | .vscode 8 | .astro 9 | 10 | .DS_Store 11 | /test-results/ 12 | /playwright-report/ 13 | /blob-report/ 14 | /playwright/.cache/ 15 | stats.html 16 | 17 | sizes/dist.tar.br 18 | sizes/dist.tar 19 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/*.mdx 2 | -------------------------------------------------------------------------------- /.prettierrc.cjs: -------------------------------------------------------------------------------- 1 | /** @type {import("@types/prettier").Options} */ 2 | module.exports = { 3 | printWidth: 100, 4 | semi: true, 5 | singleQuote: true, 6 | tabWidth: 2, 7 | trailingComma: 'es5', 8 | useTabs: true, 9 | plugins: ['./node_modules/prettier-plugin-astro/dist/index.js'], 10 | overrides: [ 11 | { 12 | files: '*.astro', 13 | options: { 14 | parser: 'astro', 15 | }, 16 | }, 17 | { 18 | files: ['.*', '*.json', '*.md', '*.toml', '*.yml'], 19 | options: { 20 | useTabs: false, 21 | }, 22 | }, 23 | ], 24 | }; 25 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "astro-build.astro-vscode", 4 | "dbaeumer.vscode-eslint", 5 | "esbenp.prettier-vscode", 6 | "editorconfig.editorconfig" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to astro-vtbot-website 2 | 3 | Thank you for considering contributing to **astro-vtbot-website**! Contributions are welcome and appreciated. This document outlines the steps and guidelines for contributing to this project. 4 | 5 | ## Types of Contributions 6 | 7 | ### 1. **Bug Reports** 8 | - Identify problems or inconsistencies in the website's functionality, layout, or appearance. 9 | - Ensure the issue is reproducible, and provide steps to reproduce the problem. 10 | - Describe the expected behavior and how the bug deviates from it. 11 | - If possible, propose a solution or link to relevant code snippets. 12 | 13 | ### 2. **Feature Requests and Enhancements** 14 | - Suggest new features or improvements that align with the website's objectives. 15 | - Be clear on how this feature will improve the user experience or development workflow. 16 | - Provide examples or references to support your suggestion, if possible. 17 | 18 | 19 | ### 3. **PRs Welcome! Contribute by Improving Content** 20 | - Improve the clarity and completeness of the documentation. 21 | - Add more elaborate explanations or use cases where appropriate. 22 | - Provide more detailed code examples and walk-throughs. 23 | - Proofread the content for grammar and spelling mistakes. 24 | - Ensure technical accuracy and consistency in explanations. 25 | 26 | 27 | --- 28 | 29 | Thanks for your interest in improving **astro-vtbot-website**! Excited to see what you'll contribute. 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright 2023 Martin Trapp 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome! 2 | 3 | This is [the website](https://events-3bg.pages.dev) of 👜 The Bag ✨ 4 | 5 | By full name "The Bag of Tricks for Astro's View Transitions".\ 6 | "If it doesn't move, it's probably unmoved." 7 | 8 | The library itself can be found here: [astro-vtbot](https://github.com/martrapp/astro-vtbot#readme) 9 | 10 | ## Troubleshooting & Contributing 11 | 12 | This package is maintained by [martrapp](https://github.com/martrapp) independently from Astro. You are welcome to contact me on Discord or to contribute by submitting an issue or opening a PR! 13 | 14 | ## Changelog 15 | 16 | See [CHANGELOG.md](https://github.com/martrapp/astro-vtbot/blob/main/CHANGELOG.md) for a history of changes of the `astro-vtbot` package. 17 | 18 | Made with 💖👜✨! 19 | -------------------------------------------------------------------------------- /bin/build: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | sed -i 's/showSubResults: true,/showSubResults:true,excerptLength:40,/' node_modules/@astrojs/starlight/components/Search.astro 4 | sed -i 's///' node_modules/astro-feelback/components/parts/Component.astro 5 | sed -i 's/slug: PAGE_TITLE_ID/slug: "top"/' node_modules/@astrojs/starlight/utils/generateToC.ts 6 | astro check && astro build 7 | if [ "$?" -ne "0" ]; then 8 | exit 1 9 | fi 10 | ./bin/check_links.sh | grep -v "#starlight-image-zoom" 11 | [ -n "$GS" ] && echo -n "google-site-verification: ${GS}" > ./dist/${GS} 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /bin/check_links.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | links() { 4 | file="$1" 5 | from=$(echo "$file" | sed 's/index\.html$//') 6 | cat "dist$file" | tr ' >' '\n\n' | grep 'href="' | sed 's/href="\(.*\)"/\1/' |\ 7 | awk '\ 8 | /^javascript:/ { next }\ 9 | /^https?:/ { next }\ 10 | /^#/ { print "'"$from"'", "'"$from"'" $0; next }\ 11 | /^\.\./ { print "'"$from"'", "'"$from"'" $0; next }\ 12 | /^\.$/ { print "'"$from"'", "'"$from"'"; next }\ 13 | /^\.\/#$/ {print "'"$from"'", "'"$from"'"; next }\ 14 | /^\.\// { match($0, /^\.\/(.*)/, arr); print "'"$from"'", "'"$from"'" arr[1]; next }\ 15 | /^\// { print "'"$from"'", $0; next }\ 16 | { print "@", $0, "'"$from"'" }\ 17 | ' 18 | } 19 | 20 | anchors() { 21 | file="$1" 22 | from=$(echo "$file" | sed 's/index\.html$//') 23 | cat "dist$file" | tr ' >' '\n\n' | grep 'id="' | sed 's/id="\(.*\)"/\1/' | \ 24 | awk '{ print "'"$from"'#" $0, "'"$from"'#" $0}END{$0="top";print "'"$from"'#" $0, "'"$from"'#" $0}' 25 | } 26 | files=$(find dist -type f -name "*.html" | sed 's/^dist//') 27 | for file in $files; do 28 | links="$links $(links $file)\n" 29 | links="$links $(anchors $file)" 30 | done 31 | css=$(find dist/_astro -type f -name "*.css" | sed 's/^dist//') 32 | css=$(echo "$css" | awk '{print $0"/", $0"/"}') 33 | echo "$css $links" | grep -v "/404.html " | awk '{target=clean($2); def[$1]=target; use[target]=$1} END {\ 34 | for (target in use) if (!(target in def)) print "broken link from", use[target], "to", target;\ 35 | for (from in def) if (!(from in use)) print "unused page", from;\ 36 | } function clean(x) { while (gsub(/\/[^/]*\/\.\./, "", x)); return x }' | sort 37 | 38 | -------------------------------------------------------------------------------- /bin/gv: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | rm src/assets/gv/*.old 4 | tmp=/tmp/gv.svg 5 | while true; do 6 | for i in src/assets/gv/*.gv; do 7 | out="src/assets/svgs/$(basename $i .gv).svg" 8 | old="src/assets/gv/$(basename $i .gv).old" 9 | if [ ! -f $old ] || ! diff -q $i $old; then 10 | echo "generating $out" 11 | cat $i | sed -e 's|include(\([^)]*\))|include(\`src/assets/gv/\1'"'"')|'|\ 12 | m4 | dot -Tsvg | svgo - >$tmp && cp $i $old 13 | cp $tmp $out 14 | else 15 | echo "$out is up to date" 16 | fi 17 | done 18 | if [ "$1" != "dev" ]; then break; fi 19 | sleep 1 20 | done 21 | -------------------------------------------------------------------------------- /bin/headers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find dist/ -name '*.*' -exec ls -l {} \;| \ 3 | awk '{sub("index.html","",$9); print substr($9,5) "@ x-uncompressed-content-length:",$5"@"}'| \ 4 | tr '@' '\n' > dist/_headers 5 | -------------------------------------------------------------------------------- /bin/relocate.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | BASE="${1:-""}/" 4 | 5 | echo "Relocating '/' to '${BASE}'" 6 | find dist -type f \( -name "*.html" -o -name "*.js" \) -exec sed -i \ 7 | -e "s^url(/_astro/^url(${BASE}_astro/^g" \ 8 | -e "s^\(\(href\|src\|srcset\)\)=\"/^\1=\"${BASE}^g" \ 9 | -e "s^content=\"/carousel/^content=\"${BASE}carousel/^g" \ 10 | -e "s^:/carousel/^:${BASE}carousel/^g" {} \; -print 11 | -------------------------------------------------------------------------------- /ec.config.mjs: -------------------------------------------------------------------------------- 1 | import { pluginCollapsibleSections } from '@expressive-code/plugin-collapsible-sections'; 2 | import { pluginLineNumbers } from '@expressive-code/plugin-line-numbers'; 3 | 4 | export default { 5 | themes: ['github-dark', 'github-light'], 6 | tabWidth: 2, 7 | styleOverrides: { 8 | borderRadius: "0.5rem", 9 | }, 10 | plugins: [pluginCollapsibleSections(), pluginLineNumbers()], 11 | } 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "astro-vtbot-website", 3 | "version": "1.3.6", 4 | "description": "The Website for the Bag of Tricks for Astro's View Transitions", 5 | "homepage": "https://github.com/martrapp/astro-vtbot#readme", 6 | "bugs": { 7 | "url": "https://github.com/martrapp/astro-vtbot-website/issues" 8 | }, 9 | "license": "ISC", 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/martrapp/astro-vtbot-website.git" 13 | }, 14 | "type": "module", 15 | "scripts": { 16 | "format": "prettier -w src", 17 | "dev": "astro dev", 18 | "build": "./bin/build", 19 | "preview": "astro preview", 20 | "sizes": "(cd sizes && ./sizes)", 21 | "relocate": "./bin/relocate.sh" 22 | }, 23 | "devDependencies": { 24 | "@astrojs/check": "^0.9.4", 25 | "@astrojs/mdx": "^4.3.0", 26 | "@astrojs/starlight": "^0.34.3", 27 | "@changesets/changelog-github": "^0.5.1", 28 | "@changesets/cli": "^2.29.4", 29 | "@expressive-code/plugin-collapsible-sections": "^0.41.2", 30 | "@expressive-code/plugin-line-numbers": "^0.41.2", 31 | "@lorenzo_lewis/starlight-utils": "^0.3.2", 32 | "@pagefind/default-ui": "^1.3.0", 33 | "@types/dom-view-transitions": "^1.0.6", 34 | "@types/node": "^22.15.29", 35 | "astro": "^5.8.1", 36 | "astro-d2": "^0.8.0", 37 | "astro-expressive-code": "^0.41.2", 38 | "astro-feelback": "latest", 39 | "astro-vtbot": "^2.1.4", 40 | "html2canvas": "^1.4.1", 41 | "nanostores": "^1.0.1", 42 | "prettier": "^3.5.3", 43 | "prettier-plugin-astro": "^0.14.1", 44 | "rehype-autolink-headings": "^7.1.0", 45 | "rehype-external-links": "^3.0.0", 46 | "rehype-slug": "^6.0.0", 47 | "remark-heading-id": "^1.0.1", 48 | "remark-toc": "^9.0.0", 49 | "sharp": "^0.34.2", 50 | "starlight-blog": "^0.23.2", 51 | "starlight-image-zoom": "^0.12.0", 52 | "typescript": "^5.8.3" 53 | }, 54 | "funding": { 55 | "type": "github", 56 | "url": "https://github.com/sponsors/martrapp" 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /public/astro.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /public/blog-placeholder-about.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/blog-placeholder-about.jpg -------------------------------------------------------------------------------- /public/bot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/bot1.png -------------------------------------------------------------------------------- /public/camera-shutter-199580.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/camera-shutter-199580.mp3 -------------------------------------------------------------------------------- /public/deep-strange-whoosh-183845.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/deep-strange-whoosh-183845.mp3 -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/favicon.ico -------------------------------------------------------------------------------- /public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/favicon.png -------------------------------------------------------------------------------- /public/hero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/hero.png -------------------------------------------------------------------------------- /public/heroine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/heroine.png -------------------------------------------------------------------------------- /public/large-steampunk-factory-machine-188048.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/large-steampunk-factory-machine-188048.mp3 -------------------------------------------------------------------------------- /public/portrait.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/portrait.webp -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/social.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/social.png -------------------------------------------------------------------------------- /public/swoosh-6428.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/swoosh-6428.mp3 -------------------------------------------------------------------------------- /public/thumb_hero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/thumb_hero.png -------------------------------------------------------------------------------- /public/thumb_heroine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/thumb_heroine.png -------------------------------------------------------------------------------- /public/view-transitions.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/view-transitions.mp4 -------------------------------------------------------------------------------- /public/winter.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/public/winter.mp3 -------------------------------------------------------------------------------- /remark-heading-id.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'remark-heading-id' 2 | -------------------------------------------------------------------------------- /sizes/Nothing.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import Mini from './Mini.astro'; 4 | --- 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |

Heading

13 | Link 14 | 15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /sizes/UseAnimationStyle.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import AnimationStyle from 'astro-vtbot/animations/AnimationStyle.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseAutoNameSelected.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import AutoNameSelected from 'astro-vtbot/components/AutoNameSelected.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseBorderControl.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import BorderControl from 'astro-vtbot/components/BorderControl.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseBrakePad.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import BrakePad from 'astro-vtbot/components/BrakePad.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseLinter.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import Linter from 'astro-vtbot/components/Linter.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseLoading.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import LoadingIndicator from 'astro-vtbot/components/LoadingIndicator.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseMove.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import { move } from 'astro-vtbot/animations/move' 4 | import Mini from './Mini.astro' 5 | --- 6 | 7 | 8 | 9 | 10 | 11 |
12 |

Heading

13 | Link 14 | 15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /sizes/UseMove2.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import { customMove } from 'astro-vtbot/animations/move'; 4 | import Mini from './Mini.astro'; 5 | const scope = customMove('swing', {}); 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseNoScroll.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import NoScroll from 'astro-vtbot/components/NoScroll.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UsePageOffset.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import PageOffset from 'astro-vtbot/components/PageOffset.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UsePointerOnNavigation.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import NoScroll from 'astro-vtbot/components/PointerOnNavigation.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UsePortal.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import Portal from 'astro-vtbot/components/Portal.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseReplacementSwap.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import ReplacementSwap from 'astro-vtbot/components/ReplacementSwap.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseSwapSound.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import SwapSound from 'astro-vtbot/components/SwapSound.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseSwing.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import { swing } from 'astro-vtbot/animations/swing'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |

Heading

14 | Link 15 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /sizes/UseSwing2.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import { customSwing } from 'astro-vtbot/animations/swing'; 4 | import Mini from './Mini.astro'; 5 | const scope = customSwing('swing', {}); 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseVtBotDebug.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import VtBotDebug from 'astro-vtbot/components/VtBotDebug.astro'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/UseZoom.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import { zoom } from 'astro-vtbot/animations/zoom'; 4 | import Mini from './Mini.astro'; 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |

Heading

14 | Link 15 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /sizes/UseZoom2.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | import { customZoom } from 'astro-vtbot/animations/zoom'; 4 | import Mini from './Mini.astro'; 5 | const scope = customZoom('zoom', {}); 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Heading

15 | Link 16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /sizes/astro.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'astro/config'; 2 | import mdx from '@astrojs/mdx'; 3 | import remarkToc from 'remark-toc'; 4 | import expressiveCode from 'astro-expressive-code'; 5 | import starlight from "@astrojs/starlight"; 6 | 7 | 8 | // https://astro.build/config 9 | export default defineConfig({ 10 | prefetch: true, 11 | markdown: { 12 | remarkPlugins: [remarkToc], 13 | shikiConfig: { 14 | themes: { 15 | light: 'github-light', 16 | dark: 'github-dark', 17 | }, 18 | wrap: false, 19 | }, 20 | }, 21 | trailingSlash: 'always', 22 | integrations: [expressiveCode(), mdx()], 23 | vite: { 24 | server: { 25 | fs: { 26 | allow: ['/home/'] 27 | }, 28 | }, 29 | }, 30 | }); 31 | -------------------------------------------------------------------------------- /sizes/sizes: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -e 4 | size() { 5 | cp $1 src/pages/index.astro 6 | rm -rf dist 7 | astro build > /dev/null 8 | tar cf dist.tar dist 9 | brotli -f dist.tar 10 | expr $(du -b dist.tar.br|awk '{print $1}') - $2 11 | } 12 | 13 | base=$(size Nothing.astro 0) 14 | for i in Use*.astro ; do 15 | s=$(size $i ${base}) 16 | echo $i $s 17 | done 18 | -------------------------------------------------------------------------------- /sizes/src/.gitignore: -------------------------------------------------------------------------------- 1 | pages 2 | -------------------------------------------------------------------------------- /sizes/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// -------------------------------------------------------------------------------- /sizes/src/pages/Mini.astro: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | Mini 4 | -------------------------------------------------------------------------------- /src/assets/ViewTransitionRouter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/ViewTransitionRouter.png -------------------------------------------------------------------------------- /src/assets/big-fi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/big-fi.png -------------------------------------------------------------------------------- /src/assets/ch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/ch.png -------------------------------------------------------------------------------- /src/assets/chamber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/chamber.png -------------------------------------------------------------------------------- /src/assets/components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/components.png -------------------------------------------------------------------------------- /src/assets/demos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/demos.png -------------------------------------------------------------------------------- /src/assets/devToolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/devToolbar.png -------------------------------------------------------------------------------- /src/assets/fi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/fi.png -------------------------------------------------------------------------------- /src/assets/fish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/fish.png -------------------------------------------------------------------------------- /src/assets/gv/.gitignore: -------------------------------------------------------------------------------- 1 | *.old 2 | -------------------------------------------------------------------------------- /src/assets/gv/common.dot: -------------------------------------------------------------------------------- 1 | bgcolor=transparent 2 | edge [ 3 | 4 | ] 5 | node [ 6 | shape=box 7 | style=rounded 8 | fontname="sans-serif" 9 | ] 10 | -------------------------------------------------------------------------------- /src/assets/gv/migration.gv: -------------------------------------------------------------------------------- 1 | digraph { 2 | include(common.dot) 3 | margin="0.1,0.1" 4 | height=0.1 5 | width=0.1 6 | // splines=ortho 7 | node [fontsize=12] 8 | rem [label="Remove from all pages" href="#remove-clientrouter-"] 9 | state [label="Replace SPA state\n e.g. transition:persist and\nshared state management", href="#replace-spa-state"] 10 | mpa [label="Check site's MPA functionality", href="#check-mpa-functionality"] 11 | rem -> mpa [penwidth=2] 12 | rem -> state -> mpa 13 | at [label="Add @transition {navigation: auto}" href="#enable-cross-document-view-transitions"] 14 | mpa -> at [penwidth=2] 15 | dirs [label="Keep transition:animate\nand transition:name?", href="#keep-generated-css", shape=diamond] 16 | at -> dirs [penwidth=2] 17 | dirs -> Done [xlabel="yes,\rand I have\rno special\rbackward\ranimations\r" class="rj", penwidth=2] 18 | turnSignal [label="Add direction\ndetection" href="#add-direction-detection"] 19 | dirs -> turnSignal [xlabel="yes, with\nbackward\nanimations"] 20 | animate [label="Replace with\nCSS for\nview transition names\nand\npseudo-elements" href="#replace-auto-generated-css"] 21 | turnSignal -> Done 22 | animate -> turnSignal 23 | dirs -> animate [xlabel=" no" minlen=2] 24 | animate -> Done 25 | Done [label="Done" href="#done"] 26 | } 27 | -------------------------------------------------------------------------------- /src/assets/linter.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/linter.dark.png -------------------------------------------------------------------------------- /src/assets/linter.light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/linter.light.png -------------------------------------------------------------------------------- /src/assets/outback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/outback.png -------------------------------------------------------------------------------- /src/assets/starlight.structure_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/starlight.structure_dark.png -------------------------------------------------------------------------------- /src/assets/starlight.structure_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/starlight.structure_light.png -------------------------------------------------------------------------------- /src/assets/vtd1.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/vtd1.dark.png -------------------------------------------------------------------------------- /src/assets/vtd1.light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/vtd1.light.png -------------------------------------------------------------------------------- /src/assets/vtd2.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/vtd2.dark.png -------------------------------------------------------------------------------- /src/assets/vtd2.light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/vtd2.light.png -------------------------------------------------------------------------------- /src/assets/winter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/assets/winter.png -------------------------------------------------------------------------------- /src/common.d2: -------------------------------------------------------------------------------- 1 | direction: down 2 | style.fill: transparent 3 | vars: {d2-config: {dark-theme-overrides: {B1: "#eeeeee"}}} 4 | -------------------------------------------------------------------------------- /src/components/AnimateImages.astro: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 | 21 | 32 | -------------------------------------------------------------------------------- /src/components/BoT.astro: -------------------------------------------------------------------------------- 1 | 👜 Bag of Tricks ✨ 2 | -------------------------------------------------------------------------------- /src/components/CanIUseVT.astro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Data on support for the view-transitions feature across the major browsers from caniuse.com 8 | 9 | -------------------------------------------------------------------------------- /src/components/Carousel.astro: -------------------------------------------------------------------------------- 1 | --- 2 | interface Props { 3 | pages: string[]; 4 | index: number; 5 | } 6 | const { pages, index } = Astro.props; 7 | --- 8 | 9 | 10 | 11 | 54 | 55 | 66 | -------------------------------------------------------------------------------- /src/components/CarouselNav.astro: -------------------------------------------------------------------------------- 1 | --- 2 | interface Props { 3 | pages: string[]; 4 | index: number; 5 | } 6 | const { pages, index } = Astro.props; 7 | --- 8 | 9 |

{pages.map((_, idx) => (idx === index ? '—⚫—' : '—⚪—'))}

10 |

11 | Previous | Next 18 |

19 | -------------------------------------------------------------------------------- /src/components/CircleAnimation.astro: -------------------------------------------------------------------------------- 1 | --- 2 | // see https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#controlling_animations_with_javascript 3 | --- 4 | 5 | 6 | 47 | 58 | -------------------------------------------------------------------------------- /src/components/DemosAndComponents.astro: -------------------------------------------------------------------------------- 1 | --- 2 | export interface Props { 3 | title: string; 4 | } 5 | const { title } = Astro.props; 6 | --- 7 | 8 | 12 | -------------------------------------------------------------------------------- /src/components/EagerImageLoading.astro: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 | 14 | -------------------------------------------------------------------------------- /src/components/Logo.astro: -------------------------------------------------------------------------------- 1 | --- 2 | export interface Props { 3 | height: string; 4 | } 5 | const { height = '1.5rem' } = Astro.props; 6 | --- 7 | 8 | bot 13 | -------------------------------------------------------------------------------- /src/components/VtDemo.astro: -------------------------------------------------------------------------------- 1 | --- 2 | export interface Props { 3 | path: string; 4 | height?: string; 5 | width?: string; 6 | } 7 | const { path, height="20rem", width="20rem" } = Astro.props; 8 | --- 9 | 10 |
11 | { 12 | /* 13 | Iframe is dynamically inserted after view transition as otherwise the new-image is distorted. 14 | 15 | */ 16 | } 17 |
18 |
If your browser has problems starting view transitions inside an iframe, view this demo in a new tab
19 | 20 | 40 | 55 | -------------------------------------------------------------------------------- /src/components/bot/AutoCollapse.astro: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 | 45 | -------------------------------------------------------------------------------- /src/components/bot/AutoCollapseToggle.astro: -------------------------------------------------------------------------------- 1 | --- 2 | interface Props { 3 | label?: string; 4 | } 5 | const { label } = Astro.props; 6 | --- 7 | 8 | {label && } 9 | 34 | 44 | -------------------------------------------------------------------------------- /src/components/bot/MarkTitle.astro: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 | 37 | 51 | -------------------------------------------------------------------------------- /src/components/bot/shadow-root-utils.ts: -------------------------------------------------------------------------------- 1 | export function attachShadowRoots(root: HTMLElement | DocumentFragment) { 2 | root.querySelectorAll('template[shadowrootmode]').forEach((template) => { 3 | if (template.parentElement) { 4 | const mode = template.getAttribute('shadowrootmode'); 5 | const shadowRoot = template.parentElement.attachShadow({ mode: mode as ShadowRootMode }); 6 | attachShadowRoots(template.content); 7 | shadowRoot.appendChild(template.content); 8 | template.remove(); 9 | } 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /src/components/form/TextInput.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import './form.css'; 3 | interface Props extends astroHTML.JSX.InputHTMLAttributes { 4 | label?: string; 5 | } 6 | 7 | const { label, ...props } = Astro.props as Props; 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/components/iframe-theme.ts: -------------------------------------------------------------------------------- 1 | import { TRANSITION_PAGE_LOAD } from 'astro:transitions/client'; 2 | 3 | export function theme() { 4 | [...document.querySelectorAll('iframe')].forEach((iframe) => { 5 | if (iframe instanceof HTMLIFrameElement && iframe.contentDocument) { 6 | iframe.contentDocument.documentElement.dataset.theme = document.documentElement.dataset.theme; 7 | } 8 | }); 9 | } 10 | 11 | const observer = new MutationObserver(theme); 12 | observer.observe(document.documentElement, { 13 | attributes: true, 14 | attributeFilter: ['data-theme'], 15 | }); 16 | document.addEventListener(TRANSITION_PAGE_LOAD, () => setTimeout(theme, 100)); 17 | -------------------------------------------------------------------------------- /src/components/mouse-coords.ts: -------------------------------------------------------------------------------- 1 | import { map } from 'nanostores'; 2 | 3 | export type Coords = { x: number; y: number }; 4 | 5 | export const $coords = map({ x: 0, y: 0 }); 6 | 7 | document.addEventListener('mousemove', (e) => { 8 | $coords.setKey('x', e.clientX); 9 | $coords.setKey('y', e.clientY); 10 | }); 11 | -------------------------------------------------------------------------------- /src/components/navigate.ts: -------------------------------------------------------------------------------- 1 | import { navigate } from 'astro:transitions/client'; 2 | 3 | declare global { 4 | var vtbotNavigate: (hashFragment: string, textFragment: string) => void; 5 | } 6 | 7 | window.vtbotNavigate = (hashFragment: string, textFragment: string) => 8 | navigate( 9 | !('fragmentDirective' in document) 10 | ? hashFragment 11 | : hashFragment.replace(/#.*$/, '') + '#:~:text=' + textFragment 12 | ); 13 | -------------------------------------------------------------------------------- /src/components/starlight/LastUpdated.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { spawnSync } from 'child_process'; 3 | import { basename, dirname } from 'path'; 4 | 5 | const { lang, lastUpdated } = Astro.locals.starlightRoute; 6 | const gitDate = (f: string) => 7 | spawnSync( 8 | 'git', 9 | ['log', '--format=%ct', '--follow', '--diff-filter=A', '--max-count=1', basename(f)], 10 | { 11 | cwd: dirname(f), 12 | encoding: 'utf-8', 13 | } 14 | ).stdout.trim(); 15 | const firstPublished = new Date(Number(gitDate(Astro.locals.starlightRoute.entry.filePath) + '000')); 16 | --- 17 | 18 | { 19 | lastUpdated && ( 20 |

21 | 22 | {'Last updated:'}{' '} 23 | 29 | 30 | 31 | {'First published:'}{' '} 32 | 38 | 39 |

40 | ) 41 | } 42 | -------------------------------------------------------------------------------- /src/components/starlight/PageTitle.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import StarlightPageTitle from '@astrojs/starlight/components/PageTitle.astro'; 3 | import LastUpdated from './LastUpdated.astro'; 4 | import { customSwing } from 'astro-vtbot/animations/swing'; 5 | import AnimationStyle from 'astro-vtbot/animations/AnimationStyle.astro'; 6 | import ReadyToFinished from 'astro-vtbot/components/ReadyToFinished.astro'; 7 | 8 | const swingScope = customSwing('head-last-update', { 9 | keyframes: { axis: { y: 1 }, angle: { leave: '90deg', enter: '-90deg' } }, 10 | base: { duration: '400ms' }, 11 | extensions: { 12 | forwards: { 13 | old: { 'transform-origin': 'center left' }, 14 | new: { 'transform-origin': 'center right', 'animation-delay': '0.5s' }, 15 | }, 16 | backwards: { 17 | old: { 'transform-origin': 'center right' }, 18 | new: { 'transform-origin': 'center left', 'animation-delay': '0.5s' }, 19 | }, 20 | }, 21 | }); 22 | /* ReadyToFinish: 23 | Ensure a minimal interval from viewTransition.ready to viewTransition.finish 24 | Should be a bit more than 2/3 SidebarSelect duration 25 | */ 26 | --- 27 | 28 | 29 | 30 |
31 | 32 |
33 | 34 | 35 | 36 | 37 | 38 | 43 | 48 | -------------------------------------------------------------------------------- /src/content.config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection, z } from 'astro:content'; 2 | import { docsSchema } from '@astrojs/starlight/schema'; 3 | import { docsLoader } from '@astrojs/starlight/loaders'; 4 | import { blogSchema } from 'starlight-blog/schema'; 5 | 6 | export const collections = { 7 | docs: defineCollection({ 8 | loader: docsLoader(), 9 | schema: docsSchema({ 10 | extend: (context) => 11 | blogSchema(context).merge(z.object({ firstPublished: z.date().optional() })), 12 | }), 13 | }), 14 | }; 15 | -------------------------------------------------------------------------------- /src/content/docs/blog/demo-post.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Demo Blog Post 3 | date: 2023-07-24 4 | authors: 5 | - name: martrapp 6 | picture: https://avatars.githubusercontent.com/u/94928215?v=4 7 | url: https://martr.app 8 | - name: trueberryless 9 | picture: https://avatars.githubusercontent.com/u/99918022?v=4 10 | url: https://trueberryless.org/ 11 | --- 12 | 13 | ## What is This Page About? 14 | 15 | This page features both, the `starlight-blog` and the `starlight-image-zoom` integrations. Both are on vthe friendly neighbor list of the [Bag's guide for Starlight](/jotter/starlight/guide/). So the purpose of this page is to early detect degression in the Bag's view transition support for Starlight. 16 | 17 | ## An Image to Zoom 18 | 19 | ![A test image to zoom](../../../assets/fi.png) 20 | 21 | ## Jotter 22 | 23 | A link [back to the Jotter](/jotter/). 24 | 25 | ## Thanks! 26 | Thank you very much, [@trueberryless](https://trueberryless.org), for pointing out the issue where the two packages override each other and for taking care of the solution! 27 | -------------------------------------------------------------------------------- /src/content/docs/jotter/api/BasicVt.astro: -------------------------------------------------------------------------------- 1 |
2 |
This is the document before the view transition
3 |
And this is the document after the view transition
4 |
5 | 6 | 68 | -------------------------------------------------------------------------------- /src/content/docs/jotter/api/MorphVt.astro: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 |
6 |
This is the document before the view transition
7 |
And this is the document after the view transition
8 |
view-transition-name: x
9 |
10 | 11 | 89 | -------------------------------------------------------------------------------- /src/content/docs/jotter/api/ZoomVt.astro: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 |
6 |
This is the document before the view transition
7 |
And his is the document after the view transition
8 |
9 | 10 | 85 | -------------------------------------------------------------------------------- /src/content/docs/jotter/api/references.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: References 3 | description: A collection of links with further information on the transitions 4 | --- 5 | While view transitions are a rather new topic, there *are* some good documents out there to explain them. 6 | 7 | ## Explainers 8 | * The Level 1 View Transition API *Explainer* at W3C/WICG: [https://github.com/WICG/view-transitions/blob/main/explainer.md](https://github.com/WICG/view-transitions/blob/main/explainer.md) 9 | * The Level 2 View Transition API *Explainer* at W3C/WICG: [https://github.com/WICG/view-transitions/blob/main/cross-doc-explainer.md#pageconceal](https://github.com/WICG/view-transitions/blob/main/cross-doc-explainer.md#pageconceal) 10 | 11 | 12 | ## W3C Drafts 13 | * Level 1: The W3C Candidate Recommendation Snapshot: *CSS View Transitions Module Level 1* [https://drafts.csswg.org/css-view-transitions-1/](https://drafts.csswg.org/css-view-transitions-1/) 14 | 15 | * Level 2: The Editor’s Draft: *CSS View Transitions Module Level 2* [https://drafts.csswg.org/css-view-transitions-2/](https://drafts.csswg.org/css-view-transitions-2/) 16 | 17 | ## MDN 18 | * The Documentation of the View Transition API on MDN [https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) 19 | 20 | ## Introduction by Example 21 | 22 | * Jake Archibald's *Same-document view transitions for single-page applications* [https://developer.chrome.com/docs/web-platform/view-transitions/same-document](https://developer.chrome.com/docs/web-platform/view-transitions/same-document) 23 | 24 | * Bramus' *Cross-document view transitions for multi-page applications* [https://developer.chrome.com/docs/web-platform/view-transitions/cross-document](https://developer.chrome.com/docs/web-platform/view-transitions/cross-document) 25 | 26 | * Jake's eye-opening article on [how to handle aspect ratio](https://jakearchibald.com/2024/view-transitions-handling-aspect-ratio-changes/) 27 | 28 | * A collection of [same-page and cross-page examples](https://view-transitions.chrome.dev/) from Bramus. 29 | 30 | -------------------------------------------------------------------------------- /src/content/docs/jotter/api/test-page.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Test Your Browser's View Transition Capabilities" 3 | description: Check what part of the View Transition API is supported by your browser 4 | --- 5 | 6 | This page shows whether your current browser has native support for view transitions. 7 | 8 | |Feature|Support?| 9 | |-------|---------| 10 | |View transitions Level 1|| 11 | |View transitions Level 2|| 12 | |Nested transition groups|| 13 | 14 | Level 1 is the basic view transition API for transitions within th same document.\ 15 | Level 2 covers cross-document view transitions. 16 | 17 | [Pointers to the specs](/jotter/api/references/#w3c-drafts) (W3C Drafts) 18 | 19 | 20 | 21 | Browser compatibility data: https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#browser_compatibility 22 | 23 | 68 | -------------------------------------------------------------------------------- /src/content/docs/jotter/components.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Reusable Components 3 | description: astro-vtbot offers reusable components to simplify the use of view transitions in Astro projects 4 | --- 5 | 6 | import BoT from "/src/components/BoT.astro" 7 | import DemosAndComponents from "/src/components/DemosAndComponents.astro" 8 | 9 | The offers a colorful bunch of reusable components that support different aspects of view transition enabled sites. Click on the image to explore the portfolio! 10 | 11 | 12 |
[![reusable components](src/assets/components.png)](/components/)
13 | 14 | These are generic components that **do not require specific themes**. There are also [Starlight specific components](/jotter/starlight/guide/) in The Bag. 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/content/docs/jotter/demos.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Tech-Demos 3 | description: astro-vtbot provides multiple tech demos to demonstrate the use of view transitions in Astro projects 4 | --- 5 | import BoT from "/src/components/BoT.astro" 6 | import DemosAndComponents from "/src/components/DemosAndComponents.astro" 7 | 8 | The shows various aspects of view transitions with small demos. Click the image to dive into the view transition demos. 9 | 10 |
[![technical demonstrations](src/assets/demos.png)](/demos/)
11 | 12 | 13 | -------------------------------------------------------------------------------- /src/content/docs/jotter/history.css: -------------------------------------------------------------------------------- 1 | .container { 2 | display: flex; 3 | flex-wrap: wrap; 4 | } 5 | 6 | .item { 7 | display: flex; 8 | flex-direction: column; 9 | justify-content: center; 10 | align-items: center; 11 | width: 100%; 12 | border-top: 1pt dashed #888; 13 | } 14 | 15 | @media screen and (min-width: 50rem) { 16 | .item { 17 | flex-direction: row; 18 | border-top: 0pt; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/content/docs/jotter/snippets/css-tricks-pitfalls.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: CSS Tricks & Pitfalls 3 | description: Tips and Tricks on using view transitions in Astro 4 | --- 5 | 6 | ## Testing for View Transition Support in CSS 7 | 8 | You can test whether the user's browser has native support for view transition like this: 9 | 10 | ```css 11 | /* has native support for view transitions */ 12 | @supports(view-transition-name: a) { 13 | ... 14 | } 15 | /* does not natively support view transitions */ 16 | @supports not(view-transition-name: a) { 17 | ... 18 | } 19 | ``` 20 | 21 | ## Ignored Style Rules 22 | 23 | Browsers that do not support view transitions may cough and choke when fed CSS for view transitions. 24 | 25 | While it is apparent that they do not support the `::view-transition-*` pseudo-elements, some other consequences are not so obvious. 26 | 27 | * Setting the `view-transition-name` CSS property is not harmful in browsers without support for view transitions. But the property is simply ignored, and you cannot access it in the DOM. 28 | 29 | * In JavaScript, you should not access `element.style.viewTransitionName` or similar accessors to view transition CSS properties if the browser does not support view transitions natively. This will likely throw errors. 30 | 31 | 32 | * Do not combine selectors with view transition properties with normal selectors in CSS rules. The browser will likely ignore the entire rule, including the part that does not contain a view transition. Here is an example: 33 | 34 | ```css title="pitfall.css" {2} 35 | ::view-transition-group(main), 36 | body main { 37 | ... 38 | } 39 | ``` 40 | Although the highlighted section is correct, browsers may completely ignore the entire rule due to the unknown pseudo element selector. 41 | 42 | -------------------------------------------------------------------------------- /src/content/docs/jotter/snippets/things-to-write-about.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Things to write about when I find the time to do so and there are no other more important things to do 3 | description: The bag-log of The Bag 4 | --- 5 | ## Other's have a Backlog, I've got a *👜 Baglog ✨* ;-) 6 | 7 | * Why does it not simply work when I add `transition-*` directives to an Astro component like in `` 8 | 9 | * How to combine CSS for view transitions with media queries 10 | 11 | * How to have a sticky video from the moment on when you first came across that page with the video 12 | 13 | * A Common abstraction across Astro's view transitions and Level 2 View Transition API? 14 | 15 | * How to order scripts plus ideas about a plugin system for view transitions 16 | 17 | * how to drag styles for persisted elements to the next page 18 | 19 | * how to optimize view transitions by clipping the images (is that possible?) and removing transitions that are off-viewport 20 | 21 | * how to make a decent loading screen that covers the target page on load and is than withdrawn (with or without view transitions) 22 | 23 | * timing behavior of view transitions (rendering does not start before the whole DOM is loaded and parsed) 24 | 25 | * how to synchronize JavaScript animations with view transitions 26 | 27 | * how to craft scripts and components that can be used with and without view transitions 28 | 29 | * What it is worth to know that `view-transition-name` is discretely animatable 30 | 31 | * Explain the stacking order of new and old images 32 | 33 | * how to have the view transition move **behind** some elements in the front? 34 | 35 | * how to set break points to investigate the pseudo elements 36 | 37 | * add that still missing sections on how web components can make your life easier when using view transitions 38 | 39 | * different order of components / eventListeners in DEV & PROD and how to fix that 40 | 41 | * Persisting elements as an alternative to script re-initialization, especially dynamically created ones e.g. chat apps 42 | -------------------------------------------------------------------------------- /src/content/docs/jotter/starlight/inner-workings/splash1.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Splash1 3 | template: splash 4 | hero: 5 | title: 'Bag of Tricks' 6 | tagline: If it doesn't move, it's probably unmoved. 7 | image: 8 | alt: The Bag 9 | dark: /public/favicon.svg 10 | light: /public/bot1.png 11 | actions: 12 | - text: Back to the Jotter 13 | link: /jotter/starlight/inner-workings/ 14 | icon: right-arrow 15 | variant: primary 16 | - text: Jump to another splash screen 17 | link: /jotter/starlight/inner-workings/splash2/ 18 | icon: starlight 19 | --- 20 | 21 |
22 | -------------------------------------------------------------------------------- /src/content/docs/jotter/starlight/inner-workings/splash2.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Splash2 3 | template: splash 4 | hero: 5 | title: 'The Bag of Tricks' 6 | tagline: If it doesn't move, it's probably unmoved. 7 | image: 8 | alt: The Fish! 9 | file: /src/assets/fi.png 10 | actions: 11 | - text: Back to the Jotter 12 | link: /jotter/starlight/inner-workings/ 13 | icon: right-arrow 14 | variant: primary 15 | - text: Jump to another splash screen 16 | link: /jotter/starlight/inner-workings/splash1/ 17 | icon: starlight 18 | --- 19 |
20 | -------------------------------------------------------------------------------- /src/content/docs/jotter/toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/martrapp/astro-vtbot-website/0fa7455675b068e055cad16347d9c98fb376deb3/src/content/docs/jotter/toolbar.png -------------------------------------------------------------------------------- /src/css/light-dark.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --vtbot-global-accent: rgb(175, 104, 16); 3 | background: radial-gradient(circle, #d8e0e8 50%, #f0f8ff 100%); 4 | --vtbot-gradbg: linear-gradient(300deg, #fff8, #bdf8); 5 | --vtbot-background-color: whitesmoke; 6 | background-color: var(--vtbot-background-color); 7 | --vtbot-color: darkslategray; 8 | --vtbot-accent: darkblue; 9 | color: var(--vtbot-color); 10 | --vtbot-table-background-color: #ececec; 11 | } 12 | .dark { 13 | display: none; 14 | } 15 | .light { 16 | display: block; 17 | } 18 | @media (prefers-color-scheme: dark) { 19 | .light { 20 | display: none; 21 | } 22 | .dark { 23 | display: block; 24 | } 25 | :root { 26 | background: radial-gradient(circle, #123 50%, #000 100%); 27 | --vtbot-gradbg: linear-gradient(300deg, rgba(51, 47, 47, 0.8), #012c); 28 | --vtbot-background-color: #023; 29 | --vtbot-color: #abc; 30 | --vtbot-accent: #adf; 31 | --vtbot-table-background-color: rgb(37, 41, 45); 32 | } 33 | 34 | .shiki, 35 | .shiki span { 36 | color: var(--shiki-dark) !important; 37 | background-color: var(--shiki-dark-bg) !important; 38 | /* Optional, if you also want font styles */ 39 | font-style: var(--shiki-dark-font-style) !important; 40 | font-weight: var(--shiki-dark-font-weight) !important; 41 | text-decoration: var(--shiki-dark-text-decoration) !important; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/dom-view-transitions-level2.d.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | type UpdateCallback = undefined | (() => void | Promise); 3 | type StartViewTransitionParameter = { types?: string[] | Set; update?: UpdateCallback }; 4 | 5 | interface Document { 6 | startViewTransition?(param?: StartViewTransitionParameter | UpdateCallback): ViewTransition; 7 | } 8 | interface PageSwapEvent extends Event { 9 | viewTransition?: ViewTransition; 10 | activation?: NavigationActivation; 11 | } 12 | interface PageRevealEvent extends Event { 13 | viewTransition?: ViewTransition; 14 | } 15 | 16 | interface WindowEventMap { 17 | pageswap: PageSwapEvent; 18 | pagereveal: PageRevealEvent; 19 | } 20 | 21 | interface NavigationActivation { 22 | entry: NavigationHistoryEntry; 23 | from: NavigationHistoryEntry; 24 | navigationType: NavigationTypeString; 25 | } 26 | interface AnimationEffect { 27 | target: HTMLElement; 28 | pseudoElement?: string; 29 | getKeyframes: () => Keyframe[]; 30 | } 31 | 32 | interface ViewTransition { 33 | types?: Set; 34 | } 35 | interface Window { 36 | navigation?: Navigation; 37 | } 38 | interface Navigation { 39 | activation: NavigationActivation; 40 | } 41 | } 42 | export {}; 43 | -------------------------------------------------------------------------------- /src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /src/later/random.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Random Bits 3 | --- 4 | 5 | From time to time, I stumble across things that might be worth explaining in more detail here in the jotter. Before I forget them again, I at least post them here. Feel free to add any other topics you are interested in here. 6 | 7 | * `view-transition-name` is discretely animatable 8 | 9 | * Stacking order of elements 10 | 11 | -------------------------------------------------------------------------------- /src/later/styling.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Styling 3 | --- 4 | 5 | This part of the Jotter gives an overview of how styling view transitions works in Astro. 6 | 7 | If you use the `transition:*` directives 8 | 9 | -------------------------------------------------------------------------------- /src/later/vt-emu.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How Astro emulates view transitions 3 | --- 4 | -------------------------------------------------------------------------------- /src/layouts/CircleLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import CircleAnimation from '../components/CircleAnimation.astro'; 3 | import Layout from './Layout.astro'; 4 | 5 | interface Props { 6 | background: string; 7 | } 8 | const { background } = Astro.props; 9 | --- 10 | 11 | 12 | 13 | 14 | 15 | 16 | 24 | -------------------------------------------------------------------------------- /src/layouts/GalleryMdxLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Gallery from '../components/Gallery.astro'; 3 | import AutoNameSelected from 'astro-vtbot/components/AutoNameSelected.astro'; 4 | import NoScroll from 'astro-vtbot/components/NoScroll.astro'; 5 | import MdxLayout from './MdxLayout.astro'; 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/layouts/Layout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter } from 'astro:transitions'; 3 | export interface Props { 4 | title: string; 5 | pageFindIgnore?: boolean; 6 | background?: string; 7 | } 8 | 9 | const { title, background = '', pageFindIgnore = false } = Astro.props; 10 | --- 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | {title + ' | Bag of Tricks'} 21 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/layouts/LibraryMdxLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import MdxLayout from './MdxLayout.astro'; 3 | const { frontmatter } = Astro.props; 4 | --- 5 | 6 | 7 |
8 | 9 |
10 |
11 | -------------------------------------------------------------------------------- /src/layouts/LoadingLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import BrakePad from 'astro-vtbot/components/BrakePad.astro'; 3 | import LoadingIndicator from 'astro-vtbot/components/LoadingIndicator.astro'; 4 | import VtBotDebug from 'astro-vtbot/components/VtBotDebug.astro'; 5 | import MdxLayout from './MdxLayout.astro'; 6 | interface Props { 7 | title: string; 8 | background: string; 9 | } 10 | const { title } = Astro.props; 11 | --- 12 | 13 | 14 | 15 | 16 | 17 |
18 |

{title}

19 |

Open the browser console to see the debug information

20 | 21 |
22 |
23 |
24 | 25 | 35 | -------------------------------------------------------------------------------- /src/layouts/MorphLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from './Layout.astro'; 3 | interface Props { 4 | title: string; 5 | pageFindIgnore: boolean; 6 | background: string; 7 | } 8 | const { title, background, pageFindIgnore } = Astro.props; 9 | --- 10 | 11 | 12 |

{title}

13 | 14 |
15 | 41 | 51 | 56 | -------------------------------------------------------------------------------- /src/layouts/NavBarMdxLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import MdxLayout from './MdxLayout.astro'; 3 | const { frontmatter } = Astro.props; 4 | --- 5 | 6 | 7 |
8 | 9 |
 
10 |
11 | 28 |
29 | 40 | 79 | -------------------------------------------------------------------------------- /src/layouts/NoScrollLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import MdxLayout from './MdxLayout.astro'; 3 | import NoScroll from 'astro-vtbot/components/NoScroll.astro'; 4 | 5 | interface Props { 6 | title: string; 7 | background: string; 8 | } 9 | const { title } = Astro.props; 10 | --- 11 | 12 | 13 | 14 |
15 | 16 |
17 |
18 | 19 | 44 | -------------------------------------------------------------------------------- /src/layouts/PortalMdxLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import MdxLayout from './MdxLayout.astro'; 3 | import Portal from 'astro-vtbot/components/Portal.astro'; 4 | 5 | const { frontmatter } = Astro.props; 6 | --- 7 | 8 | 9 | 10 |
11 | 12 |
13 |
14 | 15 | 24 | -------------------------------------------------------------------------------- /src/layouts/PrefetchLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from './Layout.astro'; 3 | interface Props { 4 | background: string; 5 | title: string; 6 | } 7 | const { title, background } = Astro.props; 8 | --- 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/layouts/ProgressBarLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import BrakePad from 'astro-vtbot/components/BrakePad.astro'; 3 | import ProgressBar from 'astro-vtbot/components/ProgressBar.astro'; 4 | import MdxLayout from './MdxLayout.astro'; 5 | --- 6 | 7 | 8 | { 9 | /* This is the custom component. 10 | * It can be put into the or the of your page 11 | */ 12 | } 13 | 14 | 15 | {/* To observe the effect it is necessary to simulate a 2000ms loading time */} 16 | 17 | 18 | 19 | 20 | 21 | {/* You can style the progress bar by defining the swup-progress-bar class */} 22 | 27 | -------------------------------------------------------------------------------- /src/layouts/ScrollToTopLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import MdxLayout from './MdxLayout.astro'; 3 | 4 | interface Props { 5 | title: string; 6 | } 7 | const { title } = Astro.props; 8 | --- 9 | 10 | 11 | 12 | 13 | 14 | 27 | 36 | -------------------------------------------------------------------------------- /src/layouts/iframes/vtscrollLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { ClientRouter, slide } from 'astro:transitions'; 3 | import PageOffset from 'astro-vtbot/components/PageOffset.astro'; 4 | export interface Props { 5 | theme: 'light' | 'dark'; 6 | duration: string; 7 | opt: boolean |undefined 8 | } 9 | 10 | const { theme, duration, opt } = Astro.props; 11 | const none = duration.startsWith('0'); 12 | --- 13 | 14 | 15 | 16 | 17 | 18 | {opt && } 19 | 20 | 21 |

Your browser doesn't support native view transitions. All three examples should look the same as Astro's simulation doesn't implement morph animations.

22 |
23 | 24 |
25 | 26 | 27 | 28 | 53 | { none && } 54 | { !none && } 55 | -------------------------------------------------------------------------------- /src/mdx/animations/move1.mdx: -------------------------------------------------------------------------------- 1 | ```astro title="Move1.astro" 2 | --- 3 | import { move } from "astro-vtbot/animations/move"; 4 | --- 5 |
6 | ... 7 |
8 | ``` 9 | -------------------------------------------------------------------------------- /src/mdx/animations/move2.mdx: -------------------------------------------------------------------------------- 1 | ```astro title="Move2.astro" 2 | --- 3 | import { customMove } from "astro-vtbot/animations/move"; 4 | import AnimationStyle from "astro-vtbot/animations/AnimationStyle.astro"; 5 | 6 | const move2Scope = customMove('move2', { 7 | keyframes: { 8 | enter: { x: '100vw'}, 9 | leave: { x: '-100vw'}, 10 | }, 11 | base: { duration: '0.5s', easing: 'linear' }, 12 | }); 13 | --- 14 | 15 |
16 | ... 17 |
18 | ``` 19 | -------------------------------------------------------------------------------- /src/mdx/animations/move3.mdx: -------------------------------------------------------------------------------- 1 | ```astro title="Move3.astro" 2 | --- 3 | import { customMove } from "astro-vtbot/animations/move"; 4 | import AnimationStyle from "astro-vtbot/animations/AnimationStyle.astro"; 5 | 6 | const move3Scope = customMove('move3', { 7 | keyframes: { 8 | enter: { y: '-50cm', z: '-50cm' }, 9 | enterMid: { y: '10cm', z: '-25cm', angel: '10deg' }, 10 | leaveMid: { y: '-10cm', z: '-25cm', angel: '-10deg' }, 11 | leave: { y: '50cm', z: '50cm' }, 12 | axis: { x: 1, y: 1, z: 1 } 13 | } 14 | }); 15 | --- 16 | 17 |
18 | ... 19 |
20 | ``` 21 | -------------------------------------------------------------------------------- /src/mdx/animations/swing0.mdx: -------------------------------------------------------------------------------- 1 | ```astro 2 | --- 3 | import { swing } from "astro-vtbot/animations/swing"; 4 | --- 5 |
6 | ... 7 |
8 | ``` 9 | -------------------------------------------------------------------------------- /src/mdx/animations/swing1.mdx: -------------------------------------------------------------------------------- 1 | ```astro title="Swing1.astro" 2 | --- 3 | import { customSwing } from "astro-vtbot/animations/swing"; 4 | import AnimationStyle from "astro-vtbot/animations/AnimationStyle.astro"; 5 | 6 | const swing1Scope = customSwing('swing1', { 7 | keyframes: { axis: { y: 1 }, angle: { leave: '90deg', enter: '-90deg' } }, 8 | base: { duration: '300ms' }, 9 | extensions: { 10 | forwards: { 11 | old: { 'transform-origin': 'center left' }, 12 | new: { 'transform-origin': 'center right', 'animation-delay': '0.075s' }, 13 | }, 14 | backwards: { 15 | old: { 'transform-origin': 'center right' }, 16 | new: { 'transform-origin': 'center left', 'animation-delay': '0.075s' }, 17 | }, 18 | }, 19 | }); 20 | --- 21 | 22 |
23 | ... 24 |
25 | ``` 26 | -------------------------------------------------------------------------------- /src/mdx/animations/swing2.mdx: -------------------------------------------------------------------------------- 1 | ```astro title="Swing2.astro" 2 | --- 3 | import { customSwing } from "astro-vtbot/animations/swing"; 4 | import AnimationStyle from "astro-vtbot/animations/AnimationStyle.astro"; 5 | 6 | const swing2Scope = customSwing('swing2', { 7 | keyframes: { 8 | axis: { z: 1 }, 9 | angle: { leave: '180deg', enter: '-180deg' }, 10 | }, 11 | base: { duration: '0.3s' }, 12 | extensions: { 13 | forwards: { new: { 'animation-delay': '0.15s' } }, 14 | backwards: { new: { 'animation-delay': '0.15s' } }, 15 | }, 16 | }); 17 | --- 18 | 19 |
20 | ... 21 |
22 | ``` 23 | -------------------------------------------------------------------------------- /src/mdx/animations/swing3.mdx: -------------------------------------------------------------------------------- 1 | ```astro title="Swing3.astro" 2 | --- 3 | import { customSwing } from "astro-vtbot/animations/swing"; 4 | import AnimationStyle from "astro-vtbot/animations/AnimationStyle.astro"; 5 | 6 | const swing3Scope = customSwing('swing3', { 7 | keyframes: { axis: { x: 1 } }, 8 | base: { duration: '0.3s' }, 9 | extensions: { 10 | forwards: { 11 | old: { 'transform-origin': 'top center' }, 12 | new: { 'transform-origin': 'top center', 'animation-delay': '0.1s' }, 13 | }, 14 | backwards: { 15 | old: { 'transform-origin': 'top center' }, 16 | new: { 'transform-origin': 'top center', 'animation-delay': '0.1s' }, 17 | }, 18 | }, 19 | }); 20 | --- 21 | 22 |
23 | ... 24 |
25 | ``` 26 | -------------------------------------------------------------------------------- /src/mdx/animations/zoom1.mdx: -------------------------------------------------------------------------------- 1 | ```astro title="Zoom1.astro" 2 | --- 3 | import { zoom } from "astro-vtbot/animations/zoom"; 4 | --- 5 |
6 | ... 7 |
8 | ``` 9 | -------------------------------------------------------------------------------- /src/mdx/animations/zoom2.mdx: -------------------------------------------------------------------------------- 1 | ```astro title="Zoom2.astro" 2 | --- 3 | import { customZoom } from "astro-vtbot/animations/zoom"; 4 | import AnimationStyle from "astro-vtbot/animations/AnimationStyle.astro"; 5 | 6 | const zoom2Scope = customZoom('zoom2', { 7 | keyframes: { scale: { forwardOut: 0, backwardIn: 0 } }, 8 | }); 9 | --- 10 | 11 |
12 | ... 13 |
14 | ``` 15 | -------------------------------------------------------------------------------- /src/mdx/animations/zoom3.mdx: -------------------------------------------------------------------------------- 1 | ```astro title="Zoom3.astro" 2 | --- 3 | import { customZoom } from "astro-vtbot/animations/zoom"; 4 | import AnimationStyle from "astro-vtbot/animations/AnimationStyle.astro"; 5 | 6 | const zoom3Scope = customZoom('zoom3', { 7 | keyframes: { scale: { forwardOut: 0, backwardIn: 0 } }, 8 | base: { duration: '0.3s', easing: 'cubic-bezier(.16,.73,.05,1.52)' }, 9 | extensions: { 10 | forwards: { new: { 'animation-delay': '0.2s' } }, 11 | backwards: { new: { 'animation-delay': '0.2s' } }, 12 | }, 13 | }); 14 | --- 15 | 16 |
17 | ... 18 |
19 | ``` 20 | -------------------------------------------------------------------------------- /src/mdx/components.mdx: -------------------------------------------------------------------------------- 1 |

2 | Reusable Components 3 |

4 | 5 | The reusable components of the Bag of Tricks are published on [npm](https://www.npmjs.com/package/astro-vtbot). Install the node module in your astro project with **`npm install astro-vtbot`** or [install as an Astro integration!](/library/Installation/). The package is small because it only contains these reusable components, but not the examples and documentation pages. You can find the examples, documentation and technical demos on [github](https://www.github.com/martrapp/astro-vtbot). Furthermore, the Bag of Tricks is not a library that you load completely into the browser, but a collection of independent components. You can use/load just the ones you need. 6 | 7 | 23 | -------------------------------------------------------------------------------- /src/mdx/demos.mdx: -------------------------------------------------------------------------------- 1 | import BoT from '/src/components/BoT.astro' 2 | 3 | The provides components that demonstrate Astro's View Transition API. Some of these are technical demos, some are useful tools, and some will evolve into reusable components that you can use in your own project to handle edge cases that go beyond Astro's standard features. The code of the Bag of Tricks is on [github:martrapp/astro-vtbot](https://github.com/martrapp/astro-vtbot) 4 | 5 | -------------------------------------------------------------------------------- /src/mdx/hero-prefetch/overview.mdx: -------------------------------------------------------------------------------- 1 | ```javascript title="hero-prefetch.js" 2 | document.addEventListener('astro:before-preparation', e => { 3 | 4 | if (e.from.href.endsWith('/overview/')) { 5 | const originalLoader = event.loader; 6 | event.loader = async () => { 7 | await originalLoader(); 8 | const img = new Image(); 9 | img.src = event.newDocument.querySelector('img[class*="hero"]').src; 10 | await new Promise((resolve) => { 11 | img.onload = img.onerror = resolve 12 | }); 13 | }; 14 | } 15 | }); 16 | ``` 17 | -------------------------------------------------------------------------------- /src/mdx/loading/one.mdx: -------------------------------------------------------------------------------- 1 | 2 | # Pocycli! 3 | ## Pocycli = Publish or contribute [your custom](/library/LoadingIndicator/#Pocycli) loading indicator! 4 | 5 | - ProgressBar based on swup's Progress Bar Plugin. 6 | Idea by [@kb](https://github.com/k16e-me) 7 | - An alternative styling for the same component 8 | 9 | There is still plenty of free space here. How about contributing your own idea? 10 | - [your-idea](/library/LoadingIndicator/#Pocycli) contributed by [https://github.com/<your-name>](https://github.com/) 11 | -------------------------------------------------------------------------------- /src/mdx/loading/two.mdx: -------------------------------------------------------------------------------- 1 | 2 | ### Coding 3 | 4 | The loading indicator you see in the top right corner on this page is the default loading indicator of the 👜 Bag of Tricks ✨. 5 | It is automatically activated if you install astro-vtbot as an astro integration. 6 | 7 | The default icon that is displayed is the favicon of the current page. 8 | Of course, you can tweak the look & feel of the <LoadingIndicator/> component to your liking. 9 | 10 | If you want to know what happens behind the scenes, here is a rough sketch of the code that is used to display a loading indicator if you use the reusable `` component or the TypeScript pendant `loading-indicator.ts`: 11 | 12 | ```javascript title="loading-indicator.js" 13 | document.addEventListener(TRANSITION_PAGE_LOAD, doInit); // optional: dynamically setup the indicator 14 | document.addEventListener(TRANSITION_BEFORE_PREPARATION, doShow); // show the indicator 15 | document.addEventListener(TRANSITION_BEFORE_SWAP, doHide); // hide the indicator 16 | ``` 17 | -------------------------------------------------------------------------------- /src/mdx/morph/three.mdx: -------------------------------------------------------------------------------- 1 | ```astro title="Layout.astro" 2 | ... 3 | 29 | ``` 30 | -------------------------------------------------------------------------------- /src/mdx/no-reset/four.mdx: -------------------------------------------------------------------------------- 1 | ```javascript title="no-reset.js" 2 | document.addEventListener('astro:before-swap', ev => { 3 | 4 | const pathname=ev.from.pathname; 5 | if (pathname.endsWith('/no-reset/two/') 6 | || pathname.endsWith('/no-reset/three/') 7 | || pathname.endsWith('/no-reset/four/') 8 | ) { 9 | ev.swap = () => { 10 | ev.newDocument.querySelectorAll('[data-swap]').forEach(el => { 11 | document.querySelector(`[data-swap="${el.dataset.swap}"]`)?.replaceWith(el); 12 | }); 13 | }; 14 | } 15 | }); 16 | ``` 17 | -------------------------------------------------------------------------------- /src/mdx/winter/one.mdx: -------------------------------------------------------------------------------- 1 | # Winter Demo 2 | 3 | This demo features multiple transition groups and a custom animation that plays after the navigation starts right before the transition. 4 | 5 | Chop down that tree or push the snowboarder! 6 | -------------------------------------------------------------------------------- /src/pages/0.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Gallery from '../components/Gallery.astro'; 3 | --- 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/pages/animations/one.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | layout: ../../layouts/AnimationMdxLayout.astro 3 | title: Welcome to My Website 4 | --- 5 | 6 | 7 | # Welcome to My Website 8 | 9 | ![sample picture](https://picsum.photos/300/400.webp?grayscale&blur=1) 10 | 11 | 12 | This is the first page of a sample website. \ 13 | For more information about the team, [click here](../two/). 14 | 15 | 16 | 17 | ## About Us 18 | 19 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. 20 | 21 | 22 | ## Our Services 23 | 24 | - Web Development 25 | - App Development 26 | - Digital Marketing 27 | 28 | -------------------------------------------------------------------------------- /src/pages/animations/two.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | layout: ../../layouts/AnimationMdxLayout.astro 3 | title: Our Team 4 | --- 5 | 6 | # Our Team 7 | 8 | ![sample picture](https://picsum.photos/300/400.webp?grayscale&blur=1) 9 | 10 | 11 | Stay tuned for more updates about our team and services. If you have any questions, feel free to [click here](../one/). 12 | 13 | Welcome back to our website! Let's introduce you to our dedicated team. 14 | 15 | 16 | ## John Doe 17 | 18 | John is our lead web developer. He has over 10 years of experience in the field and specializes in JavaScript and Python. 19 | 20 | Jane is our app development expert. She has a knack for designing user-friendly interfaces and has a deep understanding of Swift and Kotlin. 21 | 22 | ## Mary Johnson 23 | 24 | Mary heads our digital marketing team. She has a proven track record of successful SEO and social media campaigns. 25 | 26 | -------------------------------------------------------------------------------- /src/pages/carousel/four.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import CarouselLayout from 'src/layouts/CarouselLayout.astro'; 3 | --- 4 | 5 | 11 |

12 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Aut sed praesentium alias quod tenetur? 13 | Reiciendis expedita rem repellat unde aperiam laborum quos fugiat ipsam et dignissimos. 14 | Repellendus aspernatur aliquam facilis? 15 |

16 |
17 | -------------------------------------------------------------------------------- /src/pages/carousel/one.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import CarouselLayout from 'src/layouts/CarouselLayout.astro'; 3 | --- 4 | 5 | 11 |

This page demonstrates several techniques:

    12 |
  • 13 | Mixing normal navigation links with links that call the history.back() and history.go() history functions. 16 |
  • 17 | Accessing properties of the navigations source element to distinguish between navigations 18 | initiated by Previous and Next 19 |
  • 20 | Deriving the direction of the view transition from comparing the current values of event.from and event.to 23 |
  • 24 |
  • 25 | Adding intermediate history states when selecting Previous on the first entry 26 |
  • 27 |
  • 28 | Setting the value of event.to to redirect ot a different page. 29 |
  • 30 |
31 |

32 | Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatum sint temporibus quo quaerat 33 | quam adipisci. Quibusdam, doloribus dolorem. Provident ut dolore, necessitatibus aut minus 34 | impedit. Neque corrupti sit doloremque maxime? 35 |

36 |
37 | 42 | -------------------------------------------------------------------------------- /src/pages/carousel/three.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import CarouselLayout from 'src/layouts/CarouselLayout.astro'; 3 | --- 4 | 5 | 11 |

12 | Lorem ipsum, dolor sit amet consectetur adipisicing elit. Cupiditate tempore soluta vel 13 | molestiae facilis deserunt possimus fugiat dignissimos dolorum earum saepe sed consectetur iusto 14 | voluptatibus omnis aspernatur, reprehenderit qui voluptate? 15 |

16 |
17 | -------------------------------------------------------------------------------- /src/pages/carousel/two.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import CarouselLayout from 'src/layouts/CarouselLayout.astro'; 3 | --- 4 | 5 | 11 |

12 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Temporibus quia recusandae asperiores 13 | veritatis provident saepe expedita cum nostrum labore praesentium officia accusantium suscipit 14 | nam nihil hic, doloribus repudiandae porro neque! 15 |

16 |
17 | -------------------------------------------------------------------------------- /src/pages/docs/Jotter.astro: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/pages/fish-pond/center.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import FishPondLayout from 'src/layouts/FishPondLayout.astro'; 3 | --- 4 | 5 | 6 |

This is the Center

7 | 8 |
9 | 10 | 14 | 15 |
16 |

17 | This demo shows different directions on the same page. Use the back navigation of the browser to 18 | go in the opposite direction and finally exit this demo back to the main page. 19 |

20 | 29 |
30 | -------------------------------------------------------------------------------- /src/pages/fish-pond/east.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import FishPondLayout from 'src/layouts/FishPondLayout.astro'; 3 | --- 4 | 5 | 6 |

This is East

7 |
8 | 9 | 13 | 14 |
15 |
16 | -------------------------------------------------------------------------------- /src/pages/fish-pond/index.astro: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/pages/fish-pond/north.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import FishPondLayout from 'src/layouts/FishPondLayout.astro'; 3 | --- 4 | 5 | 6 |

This is North

7 | 10 |
11 | -------------------------------------------------------------------------------- /src/pages/fish-pond/south.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import FishPondLayout from 'src/layouts/FishPondLayout.astro'; 3 | --- 4 | 5 | 6 |

This is South

7 | 10 |
11 | -------------------------------------------------------------------------------- /src/pages/fish-pond/west.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import FishPondLayout from 'src/layouts/FishPondLayout.astro'; 3 | --- 4 | 5 | 6 |

This is West

7 |
8 | 9 | 13 | 14 |
15 |
16 | -------------------------------------------------------------------------------- /src/pages/hero-prefetch/hero.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from 'src/layouts/Layout.astro'; 3 | --- 4 | 5 | 6 |

Hero / Back

7 | Hero 10 |
11 | 18 | -------------------------------------------------------------------------------- /src/pages/hero-prefetch/heroine.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from 'src/layouts/Layout.astro'; 3 | --- 4 | 5 | 6 |

Heroine / Back

7 | Heroine 10 |
11 | 18 | -------------------------------------------------------------------------------- /src/pages/iframes/_RocketLayout.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import rocketCSS from './_rocket.css?url'; 3 | import outlineCSS from './_outline.css?url'; 4 | const { pg, kind, outline, theme } = Astro.params; 5 | const duration = 6 | kind === 'plain' && outline === 'no' 7 | ? '250ms' 8 | : kind === 'fancy' && outline === 'yes' 9 | ? '3s' 10 | : '2s'; 11 | --- 12 | 13 | 14 | 15 | 16 | Page {pg} 17 | 18 | 19 | 34 | 35 | {kind === 'fancy' ? : ''} 36 | {outline === 'yes' ? : ''} 37 | 64 | 65 | 66 |
67 | 68 |
69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/pages/iframes/_outline.css: -------------------------------------------------------------------------------- 1 | 2 | ::view-transition { 3 | outline: 1vmin solid darkred; 4 | } 5 | ::view-transition-group(*) { 6 | outline: 1vmin dotted darkgoldenrod; 7 | } 8 | ::view-transition-image-pair(*) { 9 | outline: 1vmin dotted darkgray; 10 | } 11 | ::view-transition-old(*) { 12 | outline: 1vmin dashed darkslateblue; 13 | } 14 | ::view-transition-new(*) { 15 | outline: 1vmin dashed darkolivegreen; 16 | } 17 | -------------------------------------------------------------------------------- /src/pages/iframes/rocket-[kind]-[outline]-[theme]-2.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from './_RocketLayout.astro'; 3 | 4 | export async function getStaticPaths() { 5 | return [ 6 | { params: { kind: 'plain', outline: 'no', theme: 'light' } }, 7 | { params: { kind: 'plain', outline: 'no', theme: 'dark' } }, 8 | { params: { kind: 'plain', outline: 'yes', theme: 'light' } }, 9 | { params: { kind: 'plain', outline: 'yes', theme: 'dark' } }, 10 | { params: { kind: 'fancy', outline: 'no', theme: 'light' } }, 11 | { params: { kind: 'fancy', outline: 'no', theme: 'dark' } }, 12 | { params: { kind: 'fancy', outline: 'yes', theme: 'light' } }, 13 | { params: { kind: 'fancy', outline: 'yes', theme: 'dark' } }, 14 | ]; 15 | } 16 | const { kind, outline, theme } = Astro.params; 17 | // @ts-ignore 18 | Astro.params["pg"] = 2; 19 | 20 | --- 21 | 22 | 23 | 🚀 24 | Back to Base... 25 | 26 | 44 | 45 | -------------------------------------------------------------------------------- /src/pages/iframes/rocket-[kind]-[outline]-[theme].astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from './_RocketLayout.astro'; 3 | 4 | 5 | export async function getStaticPaths() { 6 | return [ 7 | { params: { kind: 'plain', outline: 'no', theme: 'light' } }, 8 | { params: { kind: 'plain', outline: 'no', theme: 'dark' } }, 9 | { params: { kind: 'plain', outline: 'yes', theme: 'light' } }, 10 | { params: { kind: 'plain', outline: 'yes', theme: 'dark' } }, 11 | { params: { kind: 'fancy', outline: 'no', theme: 'light' } }, 12 | { params: { kind: 'fancy', outline: 'no', theme: 'dark' } }, 13 | { params: { kind: 'fancy', outline: 'yes', theme: 'light' } }, 14 | { params: { kind: 'fancy', outline: 'yes', theme: 'dark' } }, 15 | ]; 16 | } 17 | const { kind, outline, theme } = Astro.params 18 | // @ts-ignore 19 | Astro.params["pg"] = 1; 20 | --- 21 | 22 | 23 | 🚀 24 | Level Up! 25 | 26 | 43 | 44 | -------------------------------------------------------------------------------- /src/pages/iframes/vtdemo2-[theme].astro: -------------------------------------------------------------------------------- 1 | --- 2 | import VtDemo from './vtdemo-[theme].astro'; 3 | 4 | export async function getStaticPaths() { 5 | return [{ params: { theme: 'light' } }, { params: { theme: 'dark' } }]; 6 | } 7 | --- 8 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /src/pages/iframes/vtdemo3-[theme].astro: -------------------------------------------------------------------------------- 1 | --- 2 | import VtDemo from './vtdemo-[theme].astro'; 3 | 4 | export async function getStaticPaths() { 5 | return [{ params: { theme: 'light' } }, { params: { theme: 'dark' } }]; 6 | } 7 | --- 8 | 9 | 10 | 18 | -------------------------------------------------------------------------------- /src/pages/iframes/vtdemo4-[theme].astro: -------------------------------------------------------------------------------- 1 | --- 2 | import VtDemo from './vtdemo-[theme].astro'; 3 | 4 | export async function getStaticPaths() { 5 | return [{ params: { theme: 'light' } }, { params: { theme: 'dark' } }]; 6 | } 7 | --- 8 | 9 | 10 | 18 | -------------------------------------------------------------------------------- /src/pages/iframes/vtscroll1-[duration]-[theme].astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from '../../layouts/iframes/vtscrollLayout.astro'; 3 | 4 | export async function getStaticPaths() { 5 | return [ 6 | { params: { theme: 'light', duration: '0s' } }, 7 | { params: { theme: 'dark', duration: '0s' } }, 8 | { params: { theme: 'light', duration: '2s' } }, 9 | { params: { theme: 'dark', duration: '2s' } }, 10 | { params: { theme: 'light', duration: '0' } }, 11 | { params: { theme: 'dark', duration: '0' } }, 12 | ]; 13 | } 14 | const { theme, duration } = Astro.params; 15 | const opt = duration === '0' ? true : undefined; 16 | --- 17 | 18 | 19 |
Top of Page 1
20 |
21 | –
22 | — 01
23 | –
24 | — 02
25 | –
26 | — 03
27 | –
28 | — 04
29 | –
30 | — 05
31 | –
32 | — 06
33 | –
34 | — 07
35 | –
36 | — 08
37 | –
38 | — 09
39 | –
40 | — 10
41 | –
42 | — 11
43 | –
44 | — 12
45 | –
46 | — 13
47 |
48 |
49 | Scroll down,
then...

Go to Page 2 53 |
54 |
Bottom of Page 1
55 |
56 | 57 | 62 | -------------------------------------------------------------------------------- /src/pages/iframes/vtscroll2-[duration]-[theme].astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Layout from '../../layouts/iframes/vtscrollLayout.astro'; 3 | 4 | export async function getStaticPaths() { 5 | return [ 6 | { params: { theme: 'light', duration: '0s' } }, 7 | { params: { theme: 'dark', duration: '0s' } }, 8 | { params: { theme: 'light', duration: '2s' } }, 9 | { params: { theme: 'dark', duration: '2s' } }, 10 | { params: { theme: 'light', duration: '0' } }, 11 | { params: { theme: 'dark', duration: '0' } }, 12 | ]; 13 | } 14 | const { theme, duration } = Astro.params; 15 | const opt = duration === '0' ? true : undefined; 16 | --- 17 | 18 | 19 |
Top of Page 2
20 |
21 | –
22 | — 01
23 | –
24 | — 02
25 | –
26 | — 03
27 | –
28 | — 04
29 | –
30 | — 05
31 | –
32 | — 06
33 | –
34 | — 07
35 | –
36 | — 08
37 | –
38 | — 09
39 | –
40 | — 10
41 | –
42 | — 11
43 | –
44 | — 12
45 | –
46 | — 13
47 |
48 | Go to Page 1 53 |
Bottom of Page 2
54 |
55 | 56 | 61 | -------------------------------------------------------------------------------- /src/pages/image-gallery/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | layout: src/layouts/GalleryMdxLayout.astro 3 | --- 4 | 5 | # Image Gallery 6 | 7 |

In the quiet whispers of the digital cosmos, Astro is a beloved tool, known and cherished by all who craft beauty from pixels. Yet, within its daily magic lies a well-kept secret known only to a select few: Astro is touted for its versatility…

8 |

…but what people really want to build with it are **image galleries**.

9 |

These visual treasures, woven with mystique and wonder, transform everyday moments into timeless tales, waiting to enchant those who discover them.

10 | 11 | [[Click me]](/image-gallery/) 12 | 13 |