Various code optimizations

Everything's in the title :
- merged identical `querySelector` calls
- merged successives conditions
- improved retina display implementation (`*2`) readability
- optimized variables declarations in `distanceParticles`