Reputation: 1023
I created a calling animation using JS and CSS. I tested in most of the browser and it is working fine. But unfortunately, the shadow effect not supporting IE.
I tested in IE 11. I added additional CSS to work on all browser. But still, animation
function is not supporting in IE and I couldn't fix the issue. Please run the below code and help me.
var setRinging = function() {
setTimeout(function() {
$(".ringing").addClass("-ringing");
}, 600);
};
setRinging();
a {
cursor: pointer;
}
.h-list,
.actions {
margin: 0;
padding: 0;
list-item-style: none;
}
.h-list>li,
.actions>li {
display: inline-block;
}
.container {
position: relative;
width: 350px;
margin: 50px auto;
-webkit-perspective: 600px;
perspective: 600px;
}
.call {
position: absolute;
width: 100%;
box-sizing: border-box;
color: #0b5d4c;
padding: 15px;
border-radius: 4px;
transition: all 1s, background-color 600ms, opacity 600ms;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.ringing {
z-index: 10;
background-color: #1ab394;
}
/* inner */
.head {
font-size: 42px;
text-align: center;
margin: 0 auto;
}
.details {
color: #ecf0f1;
text-align: center;
font-size: 20px;
padding: 20px 0px 5px;
}
.details2 {
color: #d6fff6;
text-align: center;
font-size: 20px;
padding: 0px 0px 15px;
}
.actions {
width: 100%;
padding: 2px 16px;
box-sizing: border-box;
text-align: center;
}
.action {
padding: 0 8px 0 12px;
box-sizing: border-box;
}
.action>a {
width: 100%;
text-align: center;
display: inline-block;
box-sizing: border-box;
padding: 5px 8px;
text-decoration: none;
font-size: 15px;
border-radius: 4px;
background-color: white;
color: #1ab393;
}
.action>a:hover {
background-color: rgba(255, 255, 255, 0.8);
}
/* animation */
.-fadeout {
-webkit-filter: blur(6px);
filter: blur(6px);
opacity: 0;
}
.-drop {
-webkit-filter: blur(6px);
filter: blur(6px);
opacity: 0;
-webkit-transform: translateY(20%) rotateX(20deg);
transform: translateY(20%) rotateX(20deg);
}
.-flip {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.flipback {
-webkit-transform: rotateY(-180deg);
transform: rotateY(-180deg);
}
.-ringing {
-webkit-animation: _ringing 800ms infinite;
animation: _ringing 800ms infinite;
-webkit-animation-fill-mode: forward;
animation-fill-mode: forward;
-webkit-animation-direction: normal;
animation-direction: normal;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
}
@-webkit-keyframes _ringing {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
10% {
-webkit-transform: translate(6px, 0px);
transform: translate(6px, 0px);
-webkit-transform: rotateZ(2deg);
transform: rotateZ(2deg);
}
20% {
-webkit-transform: translate(-6px, 0px);
transform: translate(-6px, 0px);
-webkit-transform: rotateZ(-2deg);
transform: rotateZ(-2deg);
}
30% {
-webkit-transform: translate(3px, 0px);
transform: translate(3px, 0px);
-webkit-transform: rotateZ(1deg);
transform: rotateZ(1deg);
}
40% {
-webkit-transform: translate(-3px, 0px);
transform: translate(-3px, 0px);
-webkit-transform: rotateZ(-1deg);
transform: rotateZ(-1deg);
}
50% {
-webkit-transform: translate(2px, 0px);
transform: translate(2px, 0px);
-webkit-transform: rotateZ(1deg);
transform: rotateZ(1deg);
}
60% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
100% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}
@keyframes _ringing {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
10% {
-webkit-transform: translate(6px, 0px);
transform: translate(6px, 0px);
-webkit-transform: rotateZ(2deg);
transform: rotateZ(2deg);
}
20% {
-webkit-transform: translate(-6px, 0px);
transform: translate(-6px, 0px);
-webkit-transform: rotateZ(-2deg);
transform: rotateZ(-2deg);
}
30% {
-webkit-transform: translate(3px, 0px);
transform: translate(3px, 0px);
-webkit-transform: rotateZ(1deg);
transform: rotateZ(1deg);
}
40% {
-webkit-transform: translate(-3px, 0px);
transform: translate(-3px, 0px);
-webkit-transform: rotateZ(-1deg);
transform: rotateZ(-1deg);
}
50% {
-webkit-transform: translate(2px, 0px);
transform: translate(2px, 0px);
-webkit-transform: rotateZ(1deg);
transform: rotateZ(1deg);
}
60% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
100% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}
/* eq */
.hidden {
display: none;
}
.sound {
font-size: 26px;
position: absolute;
top: -6px;
right: -6px;
opacity: .2;
cursor: pointer;
}
.sound:hover {
opacity: .5;
}
.fa-ban {
color: tomato;
}
.head {
height: 46px;
}
#eq {
width: 220px;
height: 46px;
}
.call-animation {
position: relative;
margin: 0 auto;
-webkit-animation: play 2s ease infinite;
/* Safari 4+ */
-moz-animation: play 2s ease infinite;
/* Fx 5+ */
-o-animation: play 2s ease infinite;
/* Opera 12+ */
animation: play 2s ease infinite;
/* IE 10+, Fx 29+ */
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
min-height: 209px;
background-color: #1ab393;
border-radius: 5px;
}
@-webkit-keyframes play {
0% {
transform: scale(1);
}
15% {
box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
}
25% {
box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
}
25% {
box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
}
}
@-moz-keyframes play {
0% {
transform: scale(1);
}
15% {
box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
}
25% {
box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
}
25% {
box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
}
}
@-o-keyframes play {
0% {
transform: scale(1);
}
15% {
box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
}
25% {
box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
}
25% {
box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
}
}
@keyframes play {
0% {
transform: scale(1);
}
15% {
box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
}
25% {
box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
}
25% {
box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<div class="container">
<div class="call-animation">
<div class="call ringing">
<div class="head"><i class="fa fa-bell"></i></div>
<div class="details">+912 345 678 912 is calling...</div>
<div class="details2">User Name</div>
<ul class="actions">
<li class="action"><a id="accept" href="#">View Details</a></li>
</ul>
</div>
</div>
</div>
Vibrate effects is working in IE but background shadow animation is not working in IE. Please check the image.
Upvotes: 3
Views: 90
Reputation: 681
just set box-shadow: none initially . Complete code given below
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<style>
a {
cursor: pointer;
}
.h-list,
.actions {
margin: 0;
padding: 0;
list-item-style: none;
}
.h-list>li,
.actions>li {
display: inline-block;
}
.container {
position: relative;
width: 350px;
margin: 50px auto;
-webkit-perspective: 600px;
perspective: 600px;
}
.call {
position: absolute;
width: 100%;
box-sizing: border-box;
color: #0b5d4c;
padding: 15px;
border-radius: 4px;
transition: all 1s, background-color 600ms, opacity 600ms;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.ringing {
z-index: 10;
background-color: #1ab394;
}
/* inner */
.head {
font-size: 42px;
text-align: center;
margin: 0 auto;
}
.details {
color: #ecf0f1;
text-align: center;
font-size: 20px;
padding: 20px 0px 5px;
}
.details2 {
color: #d6fff6;
text-align: center;
font-size: 20px;
padding: 0px 0px 15px;
}
.actions {
width: 100%;
padding: 2px 16px;
box-sizing: border-box;
text-align: center;
}
.action {
padding: 0 8px 0 12px;
box-sizing: border-box;
}
.action>a {
width: 100%;
text-align: center;
display: inline-block;
box-sizing: border-box;
padding: 5px 8px;
text-decoration: none;
font-size: 15px;
border-radius: 4px;
background-color: white;
color: #1ab393;
}
.action>a:hover {
background-color: rgba(255, 255, 255, 0.8);
}
/* animation */
.-fadeout {
-webkit-filter: blur(6px);
filter: blur(6px);
opacity: 0;
}
.-drop {
-webkit-filter: blur(6px);
filter: blur(6px);
opacity: 0;
-webkit-transform: translateY(20%) rotateX(20deg);
transform: translateY(20%) rotateX(20deg);
}
.-flip {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.flipback {
-webkit-transform: rotateY(-180deg);
transform: rotateY(-180deg);
}
.-ringing {
-webkit-animation: _ringing 800ms infinite;
animation: _ringing 800ms infinite;
-webkit-animation-fill-mode: forward;
animation-fill-mode: forward;
-webkit-animation-direction: normal;
animation-direction: normal;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
}
@-webkit-keyframes _ringing {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
10% {
-webkit-transform: translate(6px, 0px);
transform: translate(6px, 0px);
-webkit-transform: rotateZ(2deg);
transform: rotateZ(2deg);
}
20% {
-webkit-transform: translate(-6px, 0px);
transform: translate(-6px, 0px);
-webkit-transform: rotateZ(-2deg);
transform: rotateZ(-2deg);
}
30% {
-webkit-transform: translate(3px, 0px);
transform: translate(3px, 0px);
-webkit-transform: rotateZ(1deg);
transform: rotateZ(1deg);
}
40% {
-webkit-transform: translate(-3px, 0px);
transform: translate(-3px, 0px);
-webkit-transform: rotateZ(-1deg);
transform: rotateZ(-1deg);
}
50% {
-webkit-transform: translate(2px, 0px);
transform: translate(2px, 0px);
-webkit-transform: rotateZ(1deg);
transform: rotateZ(1deg);
}
60% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
100% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}
@keyframes _ringing {
0% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
10% {
-webkit-transform: translate(6px, 0px);
transform: translate(6px, 0px);
-webkit-transform: rotateZ(2deg);
transform: rotateZ(2deg);
}
20% {
-webkit-transform: translate(-6px, 0px);
transform: translate(-6px, 0px);
-webkit-transform: rotateZ(-2deg);
transform: rotateZ(-2deg);
}
30% {
-webkit-transform: translate(3px, 0px);
transform: translate(3px, 0px);
-webkit-transform: rotateZ(1deg);
transform: rotateZ(1deg);
}
40% {
-webkit-transform: translate(-3px, 0px);
transform: translate(-3px, 0px);
-webkit-transform: rotateZ(-1deg);
transform: rotateZ(-1deg);
}
50% {
-webkit-transform: translate(2px, 0px);
transform: translate(2px, 0px);
-webkit-transform: rotateZ(1deg);
transform: rotateZ(1deg);
}
60% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
100% {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
}
/* eq */
.hidden {
display: none;
}
.sound {
font-size: 26px;
position: absolute;
top: -6px;
right: -6px;
opacity: .2;
cursor: pointer;
}
.sound:hover {
opacity: .5;
}
.fa-ban {
color: tomato;
}
.head {
height: 46px;
}
#eq {
width: 220px;
height: 46px;
}
.call-animation {
position: relative;
margin: 0 auto;
-webkit-animation: play 2s ease infinite;
/* Safari 4+ */
-moz-animation: play 2s ease infinite;
/* Fx 5+ */
-o-animation: play 2s ease infinite;
/* Opera 12+ */
animation: play 2s ease infinite;
/* IE 10+, Fx 29+ */
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
min-height: 209px;
background-color: #1ab393;
border-radius: 5px;
box-shadow:none;
}
@-webkit-keyframes play {
0% {
transform: scale(1);
}
15% {
box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-webkit-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-ms-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-moz-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
}
25% {
box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-webkit-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-ms-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-moz-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
}
25% {
box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-webkit-box-shadow:0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-ms-box-shadow: 0 0 0 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-moz-box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
}
}
@-moz-keyframes play {
0% {
transform: scale(1);
}
15% {
box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-webkit-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-ms-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-moz-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
}
25% {
box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-webkit-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-ms-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-moz-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
}
25% {
box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-webkit-box-shadow:0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-ms-box-shadow: 0 0 0 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-moz-box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
}
}
@-o-keyframes play {
0% {
transform: scale(1);
}
15% {
box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-webkit-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-ms-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-moz-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
}
25% {
box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-webkit-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-ms-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-moz-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
}
25% {
box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-webkit-box-shadow:0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-ms-box-shadow: 0 0 0 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-moz-box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
}
}
@keyframes play {
0% {
transform: scale(1);
}
15% {
box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-webkit-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-ms-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
-moz-box-shadow: 0 0 0 5px rgba(26, 179, 147, 0.4);
}
25% {
box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-webkit-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-ms-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
-moz-box-shadow: 0 0 0 10px rgba(26, 179, 147, 0.4), 0 0 0 20px rgba(26, 179, 147, 0.2);
}
25% {
box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-webkit-box-shadow:0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-ms-box-shadow: 0 0 0 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
-moz-box-shadow: 0 0 0 15px rgba(26, 179, 147, 0.4), 0 0 0 30px rgba(26, 179, 147, 0.2);
}
}
</style>
</head>
<body>
<div class="container">
<div class="call-animation">
<div class="call ringing">
<div class="head"><i class="fa fa-bell"></i></div>
<div class="details">+912 345 678 912 is calling...</div>
<div class="details2">User Name</div>
<ul class="actions">
<li class="action"><a id="accept" href="#">View Details</a></li>
</ul>
</div>
</div>
</div>
<script>
var setRinging = function() {
setTimeout(function() {
$(".ringing").addClass("-ringing");
}, 600);
};
setRinging();
</script>
</body>
</html>
Upvotes: 2