camWallControls.ts 620 B

1234567891011121314
  1. // When a Cam Wall tile shows its controls (#3479): on hover (and focus), so the
  2. // picture stays clear, or always. Touch screens have no hover and always show
  3. // them. Stored per browser, like the wall's other settings.
  4. export type CamWallControlsMode = 'hover' | 'always';
  5. export const CAM_WALL_CONTROLS_KEY = 'camWallControls';
  6. export function savedCamWallControlsMode(): CamWallControlsMode {
  7. return localStorage.getItem(CAM_WALL_CONTROLS_KEY) === 'always' ? 'always' : 'hover';
  8. }
  9. export function saveCamWallControlsMode(mode: CamWallControlsMode): void {
  10. localStorage.setItem(CAM_WALL_CONTROLS_KEY, mode);
  11. }