{"version":3,"sources":["motion.mjs"],"sourcesContent":["// MOTION FOR PLAYERS WHO ASKED FOR LESS (EXP-06).\n//\n// The game's biggest moments are camera moves: the dive from a galaxy into a star system, the bloom of stars as it\n// happens, and the one-second dive from orbit to a world's surface (and back up). For a player whose device is set\n// to reduce motion (a vestibular disorder, migraine, motion sickness), large sweeping camera motion is exactly what\n// that setting exists to avoid, and speeding it up is no answer, because faster sweeping motion is worse. So each of\n// those moves CUTS instead: it completes on the next frame, and the player arrives where they were going.\n//\n// The preference is read at the moment of each move, not once at load, so changing it in the system settings takes\n// effect without a reload. Small UI transitions (panels, buttons) already honour it in CSS; this is for the moves\n// the renderer drives itself.\n\nlet _mq, _asked = false;\n// THE GAME'S OWN SWITCH (Settings → Game → Reduce motion, the menu-panels plan, Oct 6): a player may ask for less motion\n// here without changing their whole device. Either one asking is enough; neither can switch the other off.\nexport function setReducedMotion(on) { _asked = !!on; }\nexport function prefersReducedMotion() {\n  if (_asked) return true;\n  try {\n    if (_mq === undefined) _mq = (globalThis.matchMedia && globalThis.matchMedia('(prefers-reduced-motion: reduce)')) || null;\n    return !!(_mq && _mq.matches);\n  } catch (e) { return false; }\n}\n\n// The duration a camera move should take: its own, or one millisecond (the next frame) for a player who asked for\n// less motion. Never zero, because callers divide by it.\nexport function motionMs(ms, reduced = prefersReducedMotion()) {\n  return reduced ? 1 : ms;\n}\n"],"mappings":"AAYA,IAAI,IAAK,OAAS,GAGX,gBAAS,iBAAiB,GAAI,CAAE,OAAS,CAAC,CAAC,EAAI,CAC/C,gBAAS,sBAAuB,CACrC,GAAI,OAAQ,MAAO,GACnB,GAAI,CACF,OAAI,MAAQ,SAAW,IAAO,WAAW,YAAc,WAAW,WAAW,kCAAkC,GAAM,MAC9G,CAAC,EAAE,KAAO,IAAI,QACvB,MAAY,CAAE,MAAO,EAAO,CAC9B,CAIO,gBAAS,SAAS,GAAI,QAAU,qBAAqB,EAAG,CAC7D,OAAO,QAAU,EAAI,EACvB","names":[],"file":"motion.mjs"}