{#if motionPermissionAvailable || orientationPermissionAvailable}
{m.sensors_permissions()}
{#if motionPermissionAvailable}
-
{m.sensors_motion()}
{#if motionPermission === 'granted'}{m.sensors_status_granted()}
{:else if motionPermission === 'denied'}{m.sensors_status_denied()}
{:else}{m.sensors_status_unknown()}{/if}
{/if}
{#if orientationPermissionAvailable}
-
{m.sensors_orientation()}
{#if orientationPermission === 'granted'}{m.sensors_status_granted()}
{:else if orientationPermission === 'denied'}{m.sensors_status_denied()}
{:else}{m.sensors_status_unknown()}{/if}
{/if}
{/if}
{m.sensors_geolocation()}
{#if geoSupported}
{#if geoError}
{geoError}
{/if}
{#if geolocation}
- lat{geolocation.coords.latitude}
- lon{geolocation.coords.longitude}
-
{m.sensors_accuracy()}{toFixed(geolocation.coords.accuracy)}
-
{m.sensors_altitude()}{geolocation.coords.altitude ?? '—'}
-
{m.sensors_heading()}{toFixed(geolocation.coords.heading ?? undefined)}
-
{m.sensors_speed()}{toFixed(geolocation.coords.speed ?? undefined)}
-
{m.sensors_timestamp()}{new Date(geolocation.timestamp).toLocaleString()}
{/if}
{:else}
{m.sensors_notSupported()}
{/if}
{m.sensors_deviceMotion()}
{#if motionSupported}
- ax{toFixed(deviceMotion?.ax)}
- ay{toFixed(deviceMotion?.ay)}
- az{toFixed(deviceMotion?.az)}
- α{toFixed(deviceMotion?.gx)}
- β{toFixed(deviceMotion?.gy)}
- γ{toFixed(deviceMotion?.gz)}
{:else}
{m.sensors_notSupported()}
{/if}
{m.sensors_deviceOrientation()}
{#if orientationSupported}
- alpha{toFixed(deviceOrientation?.alpha)}
- beta{toFixed(deviceOrientation?.beta)}
- gamma{toFixed(deviceOrientation?.gamma)}
{:else}
{m.sensors_notSupported()}
{/if}
{m.sensors_accelerometer()}
{#if accelerometer.supported}
{#if !accelerometer.active}
{:else}
{/if}
{#if accelerometer.error}
{accelerometer.error}
{/if}
- x{toFixed(accelerometer.data.x as number)}
- y{toFixed(accelerometer.data.y as number)}
- z{toFixed(accelerometer.data.z as number)}
{:else}
{m.sensors_notSupported()}
{/if}
{m.sensors_gyroscope()}
{#if gyroscope.supported}
{#if !gyroscope.active}
{:else}
{/if}
{#if gyroscope.error}
{gyroscope.error}
{/if}
- x{toFixed(gyroscope.data.x as number)}
- y{toFixed(gyroscope.data.y as number)}
- z{toFixed(gyroscope.data.z as number)}
{:else}
{m.sensors_notSupported()}
{/if}
{m.sensors_magnetometer()}
{#if magnetometer.supported}
{#if !magnetometer.active}
{:else}
{/if}
{#if magnetometer.error}
{magnetometer.error}
{/if}
- x{toFixed(magnetometer.data.x as number)}
- y{toFixed(magnetometer.data.y as number)}
- z{toFixed(magnetometer.data.z as number)}
{:else}
{m.sensors_notSupported()}
{/if}
{m.sensors_ambientLight()}
{#if ambientLight.supported}
{#if !ambientLight.active}
{:else}
{/if}
{#if ambientLight.error}
{ambientLight.error}
{/if}
-
{m.sensors_illuminance()}{toFixed(ambientLight.data.illuminance as number)}
{:else}
{m.sensors_notSupported()}
{/if}
{m.sensors_barometer()}
{#if barometer.supported}
{#if !barometer.active}
{:else}
{/if}
{#if barometer.error}
{barometer.error}
{/if}
-
{m.sensors_pressure()}{toFixed(barometer.data.pressure as number)}
-
{m.sensors_temperature()}{barometer.data.temperature ?? '—'}
{:else}
{m.sensors_notSupported()}
{/if}