I'm trying to make an animated css sprite responsive. I have a div which background's an image loaded from a stylesheet and it changes each 0.5 seconds so it "moves". The thing is that i would like to, dynamically, change the size of this div (and its backgorund) if the browser is resized. I've tried lots of solutions i've read here, but anything works.
What i have right now is
**HTML**
<div class="atomic"></div>
**CSS**
.atomic {
position: absolute;
width: 628px;
height: 231px;
background-image: url("../img/atomic.png");
}
.blinking-atomic {
-webkit-animation: blinking-atomic steps(4) 3s infinite;
animation: blinking-atomic steps(4) 3s infinite;
}
@-webkit-keyframes blinking-atomic {
from {
background-position: 0 -231px;
}
to {
background-position: 133.4% -231px;
}
}
**JSON** (i'm using angular so i load some values from a json file to my css)
"class": "atomic blinking-atomic",
"colocar" :
{
"fondo_height" : 1920,
"fondo_width" : 1020,
"left": 25,
"top": 17,
"width": 628,
"height": 231,
"z-index":99
}
I've tried many solutions and none worked. I even read that is not possible to make animated css sprites responsive. Any idea? Should i forget doing it dynamically and create the standard "@media" tags in my css?
TY