Awesome Page Transition Effects with jQuery and CSS3 - PageTransitions

Awesome Page Transition Effects with jQuery and CSS3 - PageTransitions
File Size: 30 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

PageTransitions is an awesome jQuery plugin for creating various page transition effects using CSS3 animations.

How to use it:

1. Markup html structure

<div id="pt-main" class="pt-perspective">
    <div class="pt-page pt-page-1">
        <h1>Title</h1>
    </div>
    <div class="pt-page pt-page-2">...</div>
    ...
</div>

2. The CSS

html, body {
height: 100%;
}
.pt-perspective {
position: relative;
width: 100%;
height: 100%;
-webkit-perspective: 1200px;
-moz-perspective: 1200px;
perspective: 1200px;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.pt-page {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
visibility: hidden;
overflow: hidden;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
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;
}
/* Text Styles, Colors, Backgrounds */

.pt-page h1 {
position: absolute;
font-weight: 300;
font-size: 4.4em;
line-height: 1;
letter-spacing: 6px;
margin: 0;
top: 12%;
width: 100%;
text-align: center;
text-transform: uppercase;
word-spacing: -0.3em;
}
.pt-page h1 span {
font-family: 'Satisfy', serif;
font-weight: 400;
font-size: 40%;
text-transform: none;
word-spacing: 0;
letter-spacing: 0;
display: block;
opacity: 0.4;
}
.pt-page h1 strong {
color: rgba(0,0,0,0.1);
}
.pt-page-1 {
background: #0ac2d2;
}
.pt-page-2 {
background: #7bb7fa;
}
.pt-page-3 {
background: #60d7a9;
}
.pt-page-4 {
background: #fdc162;
}
.pt-page-5 {
background: #fd6a62;
}
.pt-page-6 {
background: #f68dbb;
}
/* Triggers (menu and button) */

.pt-triggers {
position: absolute;
width: 300px;
z-index: 999999;
top: 12%;
left: 50%;
margin-top: 130px;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
}
.no-js .pt-triggers {
display: none;
}
.pt-triggers .dl-menuwrapper button, .pt-touch-button {
border: none;
font-size: 13px;
font-weight: 700;
text-transform: uppercase;
margin: 10px 0 20px;
padding: 0px 20px;
line-height: 50px;
height: 50px;
letter-spacing: 1px;
width: 100%;
cursor: pointer;
display: block;
font-family: 'Lato', Calibri, Arial, sans-serif;
box-shadow: 0 3px 0 rgba(0,0,0,0.1);
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.pt-touch-button {
background: #fff;
color: #aaa;
}
.pt-triggers .dl-menuwrapper button {
margin-bottom: 0;
}
.pt-touch-button:active {
box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}
.touch .pt-triggers .dl-menuwrapper {
display: none;
}
.pt-message {
display: none;
position: absolute;
z-index: 99999;
bottom: 0;
left: 0;
width: 100%;
background: #da475c;
color: #fff;
text-align: center;
}
.pt-message p {
margin: 0;
line-height: 60px;
font-size: 26px;
}
.no-cssanimations .pt-message {
display: block;
}
 @media screen and (max-width: 47.4375em) {
.pt-page h1 {
font-size: 3em;
}
.pt-triggers .dl-menuwrapper {
display: none;
}
}
 @media screen and (max-height: 45.9em) {
.pt-triggers .dl-menuwrapper li a {
padding-top: 2px;
padding-bottom: 2px;
}
.pt-triggers .dl-menuwrapper li.dl-back:after, .dl-menuwrapper li > a:not(:only-child):after {
line-height: 24px;
}
}
 @media screen and (max-height: 38em) {
.pt-triggers .dl-menuwrapper {
display: none;
}
}

3. Include jQuery library and PageTransitions plugin on your web page

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/jquery.dlmenu.js"></script>

This awesome jQuery plugin is developed by PEDRO BOTELHO. For more Advanced Usages, please check the demo page or visit the official website.