I have this sample:
link
CODE HTML:
<div class="quote">
<a id="dex-sign" class="play" href="http://drygiel.com" target="_blank"></a>
</div>
CODE CSS:
#dex-sign {
display: inline-block;
margin: 30px 10px 15px 10px;
width: 255px;
height: 84px;
background: url(http://drygiel.com/projects/sign/frames.png) no-repeat;
}
#dex-sign.play {
-moz-animation: sign-anim 3.5s 0.2s steps(85) forwards;
-o-animation: sign-anim 3.5s 0.2s steps(85) forwards;
-webkit-animation: sign-anim 3.5s 0.2s steps(85) forwards;
animation: sign-anim 3.5s 0.2s steps(85) forwards;
}
a#dex-sign {
opacity: .9;
}
a#dex-sign:hover {
opacity: 1;
-webkit-filter: invert(30%) brightness(80%) sepia(100%) contrast(110%) saturate(953%) hue-rotate(165deg);
}
#-webkit-keyframes sign-anim {
to {
background-position: 0 -7140px;
}
animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-webkit-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
}
#-moz-keyframes sign-anim {
to {
background-position: 0 -7140px;
}
animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-webkit-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
}
#keyframes sign-anim {
to {
background-position: 0 -7140px;
}
animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-webkit-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
}
I tried to add animation-iteration-count: infinite; But it still does not work.
With Jquery is simple but I would not use it.
Can you please tell me what I should do?Do I have to add something else to work?
Thank you in advance !
Check out working fiddle: https://jsfiddle.net/ash06229/9ybp4zkp/
I changed your CSS little bit.
#dex-sign.play {
-moz-animation: sign-anim 3.5s 0.2s steps(85) forwards;
-o-animation: sign-anim 3.5s 0.2s steps(85) forwards;
-webkit-animation: sign-anim 3.5s 0.2s steps(85) forwards;
animation: sign-anim 3.5s 0.2s steps(85) forwards;
-webkit-animation-duration: 5000ms;
animation-duration: 5000ms;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
#keyframes sign-anim {
to {
background-position: 0 -7140px;
}
}
Related
I need to create a animation that will make the dots jump one by one with delay.
How can this thing work in IE? (chrome working)
working not correct, when i press [F5]key they are working.
i don't understand why it doesn't.
test page here!
https://codepen.io/cailan/pen/GBxzPP
.txt{margin-top:50px}
.txt em{font-style:normal;font-size:50px;letter-spacing:5px;}
.txt em span {
display:inline-block;background:url('bg_dot.png') no-repeat center 3px;
padding-top:10px;font-weight:800;
animation-fill-mode: backwards;-webkit-animation-fill-mode: backwards;
}
.txt em span:nth-child(1) {
animation: dot 1.2s ease-in-out infinite alternate;
-webkit-animation:dot 1.2s ease-in-out infinite alternate;
-ms-animation: dot 1.2s ease-in-out infinite alternate;
}
.txt em span:nth-child(2) {
animation: dot 1.2s ease-in-out 0.2s infinite alternate;
-webkit-animation:dot 1.2s ease-in-out 0.2s infinite alternate;
-ms-animation: dot 1.2s ease-in-out 0.2s infinite alternate;
}
.txt em span:nth-child(3) {
animation: dot 1.2s ease-in-out 0.4s infinite alternate;
-webkit-animation:dot 1.2s ease-in-out 0.4s infinite alternate;
-ms-animation: dot 1.2s ease-in-out 0.4s infinite alternate;
}
.txt em span:nth-child(4) {
animation: dot 1.2s ease-in-out 0.6s infinite alternate;
-webkit-animation:dot 1.2s ease-in-out 0.6s infinite alternate;
-ms-animation: dot 1.2s ease-in-out 0.6s infinite alternate;
}
.txt em span:nth-child(5) {
animation: dot 1.2s ease-in-out 0.8s infinite alternate;
-webkit-animation:dot 1.2s ease-in-out 0.8s infinite alternate;
-ms-animation: dot 1.2s ease-in-out 0.8s infinite alternate;
}
#-webkit-keyframes dot {
0% { background-position:center 6px;}
42% { background-position:center top;}
45% { background-position:center 3px;}
100% { background-position:center 3px;}
}
#-ms-keyframes dot {
0% { background-position:center 6px;}
42% { background-position:center top;}
45% { background-position:center 3px;}
100% { background-position:center 3px;}
}
#-o-keyframes dot {
0% { background-position:center 6px;}
42% { background-position:center top;}
45% { background-position:center 3px;}
100% { background-position:center 3px;}
}
#keyframes dot {
0% { background-position:center 6px;}
42% { background-position:center top;}
45% { background-position:center 3px;}
100% { background-position:center 3px;}
}
<div class="txt">
<em><span>H</span><span>E</span><span>L</span><span>L</span><span>O</span>!</em>
</div>
I am trying to crossfade multiple headings to create a welcome message in three languages. I overlapped the headings and first the welcome message in englih should appear, then fade out and the italian welcome message appears, then this one fades out and the spanish message appears...and the animation repeats. Sort of like the Apple iOS welcome message in different languages. I am having trouble understanding how to manage the times of the animation in order for this to happen and the messages not to clash at the same time.
here is my code:
https://jsfiddle.net/1p7z4v0e/
<h1 class="text-animated-one">Welcome</h1>
<h1 class="text-animated-two">Benvenuti</h1>
<h1 class="text-animated-three">Bienvenidos</h1>
/* Welcome Message FadeIn Effect */
/* Keyframes */
/* Chrome */
#-webkit-keyframes fadeIn { from { opacity:0; opacity: 1\9; /* IE9 only */ } to { opacity:1; } }
/* Firefox */
#-moz-keyframes fadeIn { from { opacity:0; opacity: 1\9; /* IE9 only */ } to { opacity:1; } }
.text-animated-one, .text-animated-two, .text-animated-three {
position: absolute;
}
.text-animated-one
{
opacity:0;
-webkit-animation:fadeIn ease-in 1s infinite;
-moz-animation:fadeIn ease-in 1s infinite;
animation:fadeIn ease-in 1s infinite;
-webkit-animation-fill-mode:forwards;
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards;
-webkit-animation-duration:10s;
-moz-animation-duration:10s;
animation-duration:10s;
-webkit-animation-delay: 0.7s;
-moz-animation-delay: 0.7s;
animation-delay: 0.7s;
}
.text-animated-two
{
opacity:0;
-webkit-animation:fadeIn ease-in 20s infinite;
-moz-animation:fadeIn ease-in 20s infinite;
animation:fadeIn ease-in 20s infinite;
-webkit-animation-fill-mode:forwards;
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards;
-webkit-animation-duration:10s;
-moz-animation-duration:10s;
animation-duration:10s;
-webkit-animation-delay: 20s;
-moz-animation-delay: 20s;
animation-delay: 20s;
}
.text-animated-three
{
opacity:0;
-webkit-animation:fadeIn ease-in 20s infinite;
-moz-animation:fadeIn ease-in 20s infinite;
animation:fadeIn ease-in 20s infinite;
-webkit-animation-fill-mode:forwards;
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards;
-webkit-animation-duration:10s;
-moz-animation-duration:10s;
animation-duration:10s;
-webkit-animation-delay: 40s;
-moz-animation-delay: 40s;
animation-delay: 40s;
}
Since you are cycling between three options you can set up your animation to display for one third of the time. Then you can set the duration of all three animations to be the same and just offset the second and third animations by one third and two thirds, respectively. Here's an example on how to do this.
/* Welcome Message FadeIn Effect */
/* Keyframes */
/* Chrome */
#-webkit-keyframes fadeIn {
0% { opacity:0; opacity: 1\9; /* IE9 only */ }
33% { opacity:1; }
66% { opacity: 0 }
}
/* Firefox */
#-moz-keyframes fadeIn {
0% { opacity:0; opacity: 1\9; /* IE9 only */ }
33% { opacity:1; }
66% { opacity: 0 }
}
.text-animated-one, .text-animated-two, .text-animated-three {
position: absolute;
}
.text-animated-one
{
opacity:0;
-webkit-animation:fadeIn ease-in 9s infinite;
-moz-animation:fadeIn ease-in 9s infinite;
animation:fadeIn ease-in 9s infinite;
-webkit-animation-fill-mode:forwards;
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards;
}
.text-animated-two
{
opacity:0;
-webkit-animation:fadeIn ease-in 9s infinite;
-moz-animation:fadeIn ease-in 9s infinite;
animation:fadeIn ease-in 9s infinite;
-webkit-animation-fill-mode:forwards;
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards;
-webkit-animation-delay: 3s;
-moz-animation-delay: 3s;
animation-delay: 3s;
}
.text-animated-three
{
opacity:0;
-webkit-animation:fadeIn ease-in 9s infinite;
-moz-animation:fadeIn ease-in 9s infinite;
animation:fadeIn ease-in 9s infinite;
-webkit-animation-fill-mode:forwards;
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards;
-webkit-animation-delay: 6s;
-moz-animation-delay: 6s;
animation-delay: 6s;
}
in animate.css by http://daneden.github.io/animate.css it doesnt use other vendor prefix except -webkit- should we add ourself?
why it doesnt used other prefixes?
.animated {
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.animated.infinite {
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
.animated {
-webkit-animation-duration: 1s;
-moz-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
-moz-animation-fill-mode: both;
animation-fill-mode: both;
}
.animated.infinite {
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
I'm trying to, on li:hover, have one child <div> animate its width, at x seconds, from 0 to 100% and then a given number of seconds later animate another div the exact same way.
This is my code and it isn't working the way that I want it to.
li {
margin-bottom: -1px;
#top, #bottom {
height: 1px;
width: 0;
display: block;
background: $white;
}
#bottom {
-o-transition:.25s;
-ms-transition:.25s;
-moz-transition:.25s;
-webkit-transition:.25s;
transition:.25s;
}
#top {
-moz-animation: fadein 3s ease-in 3s forwards; /* Firefox */
-webkit-animation: fadein 3s ease-in 3s forwards; /* Safari and Chrome */
-o-animation: fadein 3s ease-in 3s forwards; /* Opera */
animation: fadein 3s ease-in 3s forwards;
}
&:hover {
#bottom {
-o-transition:.25s;
-ms-transition:.25s;
-moz-transition:.25s;
-webkit-transition:.25s;
transition:.25s;
width: 100%;
}
#top {
-moz-animation: fadein 3s ease-in 3s forwards; /* Firefox */
-webkit-animation: fadein 3s ease-in 3s forwards; /* Safari and Chrome */
-o-animation: fadein 3s ease-in 3s forwards; /* Opera */
animation: fadein 3s ease-in 3s forwards;
width: 100%;
}
}
}
Could someone explain to me what it is I am doing wrong?
You cannot use the animation property without defining keyframes.
So I'm trying to animate some text dropping down once its finished animating.
The problem is it just disappears after it's finished, even though I set the opacity to 1# 100%.
/* text animation */
#-webkit-keyframes textAnimation {
0% {
opacity: 0;
-webkit-transform: translateY(-200%);
}
10% {
opacity: 1;
-webkit-transform: translateY(0%);
}
20% {
opacity: 1;
-webkit-transform: translateY(0%);
}
100% {
opacity: 1;
-webkit-transform: translateY(0%);
}
}
.text-animation {
z-index: 1000;
width: 100%;
text-align: center;
opacity: 0;
-webkit-animation: textAnimation 2s linear 2s;
-moz-animation: textAnimation 2s linear 2s;
-o-animation: textAnimation 2s linear 2s;
-ms-animation: textAnimation 2s linear 2s;
animation: textAnimation 2s linear 2s;
-webkit-animation-iteration-count: 1;
-webkit-animation-delay: 1s;
-moz-animation-delay: 1s;
-o-animation-delay: 1s;
-ms-animation-delay: 1s;
animation-delay: 1s;
}
/* text animation */
I just don't understand what the problem is here...
This worked for me.
If you set the end state in the class and not add a delay.
#-webkit-keyframes textAnimation {
0% { opacity: 0; -webkit-transform: translateY(-200%); }
33% { opacity: 1; -webkit-transform: translateY(-200%); }
100% { opacity: 1; -webkit-transform: translateY(0%); }
}
.text-animation {
color:#fff;
font-size:32px;
width: 100%;
text-align: center;
opacity: 1;
-webkit-animation: textAnimation 3s linear;
-moz-animation: textAnimation 3s linear;
-o-animation: textAnimation 3s linear;
-ms-animation: textAnimation 3s linear;
animation: textAnimation 3s linear;
}
In you .text-animation declaration add this :
-webkit-animation-fill-mode: forwards;
Thanks to it, your animation will stay to the last keyframe state. (here, opacity 0).
You can see the result here : http://codepen.io/joe/pen/CkbcL
Source : https://developer.mozilla.org/en-US/docs/CSS/animation-fill-mode