Spaces:
Running
Running
Update templates/index.html
Browse files- templates/index.html +11 -11
templates/index.html
CHANGED
@@ -36,17 +36,17 @@
|
|
36 |
|
37 |
<script>
|
38 |
window.addEventListener("message", (event) => {
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
});
|
51 |
|
52 |
const API_BASE_URL = window.location.origin;
|
|
|
36 |
|
37 |
<script>
|
38 |
window.addEventListener("message", (event) => {
|
39 |
+
// Temporarily allow all origins for testing
|
40 |
+
// Later: if (event.origin !== "https://juit-ai-assistant.vercel.app") return;
|
41 |
+
|
42 |
+
const { type, theme } = event.data;
|
43 |
+
|
44 |
+
if (type === "set-theme" && (theme === "light" || theme === "dark")) {
|
45 |
+
// Set theme via class or attribute
|
46 |
+
document.documentElement.classList.toggle("dark", theme === "dark");
|
47 |
+
document.body.classList.toggle("dark", theme === "dark");
|
48 |
+
console.log("Theme set to:", theme);
|
49 |
+
}
|
50 |
});
|
51 |
|
52 |
const API_BASE_URL = window.location.origin;
|