Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: View Transition hook #7237

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

GrandSchtroumpf
Copy link
Contributor

@GrandSchtroumpf GrandSchtroumpf commented Jan 9, 2025

What is it?

  • Feature / enhancement

Description

Emit an event when view transition start with the ViewTransition object in the detail.
Fix QwikDev/qwik-evolution#135

The goal is to hook into the view transition process to create animation in with JS :

useDocument('qviewTransition', $(async (event: CustomEvent<ViewTransition>) => {
  const transition = event.detail;
  await transition.ready; // Wait for ::view-transition-old pseudo class to exist
  document.documentElement.animate([
    // keyframes
  ], {
    pseudoElement: `::view-transition-old(.cards)::only-child`,
  })
}))

Checklist

  • My code follows the developer guidelines of this project
  • I performed a self-review of my own code
  • I added a changeset with pnpm change
  • I made corresponding changes to the Qwik docs

@GrandSchtroumpf GrandSchtroumpf requested review from a team as code owners January 9, 2025 20:19
Copy link

changeset-bot bot commented Jan 9, 2025

🦋 Changeset detected

Latest commit: f583ec9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@builder.io/qwik Patch
eslint-plugin-qwik Patch
@builder.io/qwik-city Patch
create-qwik Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Jan 9, 2025

Open in Stackblitz

npm i https://pkg.pr.new/@builder.io/qwik@7237
npm i https://pkg.pr.new/@builder.io/qwik-city@7237
npm i https://pkg.pr.new/eslint-plugin-qwik@7237
npm i https://pkg.pr.new/create-qwik@7237

commit: 25eed2b

Copy link
Contributor

github-actions bot commented Jan 9, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview f583ec9

@GrandSchtroumpf GrandSchtroumpf changed the title View Transition hook feat: View Transition hook Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant