From ac78a0bdb5b6b110e87b813a66db44d90896ab10 Mon Sep 17 00:00:00 2001 From: Abbas Majidov Date: Sun, 3 Mar 2024 08:07:27 +0400 Subject: [PATCH] optimize low memory device --- sketch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sketch.js b/sketch.js index 290993e..1b5e41f 100644 --- a/sketch.js +++ b/sketch.js @@ -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