Excalidraw — Collaborative whiteboarding made easy
Excalidraw Whiteboardtry {
function setTheme(theme) {
if (theme === “dark”) {
document.documentElement.classList.add(“dark”);
} else {
document.documentElement.classList.remove(“dark”);
}
}
function getTheme() {
const theme = window.localStorage.getItem(“excalidraw-theme”);
if (theme && theme === “system”) {
return window.matchMedia(“(prefers-color-scheme: dark)”).matches
? “dark”
: “light”;
} else {
return theme || “light”;
}
}
setTheme(getTheme());
} catch (e) {
console.error(“Error setting dark mode”, e);
}html.dark{background-color:#121212;color:#fff}// Redirect Excalidraw+ users which have auto-redirect enabled.
//
// Redirect only the bare root path, so link/room/library urls are not
// redirected.
//
// Putting into index.html for best performance (can’t redirect on server
// due to location.hash checks).
if (
window.location.pathname === “/” &&
!window.location.hash &&
!window.location.search &&
// if its present redirect
document.cookie.includes(“excplus-autoredirect=true”)
) {
window.location.href = “https://app.excalidraw.com”;
}// point into our CDN in prod, fallback to root (excalidraw.com) domain in case of issues
window.EXCALIDRAW_ASSET_PATH = [
“https://excalidraw.nyc3.cdn.digitaloceanspaces.com/oss/”,
“/”,
];// setting this so that libraries installation reuses this window tab.
window.name = “_excalidraw”;body,html{margin:0;-webkit-text-size-adjust:100%;width:100%;height:100%;overflow:hidden}.visually-hidden{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap;user-select:none}#root{height:100%;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (min-width:1200px){#root{-webkit-touch-callout:default;-webkit-user-select:auto;-khtml-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}}You need to enable JavaScript to run this app.
Excalidraw
// need to load this script dynamically bcs. of iframe embed tracking
var scriptEle = document.createElement(“script”);
scriptEle.setAttribute(
“src”,
“https://scripts.simpleanalyticscdn.com/latest.js”,
);
scriptEle.setAttribute(“type”, “text/javascript”);
scriptEle.setAttribute(“defer”, true);
scriptEle.setAttribute(“async”, true);
// if iframe
if (window.self !== window.top) {
scriptEle.setAttribute(“data-auto-collect”, true);
}
document.body.appendChild(scriptEle);
// if iframe
if (window.self !== window.top) {
scriptEle.addEventListener(“load”, () => {
if (window.sa_pageview) {
window.window.sa_event(action, {
category: “iframe”,
label: “embed”,
value: window.location.pathname,
});
}
});
}


