forked from seth/ipv4.army
Add WebSocket integration for Lanyard and Hyperate, implement scanline effects, and update dependencies
This commit is contained in:
parent
4fedd38df1
commit
09e377b9d2
11 changed files with 319 additions and 42 deletions
19
src/components/Hyperate/index.tsx
Normal file
19
src/components/Hyperate/index.tsx
Normal 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>;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue