From our sponsor: Meco is a distraction-free space for reading and discovering newsletters, separate from the inbox.
Today we’d like to share a collection of creative page transitions with you. We’ve put together a couple of animations that could be applied to “pages” for creating interesting navigation effects when revealing a new page. While some effects are very simplistic, i.e. a simple slide movement, others make use of perspective and 3d transforms to create some depth and dynamics.
Please note that this is just for showcasing some interesting effects and for inspiration. It is not a slider or anything like that. We’ll just apply some classes to make the page transition visible, not for navigating.
The CSS animations are divided into different sets, depending on what they do.
For showcasing the page transitions, we’ve used the following structure:
<div id="pt-main" class="pt-perspective"> <div class="pt-page pt-page-1"> <h1><span>A collection of</span><strong>Page</strong> Transitions</h1> </div> <div class="pt-page pt-page-2"><!-- ... --></div> <!-- ... --> </div>
The perspective container is relative and we add a perspective of 1200px to it. The following styles are needed for all animations to work:
.pt-perspective { position: relative; width: 100%; height: 100%; perspective: 1200px; transform-style: preserve-3d; } .pt-page { width: 100%; height: 100%; position: absolute; top: 0; left: 0; visibility: hidden; overflow: hidden; backface-visibility: hidden; transform: translate3d(0, 0, 0); } .pt-page-current, .no-js .pt-page { visibility: visible; } .no-js body { overflow: auto; } .pt-page-ontop { z-index: 999; }
The .pt-page-ontop
is used for some of the page transitions where we need one of the pages to stay on top of the other one.
Tiny break: 📬 Want to stay up to date with frontend and trends in web design? Subscribe and get our Collective newsletter twice a tweek.
An example for animation classes and keyframe animations are the following ones that scale the pages in different directions and fade them in or out:
/* scale and fade */ .pt-page-scaleDown { animation: scaleDown .7s ease both; } .pt-page-scaleUp { animation: scaleUp .7s ease both; } .pt-page-scaleUpDown { animation: scaleUpDown .5s ease both; } .pt-page-scaleDownUp { animation: scaleDownUp .5s ease both; } .pt-page-scaleDownCenter { animation: scaleDownCenter .4s ease-in both; } .pt-page-scaleUpCenter { animation: scaleUpCenter .4s ease-out both; } /************ keyframes ************/ /* scale and fade */ @keyframes scaleDown { to { opacity: 0; transform: scale(.8); } } @keyframes scaleUp { from { opacity: 0; transform: scale(.8); } } @keyframes scaleUpDown { from { opacity: 0; transform: scale(1.2); } } @keyframes scaleDownUp { to { opacity: 0; transform: scale(1.2); } } @keyframes scaleDownCenter { to { opacity: 0; transform: scale(.7); } } @keyframes scaleUpCenter { from { opacity: 0; transform: scale(.7); } }
For the purpose of this demonstration we apply the respective animation classes to the current page and the incoming one. For example:
//... case 17: outClass = 'pt-page-scaleDown'; inClass = 'pt-page-moveFromRight pt-page-ontop'; break; case 18: outClass = 'pt-page-scaleDown'; inClass = 'pt-page-moveFromLeft pt-page-ontop'; break; case 19: outClass = 'pt-page-scaleDown'; inClass = 'pt-page-moveFromBottom pt-page-ontop'; break; // ...
Check out the demo where you can simply iterate through the whole set of page transitions using the first button. You can also choose a specific effect from the drop-down menu.
I hope you enjoy this and get inspired to build some exciting things!
Hi Stan,
Could I also please ask for your code?
really interested to get this working,
Thanks in advance
benjamin.t.pattison@gmail.com
Hi Stan,
I would appreciate it if you could also send your code, apologies for being another on the list.
I love this transition package and want to merge it with my existing layout, but I need the gotoPage(n) function for the main navigation menu.
Thank you for offering to share 🙂
My email is jake {at} jakecleveland {dot} com – thanks again!
please forward that code to mz@gyvenujav.com, appreciate that !
Hey Stan, enjoy your work very much, would you ming sending me a copy too? lixiangstar@gmail.com
Is this the same kind of effect that is used in this web page? Not rollover, but once you clicked the button.
http://mlbcreative.com/work/
Stan could you send me the code?
osedesignweb@gmail.com
thank you
I love it! Très inspirant…
salut stan pouvez vous m envoyer votre code s’il vous plait merci . voici mon email : wana@c4.fr
Hey Stan you send me the code?
Thanks!!!
reginaldo.faria@mgb.com.br
hi stan, can you send me your code if you please thank you. here is my email: wana@c4.fr
Stan,
Thanx for the great work. Could you send me the code?
Thanx in advance,
Lennard
To lennardkruseman@gmail.com please,
Mail me now
Cheer!
Hello great tutorial , I have a question – pls help. I get the zip file open html and all other files.
I want to use “pt-page-moveToTop” effect and del all rest of un needed info. Where to attached this class? Can someone just point me.
Thx
please thank you a tutorial for specific button
Hi Stan,
I’ve been trying to implement your brilliant code, but getting stuck on function gotoPage(page – number). Chrome is picking up a lot of illegal tokens and so I’m trying to fix them. Could you please email a copy of your working code? Thanks in advance!
mjszone@yahoo.ca
Hi Stan,
Could you send me your code as well? Hopefully in a zip with supporting files so I can see how it works. Particularly I’m trying to get it to work with transitioning to specific pages. Thanks!
jlee@gyver.com
try with this : function gotoPage(pageNumber)
Issue is the – between page and number (page-number), it doesnt work :d
I put a new comment on page 8, take a look
Hi Stan!
Thanx for the code! Aaaaaand could you please send me also the code for specific page? :))))
Thanx in advance,
Ana
woops. my comment got messed up and didn’t show up until I posted again…. sorry.
@Pedro Botelho
Great Tutorial and sample code.
I was trying to integrate some of the transition in my project but still not able to integrate it. Can you be more specific how to do a specific transition on a specific page.
@Stan
I’d love to see your code for targeting specific pages. It would be highly helpful if you can mail me the sample
My email jobin (at) fafadiatech (dot) com
Hey Stan,
Could you send me the code at: contact (at) mpasierb (dot) com
Regards,
-Mark
Has anybody had any luck with implementing this into their/a site yet I’d love to be able to just do a simple button to implement a transition to another page but cant for the life of me understand the js files 🙁
Hi Stan!
Could you email me the code to go to a specific page?
k.deargh@gmail.com
Thanks you!
Is it possible to go back to the previous page ?
change the ‘++current’ to ‘–curent’
is there a way to make a youtube video autoplay after transitioning to the page that contains it?
I currently have two pages, the second one has a youtube video that autoplays upon page load.
Hi Stan!
Could you email me your code to so I can make it go to specific pages? I am in urgent need of this.
taru.agarwal.03@gmail.com
Thanks you!
Guys, I’ve configured Stans code, if you couldn’t and need help hit me on seif.sayed@gmail.com.
Anyone got to figure out how to go to previous page?
Thank you for your response to this solution, specific page, I’ll finally be able to continue working.
Hi all, this is really nice work. I try to make it as AUTOPLAY. Can anybody help!?
Hi Stan!
Could you email me your code to so I can make it go to specific pages?
emma-sweeney@hotmail.com
Thanks you!
Please!
Could you email me your code to so I can make it go to specific pages?
joselm65@gmail.com
Thanks Stan!!
Hi, you are awesome! But I have a question: how I can make something like navigation? Some liste where I have href’s to go to specifik pages? Please help me! My mail: przemyslaw.proszowski@zhp.net.pl
Hey, does anyone know how to get the buttons resizing with the browser?. Its parked on the page and won’t move, i tried a few different things, but it appears something is keeping it glued there and i can’t shift it. Any ideas?
Hi,
could somebody please give me hint how I to trigger those effects automatically onLoad of the page?
Thanks
Hi,
You can take a look at https://github.com/icodebuster/transition.js/issues/10 on how to load transitions animation on page load.
Thank you,
Hi thanks a lot for sharing your work!
Could you help me to code to go to specific pages in navigation menu?
Best!
Please, email me example (blackzero.rs@gmail.com) with commands to call transition with separate buttons. Example: onClick -> Button 1 or Button 2 = load page1.html or page2.html using some transitions. When i click some button, i want to go directrly to that page using transition effects… Sorry for my bad English… Many, many Thanks! 🙁
Hi is there any way I can get the code for Page Transitions with accualy redirect to another page.. From home to contact and so on…
please send me the code if available to stavrosazar@gmail.com.
Kind Regards.
This is what I’d like to know as well. Could you email me as well with the solution?
mikemelchiot@gmail.com
how to make auto animation, instead of onclick.
Hello, okay?
I loved his work, I need to make an example like yours, but it should direct to specific pages.
Can you help me how to do it?
My email dirce_bologna@hotmail.com
Thank you
Hi guys didn’t found yet how to redirect to a specific page… This is a great work, but still I need some help with redirecting..
If you have a sample code how to go about doing that, please email the code at stavrosazar@gmail.com
kind regards
I share the last post of Jobin page5, and this is great and very useful. Everything works if you want to implement some code to go to specific pages, all is here on github!!
Please take a look at
https://github.com/icodebuster/transition.js
I have added the following features
– Next page transition
– Previous page transition
– Go to a particular page
– Add custom animation
– Add a list of animation to be played randomly
Thank’s Jobin!!
Hi there, i’m kind of new to all of this.
Is there a tutorial on how to add page transitions to an existing html5 website ? If not, what do i have to do to create these transitions for an existing site ?
Regards
Hello,
I was looking at this but I would like to know if there is any possibility to do the same but going to anoter html, from one html to another.
Is it possible?
Thanks!
This is what I’d like to know as well.
Amazing work people! Really. I’m a newbie and I really can’t figure out how to apply any of the transitions from the current page to a new page. For example if i’m now in “main.html” and i want to go to “people.html” by using the Flip right transition how do i like the “people.html” page? I just see <a href=”#” rel=”nofollow”> and if i change the # nothing happens… Thanks in advance.
Hi,
Just a quick question.
Is it possible to use Page Transitions on WordPress?
And if yes, how to implement it?
Thanks in advance.
Philippe
Hi Philippe,
I was wondering if you figured out how to use the Page Transitions on WordPress? Going from page to page or however. Please let me know if you did it would be greatly appreciated.
I would like to use these Page transitions but I don’t want to depend on jQuery – is that possible?
If not, what exactly is the jQuery file contributing, for what is it used?
I have mention that I’m using the code from here: https://github.com/icodebuster/transition.js
Hey Tobias,
I turned it into an object so I can use it in other areas, as well as in itself. You can see the main differences to use strictly javascript thought
currPage.classList.add(outClass);
currPage.addEventListener(animEndEventName, function(){
currPage.removeEventListener(animEndEventName, arguments.callee, false);
that.endCurrPage = true;
if (that.endNextPage) {
that.onEndAnimation(currPage, next_page ,current, page);
}
});
next_page.classList.add(inClass);
next_page.addEventListener(animEndEventName, function(){
next_page.removeEventListener(animEndEventName, arguments.callee, false);
that.endNextPage = true;
if (that.endCurrPage) {
that.onEndAnimation(currPage, next_page ,current, page);
}
});
Hi amrit,
Could you share where and how do you use the code you mention without using jquery?
Stan, could you send me your files?
I’m at sjogren@swipnet.se
What I’m missing here is a way to have every landing-page (class=”pt-page pt-page-1″) contain a button-link (class=”pt-trigger”) to another landing-page.
Hi there,
I downloaded the files and the fade transition is not working on Firefox. Should I have downloaded somewhere else?
Thank you!
Hello everyone, I didnt check comments for a while. I saw a lot of ppl asking for code to go to a specific page.
Well, I hope it will help you guyz : http://jsfiddle.net/tb2H3/
-> jquery 1.9.1.js
-> modernizr-latest.js
-> pageTransition.js
Css isnt complete, I deleted alot for my own website.
Great work, is there any way to link to a specific page through a URL? eg http://www.mydomain.co.uk/#page4
Jordan,
You can use an URL like this :
<button id="Page-Transition" class="btn" onClick="gotoPage2(3)"> PAGE 4 </button>
OR
<a href="#" id="Page-Transition" class="btn" onClick="gotoPage2(3)"> PAGE 4 </a>
You don’t need to use this : http://www.mydomain.co.uk/#page4
But if I want to give someone a URL through email. I somehow need to incorporate URL Hashing. I’m building an interactive guide for our CMS, so if i could send a link to a specific page to a client.
Is there a sample where you just have an ahref tag that links to an entirely new HTML page? and then i can try different transitions on that one link?
The source materials are a bit tough for me to just isolate one a tag and get it transition to a new HTML file.
Thanks much!!
It works nicely on your example but if you want to implement on your own page (code) , it’s more a headache than pleasure! It’s much better show little effective code snippets that can be handle it easily. It’s not a tutorial but demonstration!
not really, code is quite self-explanatory but you got to know words if you’d like to write a poem.
Hi Stan – email address: ari@tsmstudio.com
First off I love the Page Transitions. I am looking to use these transitions for external pages on a site for example a wordpress site. use cool transitions from page to page, not having all the coding on one. Is there a script you have done for that or can share? Any help would be great.
Hello.
I am a web work beginner.
I got interested in your page changes very much.
I thought that I would challenge.
however, I want to display a button only on one certain page — it thinks.
Is such a thing possible in this transition?
Please let me know.
It solved safely.
Thank you.
I think that this great transition is made surely good.
Hey this article is great, however I’ve noticed an issue with having elements that are position ‘fixed’ not behaving properly (more like position absolute). Does anyone know a possible fix to get these elements behaving properly? I don’t really want to take them out of the ‘page structure’ and manually code the transition in for these elements, feel like that could create more issues than solve them.