Technology News

Shared Element Transitions

I was just Hoping for Better Native Page Transitions, and Bramus commented that Chrome is working on something. Looks like it has some fresh enthusiasm for it, as there is a brand new repo, and you can literally test it in Chrome Canary.

The repo is moved over here, and I love the name. “Shared elements” is clutch here. It’s not just like a slide-out, slide-in, or a star wipe, it’s being able to move individual elements to new places. Shawn pointed out that Sarah’s article makes this ability super clear:

I’ll drop the code snippet from the current README here as its really cool:

function handleTransition() { document.documentTransition.prepare({ rootTransition: "reveal-left", duration: 300, sharedElements: [e1, e2, e3] }).then(() => { doCustomThings(); document.documentTransition.start({ sharedElements: [newE1, newE2, newE3] }).then( () => console.log("transition finished")); });
}

You don’t have to have sharedElements, but you can, and at the moment they all need contain: paint applied to them via CSS to work. Note that you don’t have to deal with updating the URL or anything, that would just automatically happen (I guess?) since this isn’t requiring single-page app architecture to work.

Weird History

While I was chatting about this, Alex Riviere pointed out to me that pre-Chromium Edge had (proprietary) page transitions:

<meta http-equiv="Page-Enter" content="RevealTrans(Duration=0.600, Transition=6)">

Whaaaat. Christian Schaefer has a post lamenting what we lost when we lost Trident:

As the name implies, such a filter would smoothly transition the user from page to page upon navigation, instead of having pages appear as abruptly as we are used to. There was an extensive list of transition filters you could choose from by referencing them via number:

Wipe up, wipe down, random dissolve, split horizontal out, etc. No star wipes though, incredibly. And definitely no “shared element transitions”

7 Reasons to Use a Static Site Generator
Ivorian startup Afrikrea partners with DHL and Visa to launch SaaS e-commerce platform ANKA

Related Articles

Democrats finally get their FTC majority back

democrats-finally-get-their-ftc-majority-back
It took eight months of hearings, nominations, health-related delays, and a tie-breaking vote from the vice president, but the Senate has confirmed Alvaro Bedoya as the Federal Trade Commission’s fifth…

Biggest Challenges Of Freelance Graphic Designers

Biggest Challenges Of Freelance Graphic Designers
At first glance, the profession of a graphic designer seems to be the most attractive for creative people. However, the freelancer’s path brings specific challenges you must be prepared for.…

5 Steps for Designing Successful Food Packaging

5 Steps for Designing Successful Food Packaging
When shelves are stuffed with so many similar products from different brands, packaging can be as important as the items inside. Brands generally have seven seconds to make an impression…