2023-04-06 01:33:08 +02:00
|
|
|
<script lang="ts">
|
|
|
|
// Testing grounds
|
2023-12-19 22:21:34 +01:00
|
|
|
import Motion from "../Sensors/Motion"
|
|
|
|
import { Store, Stores } from "../Logic/UIEventSource"
|
|
|
|
|
|
|
|
let maxAcc = Motion.singleton.maxAcc
|
2023-12-21 01:46:18 +01:00
|
|
|
let shaken = Motion.singleton.lastShakeEvent
|
|
|
|
let recentlyShaken = Stores.Chronic(250).mapD(
|
|
|
|
(now) => now.getTime() - 3000 < shaken.data?.getTime()
|
|
|
|
)
|
2023-04-06 01:33:08 +02:00
|
|
|
</script>
|
2023-12-01 15:23:28 +01:00
|
|
|
|
2023-12-19 22:21:34 +01:00
|
|
|
Acc: {$maxAcc}
|
|
|
|
{#if $recentlyShaken}
|
2023-12-21 01:46:18 +01:00
|
|
|
<div class="text-5xl text-red-500">SHAKEN</div>
|
|
|
|
{/if}
|