monitor-free.openapps.xyz

Source

This app’s code and revision history are public. Download a copy or explore the files below.

Public
The app’s code and revision history are public.
Owned app · rev 11d38ef641b0
Run it yourself
Take the whole tree and run it on your own machine. The download needs no account. Cloning needs a sign-in.
Download .zip
bounded clone 9383f719c9b37ff76411858f
A copy you download is not bounded. The guarantees this app runs under - declared egress, proven invariants, writes that fail closed - live in the runtime serving this page, not in the files. What you get is auditable source you can read and run, with no runtime guarantees attached.
← All files
src/main.tsx
// Monitor's entry. "/" keeps the static landing and mounts the device chooser into its hero;
// the app screens (baby station, parent, watching) hide the landing and use the night look.
import { createRoot } from "react-dom/client";
import { usePath } from "./lib/router";
import { Toaster } from "./ui";
import { Launcher } from "./Launcher";
import { BabyPage, TopBar } from "./Baby";
import { PairLinkPage, ParentPage } from "./Parent";
import { WatchPage } from "./Watch";
import "./styles.css";

function Home() {
  return (
    <div className="night">
      <div className="night-page">
        <TopBar title="Monitor" back="/" />
        <h1 className="night-h1">Free baby monitor</h1>
        <Launcher />
      </div>
    </div>
  );
}

function App() {
  const path = usePath();
  const watch = path.match(/^\/watch\/([A-Za-z0-9]{4,32})\/?$/);
  const screen =
    path === "/app" ? <Home />
      : path === "/baby" ? <BabyPage />
        : path === "/parent" ? <ParentPage />
          : path === "/pair" ? <PairLinkPage />
            : watch ? <WatchPage pairKey={watch[1]} />
              : null;
  document.body.classList.toggle("app-mode", Boolean(screen));
  return <>{screen}<Toaster /></>;
}

createRoot(document.getElementById("app")!).render(<App />);
const start = document.getElementById("start");
if (start) createRoot(start).render(<Launcher />);

if (import.meta.env.PROD && "serviceWorker" in navigator) {
  window.addEventListener("load", () => void navigator.serviceWorker.register("/sw.js").catch(() => null));
}

const head = document.querySelector(".site-head");
const onScroll = () => head?.classList.toggle("scrolled", window.scrollY > 4);
window.addEventListener("scroll", onScroll, { passive: true });
onScroll();

Change history

Move store links to openapps.free
11d38ef641 · 1 day ago
Release with preview
41c8af3ee5 · 1 day ago
Bind agent address in policy
5b2d792529 · 1 day ago
Use OpenApps service URLs and add contribution strip (retry)
be4477dcb3 · 1 day ago
Bounded source sync
5c9ec00c29 · 3 days ago
Bounded source sync
b33aa231f4 · 3 days ago
Bounded source sync
6cb67b3c8e · 3 days ago
Bounded source sync
e054acaa29 · 3 days ago