CSS animation example1: fire bullet from the gun

CSS animation example1: fire bullet from the gunFollowing example will fire 4 bullets from the gun and then after firing 4th bullet, detective sush message will appear on the next div.

<html>
<head>
<style>
div#bullet
{
width: 40px;
height: 15px;
background-color: #474747;
position: fixed;
left:50px;
top:35px;
-webkit-animation-name: example; /* Chrome, Safari, Opera */
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count:4; /* Chrome, Safari, Opera */
animation-name: example;
animation-duration: 4s;
border-top-right-radius:60%;
border-bottom-right-radius:60%;
z-index:-1;
}
div#nextdiv
{
height:100%;
width:100%;
position:fixed;
background-color:grey;
opacity:0;
font-size:40;
left:300px;
-webkit-animation-name: example1; /* Chrome, Safari, Opera */
-webkit-animation-duration: 5s;
-webkit-animation-fill-mode: forwards;
-webkit-animation-delay:4s;
animation-name: example1;
animation-duration: 5s;
animation-fill-mode: forwards;
animation-delay:4s;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes example {
from {left: 50px;}
to {left: 100%;}
}
@-webkit-keyframes example1 {
from {opacity:0;}
to {opacity:1;}
}
@keyframes example {
from {left: 50px;}
to {left: 100%;}
}
@keyframes example1 {
from {opacity:0;}
to {opacity:1;}
}
img
{
position:absolute;
}
</style>
</head>

<body>
<img src=”http://seowebsiteblog.com/wp-content/uploads/2015/03/gun.jpg”>
<div id=”bullet”></div>
<div id=”nextdiv”><h2>detective sush</h2></br></br></br>New Game</br>About</br>Exit</div>
</body>
</html>

output

Comments

comments