Add WebSocket integration for Lanyard and Hyperate, implement scanline effects, and update dependencies

This commit is contained in:
Seth 2025-05-03 13:17:52 -04:00
parent 4fedd38df1
commit 09e377b9d2
11 changed files with 319 additions and 42 deletions

View file

@ -0,0 +1,19 @@
import { createRef } from "tsx-dom";
import microlight from "microlight";
import socket from "../../Socket";
export default () => {
const paragraph = createRef<HTMLParagraphElement>();
socket.addEventListener('hyperate', (event: Event) => {
const heartRate = (event as CustomEvent).detail;
if (paragraph.current) {
paragraph.current.innerText = `${heartRate} BPM`;
}
microlight.reset();
});
return <div>
<p class="microlight" ref={paragraph}>0 BPM</p>
</div>;
}