CSS animation not working in IE(Internet Explore) 10/11 - css

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>

Related

CSS Transform Origin Repositions Oddly When Window Size is Adjusted in Safari?

Though it appears to work fine in Firefox, I can't seem to figure out why the background image class below, (.sitebg), repositions erratically when the browser window size is adjusted in the Safari web browser. The transform-origin jumps oddly when the window is adjusted, but I have yet to know what's causing that to happen...
Is this some kind of bug, or do I need to implement something for better cross-browser compatibility?
See the snippet below for further reference.
body,
html {
height: 100%;
width: 100%;
background-size: cover;
background-repeat: no-repeat;
-webkit-text-size-adjust: 100%;
}
body {
background: blue;
margin: 0;
padding: 0;
border: 0;
outline: 0;
}
/* -- Site Background -- */
.sitebg {
background: url(http://maxpixel.freegreatpicture.com/static/photo/1x/Seamless-Repeating-Tiling-Tile-able-Tileable-1889447.jpg);
background-size: 720px 720px;
background-repeat: repeat;
background-position: center;
width: 1000%;
height: 1000%;
position: fixed;
top: 50%;
left: 50%;
}
#-moz-keyframes bg-rotate {
0% {
-moz-transform: rotate(0deg) translate(-50%, -50%);
-moz-transform-origin: top left;
}
100% {
-moz-transform: rotate(360deg) translate(-50%, -50%);
-moz-transform-origin: top left;
}
}
#-webkit-keyframes bg-rotate {
0% {
-webkit-transform: rotate(0deg) translate(-50%, -50%);
-webkit-transform-origin: top left;
}
100% {
-webkit-transform: rotate(360deg) translate(-50%, -50%);
-webkit-transform-origin: top left;
}
}
#keyframes bg-rotate {
0% {
transform: rotate(0deg) translate(-50%, -50%);
transform-origin: top left;
}
100% {
transform: rotate(360deg) translate(-50%, -50%);
transform-origin: top left;
}
}
/* -- Stack Ordering -- */
.sitebg {
z-index: -1;
}
body {
z-index: -2;
}
/* -- Media Queries -- */
#media only screen and (min-width:2000px) {
.sitebg {
-webkit-animation: 800s bg-rotate infinite linear;
-moz-animation: 800s bg-rotate infinite linear;
-o-animation: 800s bg-rotate infinite linear;
-ms-animation: 800s bg-rotate infinite linear;
animation: 800s bg-rotate infinite linear;
}
}
#media only screen and (max-width: 2000px) and (min-width: 1500px) {
.sitebg {
-webkit-animation: 700s bg-rotate infinite linear;
-moz-animation: 700s bg-rotate infinite linear;
-o-animation: 700s bg-rotate infinite linear;
-ms-animation: 700s bg-rotate infinite linear;
animation: 700s bg-rotate infinite linear;
}
}
#media only screen and (max-width: 1500px) and (min-width: 1000px) {
.sitebg {
-webkit-animation: 600s bg-rotate infinite linear;
-moz-animation: 600s bg-rotate infinite linear;
-o-animation: 600s bg-rotate infinite linear;
-ms-animation: 600s bg-rotate infinite linear;
animation: 600s bg-rotate infinite linear;
}
}
#media only screen and (max-width: 1000px) and (min-width: 600px) {
.sitebg {
-webkit-animation: 500s bg-rotate infinite linear;
-moz-animation: 500s bg-rotate infinite linear;
-o-animation: 500s bg-rotate infinite linear;
-ms-animation: 500s bg-rotate infinite linear;
animation: 500s bg-rotate infinite linear;
}
}
#media only screen and (max-width:600px) {
.sitebg {
-webkit-animation: 500s bg-rotate infinite linear;
-moz-animation: 500s bg-rotate infinite linear;
-o-animation: 500s bg-rotate infinite linear;
-ms-animation: 500s bg-rotate infinite linear;
animation: 500s bg-rotate infinite linear;
}
}
<div class="sitebg"></div>
So, it looks like using percentage values for the width and height were causing the glitch to occur. Though I am not sure if this is the best solution to date, this worked for me:
body,
html {
height: 100%;
width: 100%;
background-size: cover;
background-repeat: no-repeat;
-webkit-text-size-adjust: 100%;
}
body {
background: blue;
margin: 0;
padding: 0;
border: 0;
outline: 0;
}
/* -- Site Background -- */
.sitebg {
background: url(http://maxpixel.freegreatpicture.com/static/photo/1x/Seamless-Repeating-Tiling-Tile-able-Tileable-1889447.jpg);
background-size: 720px 720px;
background-repeat: repeat;
background-position: center;
width: 6788px;
height: 6788px;
position: fixed;
top: 50%;
left: 50%;
}
#-moz-keyframes bg-rotate {
0% {
-moz-transform: rotate(0deg) translate(-50%, -50%);
-moz-transform-origin: top left;
}
100% {
-moz-transform: rotate(360deg) translate(-50%, -50%);
-moz-transform-origin: top left;
}
}
#-webkit-keyframes bg-rotate {
0% {
-webkit-transform: rotate(0deg) translate(-50%, -50%);
-webkit-transform-origin: top left;
}
100% {
-webkit-transform: rotate(360deg) translate(-50%, -50%);
-webkit-transform-origin: top left;
}
}
#keyframes bg-rotate {
0% {
transform: rotate(0deg) translate(-50%, -50%);
transform-origin: top left;
}
100% {
transform: rotate(360deg) translate(-50%, -50%);
transform-origin: top left;
}
}
/* -- Stack Ordering -- */
.sitebg {
z-index: -1;
}
body {
z-index: -2;
}
/* -- Media Queries -- */
#media only screen and (min-width:2000px) {
.sitebg {
-webkit-animation: 800s bg-rotate infinite linear;
-moz-animation: 800s bg-rotate infinite linear;
-o-animation: 800s bg-rotate infinite linear;
-ms-animation: 800s bg-rotate infinite linear;
animation: 800s bg-rotate infinite linear;
}
}
#media only screen and (max-width: 2000px) and (min-width: 1500px) {
.sitebg {
-webkit-animation: 700s bg-rotate infinite linear;
-moz-animation: 700s bg-rotate infinite linear;
-o-animation: 700s bg-rotate infinite linear;
-ms-animation: 700s bg-rotate infinite linear;
animation: 700s bg-rotate infinite linear;
}
}
#media only screen and (max-width: 1500px) and (min-width: 1000px) {
.sitebg {
-webkit-animation: 600s bg-rotate infinite linear;
-moz-animation: 600s bg-rotate infinite linear;
-o-animation: 600s bg-rotate infinite linear;
-ms-animation: 600s bg-rotate infinite linear;
animation: 600s bg-rotate infinite linear;
}
}
#media only screen and (max-width: 1000px) and (min-width: 600px) {
.sitebg {
-webkit-animation: 500s bg-rotate infinite linear;
-moz-animation: 500s bg-rotate infinite linear;
-o-animation: 500s bg-rotate infinite linear;
-ms-animation: 500s bg-rotate infinite linear;
animation: 500s bg-rotate infinite linear;
}
}
#media only screen and (max-width:600px) {
.sitebg {
-webkit-animation: 500s bg-rotate infinite linear;
-moz-animation: 500s bg-rotate infinite linear;
-o-animation: 500s bg-rotate infinite linear;
-ms-animation: 500s bg-rotate infinite linear;
animation: 500s bg-rotate infinite linear;
}
}
<div class="sitebg"></div>

How can I repeat this animation in CSS?

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;
}
}

css3 animation is not working in Safari

CSS3 animation is not working for me in Safari (works ok in other browsers), I tried splitting out the shorthand so each property is declared separately eg:
-webkit-animation-name: glow;
-webkit-animation-duration: 2s;
......
But still doesn't work. Any ideas?
.light:after {
content:'';
display:block;
z-index:1;
border-radius: 50%;
width: 15px;
height: 15px;
position:absolute;
cursor:pointer;
background:rgba(64, 61, 51, 1);
-webkit-transition: all 500ms ease-in-out 0s;
-moz-transition: all 500ms ease-in-out 0s;
-o-transition: all 500ms ease-in-out 0s;
transition:all 500ms ease-in-out 0s;
}
.light.turned-on:after {
content:'';
display:block;
z-index:1;
background:rgba(255, 242, 204, 1);
-webkit-transition: all 500ms ease-in-out 0s;
-moz-transition: all 500ms ease-in-out 0s;
-o-transition: all 500ms ease-in-out 0s;
transition:all 500ms ease-in-out 0s;
}
.game-area.won .light:after {
-webkit-animation-name: glow;
-webkit-animation-duration: 2s;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: forwards;
-moz-animation: glow 2s ease-in-out infinite alternate;
-o-animation: glow 2s ease-in-out infinite alternate;
animation: glow 2s ease-in-out infinite alternate;
}
#-webkit-keyframes glow {
0% {
background: #FFF2CC;
}
10% {
background: #FFF2CC;
}
30% {
background: #C58FCC;
}
50% {
background: #AE86B2;
}
70% {
background: #B2A57D;
}
90% {
background: #B2FFEB;
}
100% {
background: #B2FFEB;
}
}
Just realized that in Safari 8.0.7 (10600.7.5) you cannot use animation on display: inline elements. Since display is inline-block or any other, animation works.
I hope it will help someone.

css3 animation keep reverting to original state

Playing around with CSS 3 animations but for some reasons, all animations return to their original state after execution.
In this case I'd like the image to remain at scale(1) after animation and my text to oly appear after img animation but stay afterward.
.expanding-spinning {
-webkit-transform: scale(.4);
-webkit-transition-timing-function: ease-out;
-webkit-transition-duration: 500ms;
animation-duration: 500ms;
}
.expanding-spinning {
-webkit-animation: spin2 1.4s ease-in-out alternate;
animation: spin2 1.4s ease-in-out alternate;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
#-webkit-keyframes spin2 {
0% { -webkit-transform: rotate(0deg) scale(.4);}
100% { -webkit-transform: rotate(360deg) scale(1);}
}
#-keyframes spin2 {
0% { transform: rotate(0deg) scale(.4);}
100% { transform: rotate(360deg) scale(1);}
}
#-webkit-keyframes fadeInFromNone {
0% {
display:none;
opacity: 0;
}
100% {
display: block;
opacity: 1;
}
}
.slogan {
display: block;
opacity: 1;
-webkit-animation-duration: 2s;
-webkit-animation-name: fadeInFromNone;
-webkit-animation-delay: 3.5s;
}
Fiddle code
You need to add the rule -webkit-animation-fill-mode: forwards; to your animations.
Also, regarding the text animation: Animate the visibility property instead of display property
FIDDLE
.expanding-spinning {
-webkit-animation: spin2 1.4s ease-in-out;
-moz-animation: spin2 1.4s linear normal;
-o-animation: spin2 1.4s linear;
-ms-animation: spin2 1.4s linear;
animation: spin2 1.4s ease-in-out alternate;
-webkit-animation-delay: 2s;
animation-delay: 2s;
-webkit-animation-fill-mode: forwards; /* <--- */
}
#-webkit-keyframes fadeInFromNone {
0% {
visibility:hidden;
opacity: 0;
}
100% {
visibility: visible;
opacity: 1;
}
}
.slogan {
visibility:hidden;
opacity: 1;
-webkit-animation-duration: 2s;
-webkit-animation-name: fadeInFromNone;
-webkit-animation-delay: 3.4s;
-webkit-animation-fill-mode: forwards; /* <--- */
}
See this article for a nice explanation of all the animation properties
The fill mode. If set to forwards, the last keyframe remains at the
end of the animation,
(from above link)

Pause css animation when it's finished

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

Resources