I am working on a website and now I need to do the intro animation just like this http://www.elitemodel.fr/
On this website, when I load the page, the logo and backgroung are shifted to the left. My client wants this effect on his website.
I am currently creating an intro.php page with this html code:
<div class="intro">
<div class="logo-intro"></div>
</div>
<div class="black_overlay"></div>
I am trying to do this with css3 and a little javascript.
After html, this is my CSS code for the animation:
.intro,
.intro .logo-intro {
overflow: hidden;
-moz-animation: slide 2s ease 1.5s forwards;
-webkit-animation: slide 2s ease 1.5s forwards;
-o-animation: slide 2s ease 1.5s forwards;
-ms-animation: slide 2s ease 1.5s forwards;
animation: slide 2s ease 1.5s forwards;
}
@-moz-keyframes slide /* Firefox */
{
from {width: 100%; }
to {width: 0;}
}
@-webkit-keyframes slide /* Safari and Chrome */
{
from {width: 100%;}
to {width: 0;}
}
@-o-keyframes slide /* Opera */
{
from {background: white;}
to {background: black;}
}
@-ms-keyframes slide /* IE10 */
{
from {width: 100%;}
to {width: 0;}
}
@keyframes slide
{
from {width: 100%;}
to {width: 0;}
}
}
.logo-intro {
-webkit-animation: logo 1s;
-webkit-animation-iteration-count: 2;
-webkit-animation-fill-mode: forwards;
animation: logo 1s;
animation-iteration-count: 2;
animation-fill-mode: forwards;
}
@-webkit-keyframes logo {
from {top: 50%;}
to {left: -99999px;}
}
@keyframes logo {
from {top: 50%;}
to {left: -99999px;}
}
After the animation finishes, I redirect intro.php to the home page using javascript
window.setTimeout(function(){
var url = "http://www.gaelscalpaesthetics.com/accueil";
$(location).attr('href',url);
}, 4000);
This works, but how can I make this animation without redirecting?
Hello,
source
share