Page Transition Experiment

I created this page transition experiment using 2 custom interactions and some classes to create the effect.

CleanShot 2025-02-24 at 16.48.10

How it works

This first interaction is added to the page load event.

This interaction does the following:

  1. Removes a class (page-start) from the page body that initially forces the page to be transformed and hidden.

  2. It then adds a class to revert that and animate the page in (page-fadein).

  3. It then adds a pause (2 seconds) in order to let the CSS animation complete.

  4. After the pause it removes the animation class as it is no longer needed.

The button on this page is connected to a custom interaction, so when it’s clicked it goes to another page.

The button also has a custom attribute assigned, this will be used by the custom interaction thanks to the new data() short code. Note that it’s a page url.

When this button is clicked it will trigger the Navigate to Page custom Interaction. This interaction does the following.

  1. Add a class (page-fadeout) to the page body to animate the fade out using CSS transform and transition.
  2. There is a pause of 1 second to allow the animation to complete.
  3. Then a navigate to URL rule is used that uses the data() short code to get the target url from the button (via its data attribute)

The destination page uses the exact same custom interactions on page load and button click, the only difference is the button on the second page has a different data attribute to lead back to the home page.

This experiment requires Blocs for Mac 6.1.

You can download it here :point_down:

Fade in out Page load experiment.bloc.zip (1.3 MB)

Have fun :grin:

9 Likes

Awesome stuff!

2 Likes

It’s fantastic that we can create something like that using Customer Interactions. However, I still hope that Page Transition bric will remain updated and enhanced, as it has become one of my most frequently used brics (which I highly recommend to all users).

3 Likes

Yeah we have a big update planned for it later this year.

2 Likes

I really like it.

Pretty cool :sunglasses:

1 Like

Super Duper! Top marks to the Whitley Bay Massive. Interactions and evolving development is really making Blocs stand out. Ace!

2 Likes

Looks like this could be the first post in

@Norm

This is great Norm! So far I haven’t been able to do much with custom interactions unless I visit the forum. I like what you did and I’m really looking for more interactions and transitions between elements but a bit lost still without tutorials so thank you. Wish it was more simple to achieve what you did but baby steps. I get it.

I would recommend downloading the project and playing around with it. I find learning often comes from breaking :rofl:

It helps you understand how it works.

I’ll be posting some fresh experiments tomorrow in the lab so check back soon for more learning.

p.s. We also have new tutorial videos in the pipeline for custom interactions.

5 Likes