From: Ardis Lu Date: Wed, 7 Jun 2023 05:51:02 +0000 (-0700) Subject: Consolidate rng X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=1a0cf6d95ecb422e73875f50c95ecd118f0debdf;p=minimal-masonry Consolidate rng --- diff --git a/index.html b/index.html index 4398157..8708657 100644 --- a/index.html +++ b/index.html @@ -160,9 +160,8 @@ const main = document.querySelector('main'); main.insertAdjacentHTML('beforeend', '

'.repeat(20)); - let rng = new Uint16Array(40); // 2 values used per object = 20 total objects - window.crypto.getRandomValues(rng); - rng = [...rng]; // Need to spread to a non-typed array to use .pop() + // Need to spread to a non-typed array to use .pop() + const rng = [...crypto.getRandomValues(new Uint16Array(40))]; // 2 values used per object = 20 total objects // All length units are px const gridRowHeight = 8;