Skip to content

Commit

Permalink
optimize low memory device
Browse files Browse the repository at this point in the history
  • Loading branch information
absmj committed Mar 3, 2024
1 parent 2cf2b04 commit ac78a0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let sketch = {
},

numberOfDots(dotCount) {
if(navigator.deviceMemory) return navigator.deviceMemory * 512;
if(navigator.deviceMemory) return navigator.deviceMemory * (navigator.deviceMemory >= 1 ? 512 : 256);
else {
console.warn("Your browser doesn't support navigator.deviceMemory, so we can't define the optimal number of dots for you.")
return dotCount
Expand Down

0 comments on commit ac78a0b

Please sign in to comment.