I have a bit of animation which works perfectly in chrome but doesn't on safari. Weird isn't it? Ok here's my code:
<header>
<div class="ripple-1"></div>
<div class="ripple-2"></div>
<div class="ripple-3"></div>
<div class="ripple-4"></div>
<div class="ripple-5"></div>
</header>
Ok this doesn't work in Safari and mobile as I said, there's no movement whatsoever.
Also, still and only in Safari and mobile, on safari its become border squere
What am I doing wrong?
here is my css
header{
min-height: 100vh;
background-color: #42A5F5;
position: relative;
overflow: hidden;
}
.ripple-1,
.ripple-2,
.ripple-3,
.ripple-4,
.ripple-5{
height: 1px;
width: 1px;
position: absolute;
left: 50%;
bottom: 50%;
background: dodgerblue;
border-radius: 50%;
transform: translate3d(-50%, 50%, 0);
animation-name: ripple;
animation-duration: 8s;
animation-iteration-count: infinite;
animation-timing-function: ease-out;
will-change: transform, opacity;
}
.ripple-1{
animation-delay: 0;
}
.ripple-2{
animation-delay: 1s;
}
.ripple-3{
animation-delay: 2s;
}
.ripple-4{
animation-delay: 3s;
}
.ripple-4{
animation-delay: 4s;
}
.ripple-5{
animation-delay: 5s;
}
main{
height: 4000px;
background-color: #f7f7f7;
}
#keyframes ripple{
0%{
transform: translate3d(-50%, 50%, 0) scale(0);
opacity: .33;
}
100%{
transform: translate3d(-50%, 50%, 0) scale(2000);
opacity: 0;
}
}
I tried -webkit-, but didnt work :(
use the below css it will work fine on safari as well.
header{
min-height: 100vh;
background-color: #42A5F5;
position: relative;
overflow: hidden;
}
.ripple-1,
.ripple-2,
.ripple-3,
.ripple-4,
.ripple-5{
height: 1px;
width: 1px;
position: absolute;
left: 50%;
top: 50%;
background: dodgerblue;
border-radius: 50%;
transform: translate(-50%, -50%);
animation-name: ripple;
animation-duration: 8s;
animation-iteration-count: infinite;
animation-timing-function: ease-out;
will-change: transform, opacity, width;
r
}
.ripple-1{
animation-delay: 0;
}
.ripple-2{
animation-delay: 1s;
}
.ripple-3{
animation-delay: 2s;
}
.ripple-4{
animation-delay: 3s;
}
.ripple-4{
animation-delay: 4s;
}
.ripple-5{
animation-delay: 5s;
}
main{
height: 4000px;
background-color: #f7f7f7;
}
#keyframes ripple{
0%{
opacity: .33;
}
100%{
opacity: 0;
height: 2000px;
width: 2000px;
}
}
Related
Loading icon not spinning in the iOS version > 15.3 or 16.1 but it is working fine in the lower < 15 iOS version iphone and ipad and Android, browser.
Please find the below css code for reference. i have tried with webkit for safari and also tried with transform: rotate(-360deg). but spinner is not spinning/rotating in the iOS device alone. could you please confirm what we can change from our end.
#keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
#-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
/* spinner Wrapper */
.Wrapperspinner{
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 9999;
line-height: 30px;
margin-left: 0;
margin-top: 0;
text-align: center;
color: #fff;
padding-top: 7px;
background-color: rgba(250, 250, 250, 0.8);
opacity: 0.8;
display: none;
}
.loading {
position: absolute;
top: 50%;
left: 50%;
width: 80px;
height: 110px;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%)
}
/* Spinning circle (inner circle) */
.loading .maskedCircle {
width: 80px;
height: 80px;
border-radius: 50%;
border: 3px solid #ff6969;
}
/* Spinning circle mask */
.loading .mask {
width: 25px;
height: 25px;
overflow: hidden;
margin: -3px;
}
/*waiting text*/
.loading .spinnerWaitingText {
position: absolute;
bottom: 0;
text-align: center;
width: 100%;
}
/* Spinner */
.loading .spinner {
position: absolute;
left: 0;
top: 0;
width: 80px;
height: 80px;
animation-name: spin;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-timing-function: linear;
-webkit-animation-name: spin;
-webkit-animation-duration: 3s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
border-radius: 50%;
border: 3px solid #12779a;
}
div.tc-screenMask {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1000;
background-color: #000;
opacity: 0.3;
display: none;
}
.SpinnerStep1,
.SpinnerStep2,
.SpinnerStep3{
opacity: 0;
text-align: center;
position: absolute;
width: 100%;
}
.SpinnerContainer{
position: fixed;
top: calc(50% + 90px);
width: 100%;
left: 50%;
transform: translateX(-50%);
-webkit-transform: translateX(-50%);
min-width: 300px;
visibility: hidden;
}
.SpinnerStep1 {
animation-name: fadeInOut1;
animation-duration: 3s;
animation-timing-function: linear;
animation-iteration-count: 1;
-webkit-animation-name: fadeInOut1;
-webkit-animation-duration: 3s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: 1;
}
.SpinnerStep2 {
animation-name: fadeInOut2;
animation-duration: 6s;
animation-timing-function: linear;
animation-iteration-count: 1;
-webkit-animation-name: fadeInOut2;
-webkit-animation-duration: 6s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: 1;
}
.SpinnerStep3 {
animation-name: fadeInOut3;
animation-duration: 9s;
animation-timing-function: linear;
animation-iteration-count: 1;
animation-fill-mode: forwards;
-webkit-animation-name: fadeInOut3;
-webkit-animation-duration: 9s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: 1;
-webkit-animation-fill-mode: forwards;
}
#keyframes fadeInOut1 {
0% { opacity: 0 }
1% { opacity: 1 }
95% {opacity: 1 }
100% { opacity: 0 }
}
#keyframes fadeInOut2 {
0% { opacity: 0 }
50% { opacity: 0 }
51% { opacity : 1}
95% { opacity: 1 }
100% { opacity: 0 }
}
#keyframes fadeInOut3 {
0% { opacity: 0 }
66% { opacity: 0 }
67% { opacity: 1 }
100% { opacity: 1 }
}
#-webkit-keyframes fadeInOut1 {
0% { -webkit-opacity: 0 }
1% { -webkit-opacity: 1 }
95% {-webkit-opacity: 1 }
100% { -webkit-opacity: 0 }
}
#-webkit-keyframes fadeInOut2 {
0% { -webkit-opacity: 0 }
50% { -webkit-opacity: 0 }
51% { -webkit-opacity : 1}
95% { -webkit-opacity: 1 }
100% { -webkit-opacity: 0 }
}
#-webkit-keyframes fadeInOut3 {
0% { -webkit-opacity: 0 }
66% { -webkit-opacity: 0 }
67% { -webkit-opacity: 1 }
100% { -webkit-opacity: 1 }
}
.angSpinner.Wrapperspinner {
background-color: #fff;
opacity: 0.9;
display: block;
visibility: hidden;
}
.angSpinner .loading {
width: 148px;
height: 148px;
}
.angSpinner .loading .spinner {
border: none;
width: 148px;
height: 148px;
animation-name: spin;
animation-duration: .8s;
animation-iteration-count: infinite;
animation-timing-function: linear;
-webkit-animation-name: spin;
-webkit-animation-duration: .8s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
.angSpinner .loading .maskedCircle {
border: 4px solid #005900;
width: 140px;
height: 140px;
margin: 0;
box-sizing: content-box;
-webkit-box-sizing: content-box;
}
.angSpinner .loading .mask {
width: 148px;
height: 35px;
margin: 0;
}
please find the below HTML and Js code for reference. other animation text is for fade out in above css3 defined - delay. css3 code shared above for your reference. i have tried with above approach but sorry it is not working.
<div id="Wrapper" class="Wrapperspinner"
aria-label="Loading page now">
<div class="loading">
<!-- We make this div spin -->
<div class="spinner">
<!-- Mask of the quarter of circle -->
<div class="mask">
<!-- Inner masked circle -->
<div class="maskedCircle"></div>
</div>
</div>
<div class="loginSpinnerContainer" aria-hidden="true" tabindex="-1">
<div class="boi_label SpinnerStep1">
Contacting to server...
</div>
<div class="boi_label SpinnerStep2">
Authenticating your application...
</div>
<div class="boi_label SpinnerStep3">
Running security checks...
</div>
</div>
<div class="boi_label spinnerWaitingText" aria-hidden="true" tabindex="-1">please wait</div>
</div>
</div>
<script type="text/javascript" charset="utf-8">
//<![CDATA[
SLoader.setup({
id: 'WRAPPER',
showMask: 'WRAPPER.CREATE_MASK',
delay: '5'
});
$(document).ready(function() {
SLoader.triggerHide();
$('.main-form').attr('aria-hidden', 'false');
});
Hi.addHook('beforeSubmit', showSpinnerOnSubmit);
Hi.addHook('beforeAjaxButtonActionService', showSpinnerForAjaxButton);
Hi.addHook('postProcessResponse', SLoader.triggerHide);
function showSpinnerOnSubmit(){
$('#WRAPPER$').attr({'role': 'alert', 'aria-live': 'assertive'});
$('.main-form').attr('aria-hidden', 'true');
SLoader.triggerShow();
}
function showLoginSpinner(){
$('.loginSpinnerContainer').css('visibility', 'visible');
$('.spinnerWaitingText').hide();
$('#WRAPPER$').addClass('customSpinner');
}
function showSpinnerForAjaxButton() {
if(document.activeElement.classList.contains('showSpinner_ajaxbutton')) {
SLoader.triggerShowAjax();
}
}
//]]>
</script>
I'm getting more into animation property and keyframes. Got this loader thing I'm working on. I'm having a hard time getting to go from right to left with animation-delay and multiple animations approach.
This one dot is supposed to go from left > right, right > left.
Stop there for until the other dots pass back the other direction and start again, stop there until the other dots pass back....
My approach is:
Full solution at jsfiddle
body {
background-color: #111111;
}
[data-am-animation] {
box-sizing: border-box;
background-color: white;
flex-direction: row;
margin: 30px;
position: relative;
height: 180px;
width: 120px;
}
[data-am-animation] .dot {
background-color: deepskyblue;
position: absolute;
height: 30px;
width: 30px;
border-radius: 50%;
}
[data-am-animation] .dot.down {
left: 30px;
animation-name: load-down;
animation-duration: 5s;
animation-timing-function: linear;
animation-direction: alternate;
animation-iteration-count: infinite;
}
[data-am-animation] .dot.up {
left: 60px;
animation-name: load-up;
animation-duration: 5s;
animation-timing-function: linear;
animation-direction: alternate;
animation-iteration-count: infinite;
}
[data-am-animation] .dot.through {
left: 0;
top: 50%;
margin-top: -15px;
/*animation-name: load-through;
animation-duration: ($animation-speed / 2.6);
animation-timing-function: linear;
animation-direction: alternate;
animation-iteration-count: infinite;
animation-delay: ($animation-speed / 1.3);*/
animation: load-through-right 1.66667s linear infinite 3.125s, load-through-left 1.66667s linear infinite 3.125s;
}
/* keyframes start */
#keyframes load-down {
0% {
transform: translate(0, 0);
background-color: deepskyblue;
}
100% {
transform: translate(0, 150px);
background-color: deeppink;
}
}
#keyframes load-up {
0% {
transform: translate(0, 150px);
background-color: deeppink;
}
100% {
transform: translate(0, 0);
background-color: deepskyblue;
}
}
#keyframes load-through-right {
0% {
transform: translate(0, 0);
background-color: deepskyblue;
}
100% {
transform: translate(90px, 0);
background-color: deeppink;
}
}
#keyframes load-through-left {
0% {
transform: translate(90px, 0);
background-color: deeppink;
}
100% {
transform: translate(0, 0);
background-color: deepskyblue;
}
}
/* keyframes end */
<div data-am-animation>
<div class="dot through"></div>
<div class="dot down"></div>
<div class="dot up"></div>
</div>
any suggestions for math improvements, I'm all for it.
EDIT
Final result
Here is an approach with single animation. Let me know if it's a direction for you or may I didn't understand your wish.
body {
background-color: #111111;
}
[data-am-animation] {
box-sizing: border-box;
background-color: white;
flex-direction: row;
margin: 30px;
position: relative;
height: 180px;
width: 120px;
}
[data-am-animation] .dot {
background-color: deepskyblue;
position: absolute;
height: 30px;
width: 30px;
border-radius: 50%;
}
[data-am-animation] .dot.down {
left: 30px;
animation-name: load-down;
animation-duration: 5s;
animation-timing-function: linear;
animation-direction: alternate;
animation-iteration-count: infinite;
}
[data-am-animation] .dot.up {
left: 60px;
animation-name: load-up;
animation-duration: 5s;
animation-timing-function: linear;
animation-direction: alternate;
animation-iteration-count: infinite;
}
[data-am-animation] .dot.through {
left: 0;
top: 50%;
margin-top: -15px;
/*animation-name: load-through;
animation-duration: ($animation-speed / 2.6);
animation-timing-function: linear;
animation-direction: alternate;
animation-iteration-count: infinite;
animation-delay: ($animation-speed / 1.3);*/
animation: load-through-right 5s linear infinite;
}
/* keyframes start */
#keyframes load-down {
0% {
transform: translate(0, 0);
background-color: deepskyblue;
}
100% {
transform: translate(0, 150px);
background-color: deeppink;
}
}
#keyframes load-up {
0% {
transform: translate(0, 150px);
background-color: deeppink;
}
100% {
transform: translate(0, 0);
background-color: deepskyblue;
}
}
#keyframes load-through-right {
0%, 20% {
transform: translate(0, 0);
background-color: deepskyblue;
}
50%, 70% {
transform: translate(90px, 0);
background-color: deeppink;
}
}
#keyframes load-through-left {
0% {
transform: translate(90px, 0);
background-color: deeppink;
}
100% {
transform: translate(0, 0);
background-color: deepskyblue;
}
}
/* keyframes end */
<div data-am-animation>
<div class="dot through"></div>
<div class="dot down"></div>
<div class="dot up"></div>
</div>
In the following code, I want to have the square shadow appear and rotate at the same time, but the display does not change. Any help is very appreciated.
#test {
position: absolute;
width: 100px;
height: 100px;
border: 3px solid green;
margin-top: 6px;
left: 51.5%;
background: red;
border-radius: 50%
}
#shadow {
position: absolute;
border: 3px solid black;
width: 120px;
height: 120px;
left: 50%;
opacity: 0.2;
display: none;
-webkit-transition-property: -webkit-transform;
-webkit-transition-duration: 1s;
-moz-transition-property: -moz-transform;
-moz-transition-duration: 1s;
transition-property: transform;
transition-duration: 1s;
}
#shadow:hover {
display: block;
-webkit-animation-name: rotate;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: rotate;
-moz-animation-duration: 2s;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
animation-name: rotate;
animation-duration: 2s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
#-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
#-moz-keyframes rotate {
from {
-moz-transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
}
}
#keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
<div id="test"></div>
<div id="shadow"></div>
It won't work like this because when you have it set to display:none; there's nothing to hover so the hover state never gets fired. You need to use only opacity to hide it rather than display:none;
#test {
position: absolute;
width: 100px;
height: 100px;
border: 3px solid green;
margin-top: 6px;
left: 51.5%;
background: red;
border-radius: 50%
}
#shadow {
position: absolute;
border: 3px solid black;
width: 120px;
height: 120px;
left: 50%;
opacity:0;
-webkit-transition-property: -webkit-transform;
-webkit-transition-duration: 1s;
-moz-transition-property: -moz-transform;
-moz-transition-duration: 1s;
transition-property: transform;
transition-duration: 1s;
}
#shadow:hover {
opacity: 0.2;
-webkit-animation-name: rotate;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: rotate;
-moz-animation-duration: 2s;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
animation-name: rotate;
animation-duration: 2s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
#-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
#-moz-keyframes rotate {
from {
-moz-transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
}
}
#keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
<div id="test"></div>
<div id="shadow"></div>
You can't hover a non-displayed element. There are a few solutions here, just as making the shadow a child of the test div.
Or, using a + CSS selector. In either case, the hover listener is on the visible element:
#test {
position: absolute;
width: 100px;
height: 100px;
border: 3px solid green;
margin-top: 6px;
left: 51.5%;
background: red;
border-radius: 50%
}
#shadow {
position: absolute;
border: 3px solid black;
width: 120px;
height: 120px;
left: 50%;
opacity: 0.2;
display: none;
-webkit-transition-property: -webkit-transform;
-webkit-transition-duration: 1s;
-moz-transition-property: -moz-transform;
-moz-transition-duration: 1s;
transition-property: transform;
transition-duration: 1s;
}
#test:hover + #shadow {
display: block;
-webkit-animation-name: rotate;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: rotate;
-moz-animation-duration: 2s;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
animation-name: rotate;
animation-duration: 2s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
#-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
#-moz-keyframes rotate {
from {
-moz-transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
}
}
#keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
<div id="test"></div>
<div id="shadow"></div>
You can't animate "Display". If you want to fade in the box, have
display:block;
opacity:0;
and in your animations add
opacity:1;
this will fade in the box as it rotates.
You cannot hover an element not displayed like #shadow (with display:none), but you have to hover #test and apply the css rule to the sibiling next to #test, that is #shadow (using + selector)
#test:hover + #shadow
#test {
position: absolute;
width: 100px;
height: 100px;
border: 3px solid green;
margin-top: 6px;
left: 51.5%;
background: red;
border-radius: 50%
}
#shadow {
position: absolute;
border: 3px solid black;
width: 120px;
height: 120px;
left: 50%;
opacity: 0.2;
display: none;
-webkit-transition-property: -webkit-transform;
-webkit-transition-duration: 1s;
-moz-transition-property: -moz-transform;
-moz-transition-duration: 1s;
transition-property: transform;
transition-duration: 1s;
}
#test:hover + #shadow{
display: block;
-webkit-animation-name: rotate;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: rotate;
-moz-animation-duration: 2s;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
animation-name: rotate;
animation-duration: 2s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
#-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
#-moz-keyframes rotate {
from {
-moz-transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
}
}
#keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
<div id="test"></div>
<div id="shadow"></div>
I have been trying all the morning to make this more smoother:
http://codepen.io/alexrts/pen/jbNrXo
-webkit-animation: pulse 1.4s ease-out;
-moz-animation: pulse 1.4s ease-out;
animation: pulse 1.4s ease-out;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
animation-iteration-count: infinite;
As you can see, it looks a little bit robotic.
Does anybody knows if there's a way to do it without javascript?
Best,
Alex
You should make the easing linear
html {
background: #fff;
overflow: hidden;
font-family: Helvetica, Arial;
font-weight: 600;
font-size: 16px;
}
.live-cta {
position: absolute;
top: 45%;
left: 50%;
margin-left: -50px;
}
.live-icon {
position: relative;
width: 40px;
height: 40px;
float: left;
}
.live-text {
position: relative;
float: left;
margin: 12px 0 0 0;
color: #007aff;
}
.live-arrow {
background-image: url("http://s18.postimg.org/u8099c1c5/live_arrow.png");
background-size: 40px 40px;
background-repeat: no-repeat;
width: 40px;
height: 40px;
position: absolute;
top: 0;
left: 0;
z-index: 3;
}
.live-pulse-min {
border: 4px solid #007aff;
background: transparent;
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
border-radius: 100px;
height: 10px;
width: 10px;
position: absolute;
top: 11px;
left: 11px;
-webkit-animation: pulse 1.4s linear;
-moz-animation: pulse 1.4s linear;
animation: pulse 1.4s linear;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
animation-iteration-count: infinite;
z-index: 1;
opacity: 0;
}
.live-pulse-max {
border: 4px solid #007aff;
background: transparent;
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
border-radius: 100px;
height: 28px;
width: 28px;
position: absolute;
top: 2px;
left: 2px;
-webkit-animation: pulse2 1.4s linear;
-moz-animation: pulse2 1.4s linear;
animation: pulse2 1.4s linear;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
animation-iteration-count: infinite;
z-index: 1;
opacity: 0;
}
#-webkit-keyframes "pulse" {
0% {
-webkit-transform: scale(0);
opacity: 0.0;
}
50% {
-webkit-transform: scale(.5);
opacity: 1;
}
100% {
-webkit-transform: scale(1);
opacity: 0.0;
}
}
#-webkit-keyframes "pulse2" {
0% {
-webkit-transform: scale(0);
opacity: 0.0;
}
50% {
-webkit-transform: scale(.5);
opacity: 1;
}
100% {
-webkit-transform: scale(1);
opacity: 0.0;
}
}
<div class="live-cta">
<div class="live-icon">
<div class="live-arrow"></div>
<div class="live-pulse-min"></div>
<div class="live-pulse-max"></div>
</div>
<div class="live-text">LIVE</dive>
</div>
Try to specify a linear easing by adding this line of css to your specified animations:
-webkit-animation-timing-function: linear; /* Chrome, Safari, Opera */
animation-timing-function: linear;
I edited your code here.
Am trying to animate using css3 animation only,but also having the responsiveness maintained till ipad size.
I came across an issue where i need to move the box after the lights have come ON and i cant seem to do it.
My Fiddle
Here's what i have done so far..
body{
margin: 0;
padding: 0;
border: 0;
height:100%;
}
#container{
margin:0 auto;
float : none;
height: 100%;
width:100%;
}
#waveDisplay{
/*border: 1px solid black;*/
height: 7%;
position: absolute;
top: 16%;
width: 3%;
left: 58%;
overflow: hidden;
}
#waveImage{
vertical-align: middle;
height: 76%;
position: relative;
-webkit-animation-name:waveMoving;
-webkit-animation-duration: 5s;
-webkit-animation-timing-function: ease-in;
-webkit-animation-iteration-count:infinite;
}
#-webkit-keyframes waveMoving{
from{-webkit-transform:translateX(0px);}
to{-webkit-transform:translateX(-75%);}
}
#innerWrapper{
border: 2px solid;
float:none;
position: relative;
width:100%;
height: auto;
background: no-repeat scroll 0 0;
background-size: 100% 100%;
}
#background{
max-width: 100%;
max-height: 100%;
}
.lights{
max-height: 38.3%;
max-width: 30%;
z-index: 100;
position: absolute;
opacity: 0;
animation:lightFading 0.1s;
-moz-animation:lightFading 0.1s; /* Firefox */
-webkit-animation: lightFadingIn 0.1s; /* safari and chrome*/
-o-animation:lightFading 0.1s; /* Opera */
-webkit-animation-delay: 5.2s;
-webkit-animation-fill-mode: forwards;
}
#keyframes lightFadingIn {
0% {opacity:0;}
100% {opacity:1;}
}
#-moz-keyframes lightFadingIn { /* Firefox */
0% {opacity:0;}
100% {opacity:1;}
}
#-webkit-keyframes lightFadingIn { /* Safari and Chrome */
0% {opacity:0;}
100% {opacity:1;}
}
#keyframes lightFadingOut {
0% {opacity:1;}
100% {opacity:0;}
}
#-moz-keyframes lightFadingOut { /* Firefox */
0% {opacity:1;}
100% {opacity:0;}
}
#-webkit-keyframes lightFadingOut { /* Safari and Chrome */
0% {opacity:1;}
100% {opacity:0;}
}
#light1{
top: 31%;
left: 14.8%;
}
#light2{
top: 31%;
left: 20.2%;
}
#cameraFlash{
top: 32%;
z-index: 100;
left: 21%;
-webkit-animation-name: cameraFlashDisplay 2s;
/*-webkit-animation: cameraFlash 0.2s;*/
-webkit-animation-timing-function: linear;
-webkit-animation-duration: 0.2s;
-webkit-animation-delay: 5.2s;
-webkit-animation-fill-mode: forwards;
}
#keyframe cameraFlashDisplay {
0% {
transform: scaleY(0);
-webkit-transform: scaleY(0.0);
max-height:0;
}
100% {
transform: scaleY(1.0);
-webkit-transform: scaleY(1.0);
max-height:100%;
}
}
#box1{
max-height: 17%;
max-width: 17%;
position: absolute;
top: 52%;
left: 5%;
-webkit-animation-name:boxMoving;
-webkit-animation-duration: 5s;
-webkit-animation-timing-function: ease-in;
/*-webkit-animation-iteration-count:infinite;*/
-webkit-animation-fill-mode: forwards;
}
#-webkit-keyframes boxMoving{
from{-webkit-transform:translateX(0%);}
to{-webkit-transform:translateX(275%);}
}
Here's what i need to do in steps after the box has reached the 3lights:
1. Lights should turn OFF.
2. Box should keep on moving.
Can anyone help me out with this?
Am kinda new to css3 animation.
If the fiddle doesn't work,try clearing the cache and running it again.
Work with it this way DEMO
#box1{
max-height: 17%;
max-width: 17%;
position: absolute;
top: 52%;
left: -50px;
-webkit-animation-name:boxMoving;
-webkit-animation-duration: 5s;
-webkit-animation-timing-function: ease-in;
/*-webkit-animation-iteration-count:infinite;*/
-webkit-animation-fill-mode: forwards;
}
#-webkit-keyframes boxMoving{
0% { margin-left:-20px;}
40% { margin-left:185px;}
50% { margin-left:185px; }
100% { margin-left:365px; }
}
And change the light and cameraflash animation durations and delays this way
.lights{
max-height: 38.3%;
max-width: 30%;
z-index: 100;
position: absolute;
opacity: 0;
animation:lightFading 1s;
-moz-animation:lightFading 1s; /* Firefox */
-webkit-animation: lightFadingIn 1s; /* safari and chrome*/
-o-animation:lightFading 1s; /* Opera */
-webkit-animation-delay: 2.0s;
-webkit-animation-fill-mode: forwards;
}
#keyframes lightFadingIn {
0% {opacity:0;}
80% {opacity:1;}
100% {opacity:0;}
}
#cameraFlash{
top: 32%;
z-index: 100;
left: 21%;
opacity:0;
-webkit-animation-name: cameraFlashDisplay 2s;
/*-webkit-animation: cameraFlash 0.2s;*/
-webkit-animation-timing-function: linear;
-webkit-animation-duration: 1s;
-webkit-animation-delay: 2.0s;
-webkit-animation-fill-mode: forwards;
}
#keyframe cameraFlashDisplay {
0% {
opacity:0;
}
80% {
opacity:1;
}
100% {
opacity:1;
}
}
Hope it helps