I am mimicking the Windows 10 start up screen. For those of you familiar with the startup, I have the color transitions complete and one set of flickering text ("Hello!"). But I have no idea how to add new sets of text that will flicker following the ("Hello!") Text.
I've tried to research this but have had no success
The final question is how to flicker multiple sets of text one after another
.wrapper {
height: 100%;
width: 100%;
left: 0;
right: 0;
top: 0;
bottom: 0;
position: absolute;
background: linear-gradient(124deg, #0095f0, #e81d1d, #0095f0, #0095f0, #1de840, #ff0000, #f0f0f0, #dd00f3, #009900);
background-size: 1800% 1800%;
-webkit-animation: rainbow 18s ease infinite;
-z-animation: rainbow 25s ease infinite;
-o-animation: rainbow 25s ease infinite;
animation: rainbow 25s ease infinite;
}
#-webkit-keyframes rainbow {
0% {
background-position: 0% 82%
}
50% {
background-position: 100% 19%
}
100% {
background-position: 0% 82%
}
}
#-moz-keyframes rainbow {
0% {
background-position: 0% 82%
}
50% {
background-position: 100% 19%
}
100% {
background-position: 0% 82%
}
}
#-o-keyframes rainbow {
0% {
background-position: 0% 82%
}
50% {
background-position: 100% 19%
}
100% {
background-position: 0% 82%
}
}
#keyframes rainbow {
0% {
background-position: 0% 82%
}
50% {
background-position: 100% 19%
}
100% {
background-position: 0% 82%
}
}
#Message {
color: #ffffff;
margin-top: 250px;
}
#keyframes flickerAnimation {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-o-keyframes flickerAnimation {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-moz-keyframes flickerAnimation {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
#-webkit-keyframes flickerAnimation {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.animate-flicker {
-webkit-animation: flickerAnimation 10s infinite;
-moz-animation: flickerAnimation 10s infinite;
-o-animation: flickerAnimation 10s infinite;
animation: flickerAnimation 10s infinite;
color: #ffffff;
margin-top: 250px;
}
#greet {
font-family: roboto;
font-weight: 150;
font-size: 30px;
}
<div class="wrapper">
<div class="animate-flicker" align="center">
<p id="greet">Hello!</h2>
</div>
</div>
I have translated your question in following requirements:
Show several words consecutively at the same spot.
Apply an animation on each word.
My animation displays an element 10 times for a short period of time and hides it again. animation-delay ensures that the animation on the second word starts after the first animation has finished and the animation on the third word starts after the second animation has finished.
To center words I positioned them absolute. This was necessary because I could not integrate display: inline; or display: none; in the keyframe animation (property display is not animatable).
span {
animation-name: flickerAnimation;
animation-duration: 0.1s;
animation-iteration-count: 10;
position: absolute;
opacity: 0;
left: 0;
right: 0;
text-align: center;
}
span:nth-child(2) {
animation-delay: 1s;
}
span:nth-child(3) {
animation-delay: 2s;
}
#keyframes flickerAnimation {
0% {opacity: 1;}
80% {opacity: 1;}
81% {opacity: 0;}
100% {opacity: 0;}
}
<div class="wrapper">
<span>First</span>
<span>Second</span>
<span>Third</span>
</div>
Related
I am new to CSS animations so I made this little project in which there is a box bouncing and it looks pretty real. I want the text inside the box (at the beginning it is just a 0) to increment by one every time the box bounces/the animation is complete. I tried using a counter but it keeps on resetting.
Here is my code:
* {
font-family: sans-serif;
}
#container {
border-bottom: 3px solid #444;
display: flex;
height: 330px;
width: 100%;
}
#oboing {
align-self: flex-end;
animation-duration: 2s;
animation-iteration-count: infinite;
background-color: black;
height: 200px;
margin: 0 auto 0 auto;
transform-origin: bottom;
width: 200px;
}
#counter::before {
color: white;
position: relative;
left: 40%;
top: 40%;
font-size: 50px;
content: counter(bounceCount);
}
#oboing {
animation-name: oboing;
animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
animation-timing-function: cubic-bezier(0.280, 0.840, 0.420, 1);
}
#keyframes oboing {
0% {
transform: scale(1, 1) translateY(0);
counter-reset: bounceCount, calc(counter(bounceCount)+1)
}
10% {
transform: scale(1.1, .9) translateY(0)
}
30% {
transform: scale(.9, 1.1) translateY(-100px);
}
50% {
transform: scale(1.05, .95) translateY(0)
}
57% {
transform: scale(1, 1) translateY(-7px);
}
64% {
transform: scale(1, 1) translateY(0)
}
100% {
transform: scale(1, 1) translateY(0);
counter-increment: bounceCount;
}
}
body {
background: linear-gradient(191deg, #3a22bd, #ea2b0b);
background-size: 400% 400%;
height: 100vh;
overflow: hidden;
-webkit-animation: Colors 4s ease infinite;
-moz-animation: Colors 4s ease infinite;
-o-animation: Colors 4s ease infinite;
animation: Colors 4s ease infinite;
}
#-webkit-keyframes Colors {
0% {
background-position: 0% 52%
}
50% {
background-position: 100% 49%
}
100% {
background-position: 0% 52%
}
}
#-moz-keyframes Colors {
0% {
background-position: 0% 52%
}
50% {
background-position: 100% 49%
}
100% {
background-position: 0% 52%
}
}
#-o-keyframes Colors {
0% {
background-position: 0% 52%
}
50% {
background-position: 100% 49%
}
100% {
background-position: 0% 52%
}
}
#keyframes Colors {
0% {
background-position: 0% 52%
}
50% {
background-position: 100% 49%
}
100% {
background-position: 0% 52%
}
}
<div id='container'>
<div id='oboing'>
<span id='counter'>0</span>
</div>
</div>
I am open to any suggestions including CSS, HTML, Jquery, JS, etc...
I would also appreciate it if someone could also explain why their code works... Many times I see answers on this website that have only code and no explaining. Please explain!
By it's definition, counter-increment is a non-animatable css property - that's why you're not being successful in using it in your animation. You would have to use a javascript function to count the bounces. As the animation duration is 2 seconds, one approach would be to use a set-interval approach and increment your counter every 2 seconds.
document.getElementById('counter').innerHTML = 0;
function increment() {
var x = document.getElementById('counter').innerHTML;
//if we declare the x value as 0, it will keep resetting,
//so instead, put we retrieve the initial value from the span
//and set the variable to that value
x++;
//increase by 1
document.getElementById('counter').innerHTML = x; //set span value
}
setInterval(increment, 2000); //1000ms in 1 sec
* {
font-family: sans-serif;
}
#container {
border-bottom: 3px solid #444;
display: flex;
height: 330px;
width: 100%;
}
#oboing {
align-self: flex-end;
animation-duration: 2s;
animation-iteration-count: infinite;
background-color: black;
height: 200px;
margin: 0 auto 0 auto;
transform-origin: bottom;
width: 200px;
}
#counter {
color: white;
position: relative;
left: 40%;
top: 40%;
font-size: 50px;
}
#oboing {
animation-name: oboing;
animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
animation-timing-function: cubic-bezier(0.280, 0.840, 0.420, 1);
}
#keyframes oboing {
0% {
transform: scale(1, 1) translateY(0);
}
10% {
transform: scale(1.1, .9) translateY(0)
}
30% {
transform: scale(.9, 1.1) translateY(-100px);
}
50% {
transform: scale(1.05, .95) translateY(0)
}
57% {
transform: scale(1, 1) translateY(-7px);
}
64% {
transform: scale(1, 1) translateY(0)
}
100% {
transform: scale(1, 1) translateY(0);
}
}
body {
background: linear-gradient(191deg, #3a22bd, #ea2b0b);
background-size: 400% 400%;
height: 100vh;
overflow: hidden;
-webkit-animation: Colors 4s ease infinite;
-moz-animation: Colors 4s ease infinite;
-o-animation: Colors 4s ease infinite;
animation: Colors 4s ease infinite;
}
#-webkit-keyframes Colors {
0% {
background-position: 0% 52%
}
50% {
background-position: 100% 49%
}
100% {
background-position: 0% 52%
}
}
#-moz-keyframes Colors {
0% {
background-position: 0% 52%
}
50% {
background-position: 100% 49%
}
100% {
background-position: 0% 52%
}
}
#-o-keyframes Colors {
0% {
background-position: 0% 52%
}
50% {
background-position: 100% 49%
}
100% {
background-position: 0% 52%
}
}
#keyframes Colors {
0% {
background-position: 0% 52%
}
50% {
background-position: 100% 49%
}
100% {
background-position: 0% 52%
}
}
<div id='container'>
<div id='oboing'>
<span id='counter'>0</span>
</div>
</div>
Hope this clears things up for you! :)
I've made a certain design in codepen with a background animation, and it works there, but it doesn't work when I put it in my ASP.Net Core project. I know I'm referencing the file correctly because the background color does show, it just doesn't animate. I thought it was just an issue with Chrome, but it doesn't work in Firefox either. The only thing I haven't tested was to see if it worked in regular IIS instead of IIS Express.
Code:
CSS:
body{
margin:0;
padding:0;
background:0 0;
}
.parallaxBackground {
min-height:100%;
min-width:100%;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.colorcycle {
min-height: 100%;
min-width: 100%;
display: inline-block;
text-align: center;
background: linear-gradient(271deg, #e7ff26, #2ecc00, #ff3b00, #2a9fff);
background-size: 800% 800%;
-webkit-animation: AnimationName 10s ease infinite;
-moz-animation: AnimationName 10s ease infinite;
-o-animation: AnimationName 10s ease infinite;
animation: AnimationName 10s ease infinite;
-webkit-keyframes AnimationName {
0% {
background-position: 92% 0%
}
50% {
background-position: 9% 100%
}
100% {
background-position: 92% 0%
}
}
#-moz-keyframes AnimationName {
0% {
background-position: 92% 0%
}
50% {
background-position: 9% 100%
}
100% {
background-position: 92% 0%
}
}
#-o-keyframes AnimationName {
0% {
background-position: 92% 0%
}
50% {
background-position: 9% 100%
}
100% {
background-position: 92% 0%
}
}
#keyframes AnimationName {
0% {
background-position: 92% 0%
}
50% {
background-position: 9% 100%
}
100% {
background-position: 92% 0%
}
}
}
HTML:
<body>
<!--Parallax Landing Section-->
<div class="parallaxBackground">
<div class="colorcycle">testing testing testing </div>
</div>
<!--Parallax Landing Section-->
</body>
Edit: So, I tested it out separate from everything. I just made a plain folder on the desktop and put my HTML and CSS in their respective files and tried it like that. No other references to any JS,Bootstrap or anything else. Got the same issue. So I don't think it's something in my project blocking it, it has to be the way it's being processed. The only thing I can think of is that on Codepen, they CSS is in a .scss file, but I didn't think that would make a difference. I'll test that out but other than that, I have no idea. I'll just need to find an alternative.
Figured it out. In SASS, there are nested selectors, but it doesn't work in normal CSS. I just had to remove them from the class and that made it work.
.colorcycle {
min-height: 100%;
min-width: 100%;
display: inline-block;
text-align: center;
background: linear-gradient(271deg, #e7ff26, #2ecc00, #ff3b00, #2a9fff);
background-size: 800% 800%;
-webkit-animation: AnimationName 10s ease infinite;
-moz-animation: AnimationName 10s ease infinite;
-o-animation: AnimationName 10s ease infinite;
animation: AnimationName 10s ease infinite;
}
#-webkit-keyframes AnimationName {
0% {
background-position: 92% 0%
}
50% {
background-position: 9% 100%
}
100% {
background-position: 92% 0%
}
}
#-moz-keyframes AnimationName {
0% {
background-position: 92% 0%
}
50% {
background-position: 9% 100%
}
100% {
background-position: 92% 0%
}
}
#-o-keyframes AnimationName {
0% {
background-position: 92% 0%
}
50% {
background-position: 9% 100%
}
100% {
background-position: 92% 0%
}
}
#keyframes AnimationName {
0% {
background-position: 92% 0%
}
50% {
background-position: 9% 100%
}
100% {
background-position: 92% 0%
}
}
JsFiddle
Code:
.iconsbg_container {
width: 100%;
-webkit-animation: iconsbg_container 10s linear infinite;
-moz-animation: iconsbg_container 10s linear infinite;
-ms-animation: iconsbg_container 10s linear infinite;
animation: iconsbg_container 10s linear infinite;
}
.EG_icons_a,
.EG_icons_b,
.EG_icons_c,
.iconsbg_container {
overflow: hidden;
}
.icons_container {
padding: 50px 0;
width: 50%;
max-width: 900px;
position: relative;
margin: 0 auto;
}
.EG_icons_a,
.EG_icons_b,
.EG_icons_c {
background-image: url('http://davidwillprice.com/wp-content/uploads/2018/03/Icons-sprite-sheet2.png');
background-size: auto 100%;
width: 100%;
}
.EG_icons_b,
.EG_icons_c {
height: 100%;
position: absolute;
}
.EG_icons_a {
position: relative;
margin: 0 auto;
padding-bottom: 75%;
}
.EG_icons_b {
-webkit-animation: EG_icons_b 10s linear infinite;
-moz-animation: EG_icons_b 10s linear infinite;
-ms-animation: EG_icons_b 10s linear infinite;
animation: EG_icons_b 10s linear infinite;
background-position: 50% 50%;
}
.EG_icons_c {
-webkit-animation: EG_icons_c 10s linear infinite;
-moz-animation: EG_icons_c 10s linear infinite;
-ms-animation: EG_icons_c 10s linear infinite;
animation: EG_icons_c 10s linear infinite;
background-position: 100% 100%;
}
/*20 13 20 13 20 13 */
/*20 33 53 66 86 100 */
#-webkit-keyframes EG_icons_b {
0%,
20% {
opacity: 0;
}
33%,
53% {
opacity: 1;
}
66%,
100% {
opacity: 0;
}
}
#-moz-keyframes EG_icons_b {
0%,
20% {
opacity: 0;
}
33%,
53% {
opacity: 1;
}
66%,
100% {
opacity: 0;
}
}
#-ms-keyframes EG_icons_b {
0%,
20% {
opacity: 0;
}
33%,
53% {
opacity: 1;
}
66%,
100% {
opacity: 0;
}
}
#keyframes EG_icons_b {
0%,
20% {
opacity: 0;
}
33%,
53% {
opacity: 1;
}
66%,
100% {
opacity: 0;
}
}
#-webkit-keyframes EG_icons_c {
0%,
53% {
opacity: 0;
}
66%,
86% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#-moz-keyframes EG_icons_c {
0%,
53% {
opacity: 0;
}
66%,
86% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#-ms-keyframes EG_icons_c {
0%,
53% {
opacity: 0;
}
66%,
86% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#keyframes EG_icons_c {
0%,
53% {
opacity: 0;
}
66%,
86% {
opacity: 1;
}
100% {
opacity: 0;
}
}
#-webkit-keyframes iconsbg_container {
0%,
53% {
background-color: #ffffff;
}
66%,
86% {
background-color: #48616e;
}
100% {
background-color: #ffffff;
}
}
#-moz-keyframes iconsbg_container {
0%,
53% {
background-color: #ffffff;
}
66%,
86% {
background-color: #48616e;
}
100% {
background-color: #ffffff;
}
}
#-ms-keyframes iconsbg_container {
0%,
53% {
background-color: #ffffff;
}
66%,
86% {
background-color: #48616e;
}
100% {
background-color: #ffffff;
}
}
#keyframes iconsbg_container {
0%,
53% {
background-color: #ffffff;
}
66%,
86% {
background-color: #48616e;
}
100% {
background-color: #ffffff;
}
}
<div class="iconsbg_container">
<div class="icons_container">
<div class="EG_icons_a">
<div class="EG_icons_b"></div>
<div class="EG_icons_c"></div>
</div>
</div>
</div>
I've made a basic CSS slideshow, but I am getting a white pixel line on the right of the images when using Chrome at some resolutions.
I don't get the line at all on IE or Firefox.
Currently I am using Chrome 64.0.3282.186 on my desktop, but I am also seeing it on mobile.
I feel like I am missing some obvious; any help appreciated.
This white 1px line is a part of your background-image which is inserted second time, because there is some small mistake in browser about calculate background-image width. To avoid that you must add one line to your css. For .EG_icons_a, .EG_icons_b, .EG_icons_c add background-repeat: no-repeat; - it will help.
I am working on a CSS only slider. However I don't have much experience with using keyframes.
I found this pen; could someone explain to me how the keyframes ensure that the animation runs in a cyclic manner rather than at the same time (where all the slides would disappear and reappear together)?
Code pen link
.slider {
max-width: 300px;
height: 200px;
margin: 20px auto;
position: relative;
}
.slide1,
.slide2,
.slide3,
.slide4,
.slide5 {
position: absolute;
width: 100%;
height: 100%;
}
.slide1 {
background: url(http://media.dunkedcdn.com/assets/prod/40946/580x0-9_cropped_1371566801_p17tbs0rrjqdt1u4dnk94fe4b63.jpg)no-repeat center;
background-size: cover;
animation: fade 8s infinite;
-webkit-animation: fade 8s infinite;
}
.slide2 {
background: url(http://media.dunkedcdn.com/assets/prod/40946/580x0-9_cropped_1371565525_p17tbqpu0d69c21hetd77dh483.jpeg)no-repeat center;
background-size: cover;
animation: fade2 8s infinite;
-webkit-animation: fade2 8s infinite;
}
.slide3 {
background: url(http://media.dunkedcdn.com/assets/prod/40946/580x0-9_cropped_1371564896_p17tbq6n86jdo3ishhta3fv1i3.jpg)no-repeat center;
background-size: cover;
animation: fade3 8s infinite;
-webkit-animation: fade3 8s infinite;
}
#keyframes fade {
0% {
opacity: 1
}
33.333% {
opacity: 0
}
66.666% {
opacity: 0
}
100% {
opacity: 1
}
}
#keyframes fade2 {
0% {
opacity: 0
}
33.333% {
opacity: 1
}
66.666% {
opacity: 0
}
100% {
opacity: 0
}
}
#keyframes fade3 {
0% {
opacity: 0
}
33.333% {
opacity: 0
}
66.666% {
opacity: 1
}
100% {
opacity: 0
}
}
<div class='slider'>
<div class='slide1'></div>
<div class='slide2'></div>
<div class='slide3'></div>
</div>
This is due to the each slide using a different keyframe, i.e. slide1 uses fade, slide2 uses fade2 and slide3 uses fade3. These keyframes all last 8 seconds however the frame in which the slide is shown is different:
slide1 is shown at 0% (0 seconds)
slide2 is shown at 33.333% (about 2.6 seconds)
slide3 is shown at 66.666% (about 5.3 seconds)
This particular method will work when you have three slides but would need to be adapted if you were to have a different amount. For example with four you would need to add an extra step to the keyframe:
.slider {
max-width: 300px;
height: 200px;
margin: 20px auto;
position: relative;
}
.slide1,
.slide2,
.slide3,
.slide4,
.slide5 {
position: absolute;
width: 100%;
height: 100%;
}
.slide1 {
background: url(http://media.dunkedcdn.com/assets/prod/40946/580x0-9_cropped_1371566801_p17tbs0rrjqdt1u4dnk94fe4b63.jpg)no-repeat center;
background-size: cover;
animation: fade 8s infinite;
-webkit-animation: fade 8s infinite;
}
.slide2 {
background: url(http://media.dunkedcdn.com/assets/prod/40946/580x0-9_cropped_1371565525_p17tbqpu0d69c21hetd77dh483.jpeg)no-repeat center;
background-size: cover;
animation: fade2 8s infinite;
-webkit-animation: fade2 8s infinite;
}
.slide3 {
background: url(http://media.dunkedcdn.com/assets/prod/40946/580x0-9_cropped_1371564896_p17tbq6n86jdo3ishhta3fv1i3.jpg)no-repeat center;
background-size: cover;
animation: fade3 8s infinite;
-webkit-animation: fade3 8s infinite;
}
.slide4 {
background: red;
background-size: cover;
animation: fade4 8s infinite;
-webkit-animation: fade4 8s infinite;
}
#keyframes fade {
0% {
opacity: 1
}
25% {
opacity: 0
}
50% {
opacity: 0
}
75% {
opacity: 0
}
100% {
opacity: 1
}
}
#keyframes fade2 {
0% {
opacity: 0
}
25% {
opacity: 1
}
50% {
opacity: 0
}
75% {
opacity: 0
}
100% {
opacity: 0
}
}
#keyframes fade3 {
0% {
opacity: 0
}
25% {
opacity: 0
}
50% {
opacity: 1
}
75% {
opacity: 0
}
100% {
opacity: 0
}
}
#keyframes fade4 {
0% {
opacity: 0
}
25% {
opacity: 0
}
50% {
opacity: 0
}
75% {
opacity: 1
}
100% {
opacity: 0
}
}
<div class='slider'>
<div class='slide1'></div>
<div class='slide2'></div>
<div class='slide3'></div>
<div class='slide4'></div>
</div>
As suggested by #ILoveCSS this code can be shortened to just the one keyframe animation by adding a third property to the animation property. This value is the animation-delay property and will stall the animation by the specified time:
.slider {
max-width: 300px;
height: 200px;
margin: 20px auto;
position: relative;
}
.slide1,.slide2,.slide3,.slide4,.slide5 {
position: absolute;
width: 100%;
height: 100%;
}
.slide1 {
background: url(http://media.dunkedcdn.com/assets/prod/40946/580x0-9_cropped_1371566801_p17tbs0rrjqdt1u4dnk94fe4b63.jpg)no-repeat center;
background-size: cover;
animation:fade 8s infinite;
-webkit-animation:fade 8s infinite;
}
.slide2 {
background: url(http://media.dunkedcdn.com/assets/prod/40946/580x0-9_cropped_1371565525_p17tbqpu0d69c21hetd77dh483.jpeg)no-repeat center;
background-size: cover;
animation:fade 8s infinite 2.6s;
-webkit-animation:fade 8s infinite 2.6s;
}
.slide3 {
background: url(http://media.dunkedcdn.com/assets/prod/40946/580x0-9_cropped_1371564896_p17tbq6n86jdo3ishhta3fv1i3.jpg)no-repeat center;
background-size: cover;
animation:fade 8s infinite 5.3s;
-webkit-animation:fade 8s infinite 5.3s;
}
#keyframes fade
{
0% {opacity:1}
33.333% { opacity: 0}
66.666% { opacity: 0}
100% { opacity: 1}
}
<div class='slider'>
<div class='slide3'></div>
<div class='slide2'></div>
<div class='slide1'></div>
</div>
I think what he is trying is:
#keyframes fade
{
0% {opacity:1}
33.333% { opacity: 0}
66.666% { opacity: 0}
100% { opacity: 1}
}
in this case slide1 is getting visible at the start of the animation and stops when it reached 33.333% and 66.666% and starts to visible at the end of the animation which is 100%.
#keyframes fade2
{
0% {opacity:0}
33.333% { opacity: 1}
66.666% { opacity: 0 }
100% { opacity: 0}
}
in the second slide2 at the start of the animation is not showing because slide1 is in the playing of it's animation and when slide1 reaches 33.333% started to stop and slide2 will start to fadeIn.
#keyframes fade3
{
0% {opacity:0}
33.333% { opacity: 0}
66.666% { opacity: 1}
100% { opacity: 0}
}
in the third slide3 the animation start to fadeIn at 66.666% because at this percent slide2 is in fadeOut state and it continue like this infinitely...
Hope you have an idea.
I have made an animation for some elements (images and buttons) to fade in and out using opacity. It works perfectly on all browsers, except on Safari. When I try to run it in Safari, all my elements has 100% opacity without any animation to see..
Example from the button element:
Here is my HTML:
<div id = "ctaButton" class="animate-fadeButton">
</div>
And my CSS:
#ctaButton{
position:absolute;
margin: auto;
left: 26%;
top:70%;
padding:10px; background: #CCC;
background-color: rgba(255,131,15,0.5);
}
#keyframes fadeButton {
0% { opacity:0; }
25% { opacity:0; }
35% { opacity:1; }
90% { opacity:1; }
100% { opacity:0; }
animation-timing-function: linear;
}
#-o-keyframes fadeButton{
0% { opacity:0; }
25% { opacity:0; }
35% { opacity:1; }
90% { opacity:1; }
100% { opacity:0; }
animation-timing-function: linear;
}
#-moz-keyframes fadeButton{
0% { opacity:0; }
25% { opacity:0; }
35% { opacity:1; }
90% { opacity:1; }
100% { opacity:0; }
animation-timing-function: linear;
}
#-webkit-keyframes fadeButton{
0% { opacity:0; }
25% { opacity:0; }
35% { opacity:1; }
90% { opacity:1; }
100% { opacity:0; }
-webkit-animation-timing-function: linear;
}
.animate-fadeButton {
-webkit-animation: fadeButton 15s infinite;
-moz-animation: fadeButton 15s infinite;
-o-animation: fadeButton 15s infinite;
animation: fadeButton 15s infinite;
}
You need to set the animation name and timing before the keyframes animation and not after
CSS
#ctaButton {
position: absolute;
margin: auto;
left: 26%;
top: 70%;
padding: 10px;
background: #CCC;
background-color: rgba(255, 131, 15, 0.5);
}
.animate-fadeButton {
-webkit-animation: fadeButton 15s infinite;
-moz-animation: fadeButton 15s infinite;
-o-animation: fadeButton 15s infinite;
animation: fadeButton 15s infinite;
}
#keyframes fadeButton {
0% {
opacity: 0;
}
25% {
opacity: 0;
}
35% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
animation-timing-function: linear;
}
#-o-keyframes fadeButton {
0% {
opacity: 0;
}
25% {
opacity: 0;
}
35% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
animation-timing-function: linear;
}
#-moz-keyframes fadeButton {
0% {
opacity: 0;
}
25% {
opacity: 0;
}
35% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
animation-timing-function: linear;
}
#-webkit-keyframes fadeButton {
0% {
opacity: 0;
}
25% {
opacity: 0;
}
35% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
-webkit-animation-timing-function: linear;
}