Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions field.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,15 @@
/* --------------------------------------------------------- observe --- */

readPalette();
resize();

if (reduced.matches) settle(); else start();
const initialize = () => {
resize();
if (reduced.matches) settle(); else start();
};
// Keep script evaluation and canvas construction in separate tasks on
// coarse-pointer devices. The field appears on the next paint while the
// foreground remains responsive during mobile startup.
if (coarseField) requestAnimationFrame(initialize);
else initialize();

let resizeTimer = 0;
let lastW = window.innerWidth;
Expand Down