I have circles starting at a radius of 10px and expanding up to 100%. The circles appear at random positions all over the viewport. The animation looks fine on mobile but pixelates on larger viewports.
Here's the animation: https://rimildeyjsr.github.io/spotify-circle-animation/
Any ideas how to keep the circles consistent across all viewports?
jQuery
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
function makeDiv(colorChoice){
var divsize = 10;
var color = colorChoice;
console.log(color);
$newdiv = $('<div/>').css({
'width':divsize+'px',
'height':divsize+'px',
'background-color': color
});
var posx = (Math.random() * ($(document).width())).toFixed();
var posy = (Math.random() * ($(document).height())).toFixed();
$newdiv.css({
'position':'absolute',
'left':posx+'px',
'top':posy+'px',
'border-radius':'50%',
'display':'none'
}).appendTo( 'body' ).addClass('animate').css({'display':'block'}).one(animationEnd,function(){
$(this).remove();
});
};
var id = setInterval(function(){makeDiv('black')},5000);
CSS
html,body {
padding : 0;
margin: 0;
height: 100%;
width: 100%;
overflow-y: hidden;
overflow-x: hidden;
}
div {
height: 10px;
width:10px;
background-color: black;
border-radius: 50%;
top: 250px;
right: 10px;
left: 800px;
}
.animate {
-webkit-animation: expand 60s;
}
@-webkit-keyframes expand {
0%{
-webkit-transform: scale(0,0);
}
100%{
-webkit-transform: scale(100.0,100.0);
display: none;
}
}