forked from seth/ipv4.army
f
This commit is contained in:
parent
b76e879350
commit
9a1564cdb5
10 changed files with 212 additions and 57 deletions
|
@ -7,13 +7,22 @@ export default () => {
|
|||
|
||||
socket.addEventListener("hyperate", (event: Event) => {
|
||||
const heartRate = (event as CustomEvent).detail;
|
||||
|
||||
if (heartRate === 0) {
|
||||
document.body.style.setProperty("--hyperate-display", "none");
|
||||
} else {
|
||||
document.body.style.removeProperty("--hyperate-display");
|
||||
}
|
||||
|
||||
document.body.style.setProperty("--bpm", heartRate.toString());
|
||||
|
||||
if (paragraph.current) {
|
||||
paragraph.current.innerText = `${heartRate} BPM`;
|
||||
paragraph.current.innerText = `❤️ ${heartRate} BPM`;
|
||||
}
|
||||
});
|
||||
return (
|
||||
<div>
|
||||
<p ref={paragraph}>0 BPM</p>
|
||||
<p class="heartbeat" ref={paragraph}>❤️ 0 BPM</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue