Particles squeezed on top on mobile devices
riccardoratta opened this issue · comments
When I load the script on a mobile device with Google Chrome (I've not tested on other browsers) the particles are squeezed on top.
But after a change of resolution (without reloading the page):
The code in the page:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Title</title>
</head>
<body>
<style>
.background {
position: absolute;
display: block;
top: 0;
left: 0;
z-index: -1;
background-color: #222;
}
</style>
<canvas class="background"></canvas>
<script src="scripts/particles.min.js"></script>
<script>
window.onload = function() {
Particles.init({
maxParticles: 50,
selector: '.background',
color: '#ffffff',
connectParticles: true,
});
};
</script>
</body>
</html>
It was the meta viewport, replace it to solve the problem.
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, maximum-scale=1.0">