> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baselayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Playground

> Build a hosted enrollment journey in Console's builder, brand it, and go through it as an applicant.

export const EnrollmentPlayground = () => {
  const frameRef = useRef(null);
  useEffect(() => {
    const frame = frameRef.current;
    let observer = null;
    const track = () => {
      const page = frame.contentDocument;
      if (!page) {
        return;
      }
      const rect = frame.getBoundingClientRect();
      const top = Math.max(0, -rect.top);
      const bottom = Math.max(top, Math.min(rect.height, window.innerHeight - rect.top));
      const style = page.documentElement.style;
      style.setProperty("--playground-visible-top", `${top}px`);
      style.setProperty("--playground-visible-height", `${bottom - top}px`);
      style.setProperty("--playground-visible-bottom", `${rect.height - bottom}px`);
    };
    const fit = () => {
      const page = frame.contentDocument;
      observer?.disconnect();
      observer = new ResizeObserver(() => {
        frame.style.height = `${Math.ceil(page.body.getBoundingClientRect().height)}px`;
        track();
      });
      observer.observe(page.body);
      track();
    };
    document.addEventListener("scroll", track, {
      capture: true,
      passive: true
    });
    window.addEventListener("resize", track);
    if (frame.contentDocument?.readyState === "complete") {
      fit();
    }
    frame.addEventListener("load", fit);
    return () => {
      frame.removeEventListener("load", fit);
      document.removeEventListener("scroll", track, {
        capture: true
      });
      window.removeEventListener("resize", track);
      observer?.disconnect();
    };
  }, []);
  const page = `<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <style>
      @font-face {
        font-family: "Uncut Sans";
        src: url("/fonts/UncutSans-Variable.woff2") format("woff2");
        font-weight: 100 900;
      }
      /* Console's toasts name the family "UncutSans", as production Console registers it. */
      @font-face {
        font-family: "UncutSans";
        src: url("/fonts/UncutSans-Variable.woff2") format("woff2");
        font-weight: 100 900;
      }
      @font-face {
        font-family: "Season Mix";
        src: url("/fonts/SeasonMix-Variable.woff2") format("woff2");
        font-weight: 100 900;
      }
      body {
        margin: 0;
      }
      #enrollment-playground > p {
        font: 15px/1.5 "Uncut Sans", system-ui, sans-serif;
        margin: 0;
        padding: 24px;
      }
    </style>
  </head>
  <body>
    <div id="enrollment-playground"><p>The playground could not load. Reload the page; if this persists, contact support@baselayer.com.</p></div>
    <script>
      {
        const url = "/assets/enrollment-playground/enrollment-playground.json?v=e3702519cedc";
        const container = document.getElementById("enrollment-playground");
        const failed = container.innerHTML;
        container.replaceChildren();
        fetch(url)
          .then((response) => {
            if (!response.ok) {
              throw new Error("HTTP " + response.status);
            }
            return response.json();
          })
          .then(({ source }) => {
            if (typeof source !== "string") {
              throw new Error("no source script");
            }
            const script = document.createElement("script");
            script.textContent = source;
            // An inline script runs inside append, so this sees only a throw at startup.
            const startup = (event) => {
              console.error("Playground bundle " + url + ":", event.error);
              container.innerHTML = failed;
            };
            window.addEventListener("error", startup);
            document.body.append(script);
            window.removeEventListener("error", startup);
          })
          .catch((error) => {
            console.error("Playground bundle " + url + ":", error);
            container.innerHTML = failed;
          });
      }
    </script>
  </body>
</html>`;
  return <iframe allow="clipboard-read; clipboard-write" ref={frameRef} srcDoc={page} style={{
    border: 0,
    display: "block",
    height: "900px",
    width: "100%"
  }} title="Hosted enrollment playground" />;
};

This is Console's journey builder, running entirely in your browser. Build a journey, brand it with your own colors, logo and font, save it, then use **Copy Test Link** to go through it as an applicant. Nothing is sent anywhere: journeys, logos and fonts stay in this tab, and the businesses and the applicant are made up. Uploaded logos and fonts stay in the editor, so test links and shared links show the default ones.

<div className="not-prose overflow-hidden rounded-xl border border-gray-200 dark:border-gray-800">
  <EnrollmentPlayground />
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.