aboutsummaryrefslogtreecommitdiffstats
path: root/excalidraw-app/index.html
blob: 0e7772f97628974f9b1efde38f59544f08acab21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>kj-diagramming | Hand-drawn look & feel • Collaborative • Secure</title>
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover, shrink-to-fit=no"
    />
    <meta name="referrer" content="origin" />
    <meta name="mobile-web-app-capable" content="yes" />
    <meta name="theme-color" content="#121212" />

    <!-- Primary Meta Tags -->
    <meta
      name="title"
      content="kj-diagramming — Collaborative whiteboarding made easy"
    />
    <meta
      name="description"
      content="kj-diagramming is a virtual collaborative whiteboard tool (an excalidraw fork) that lets you easily sketch diagrams with a hand-drawn feel."
    />
    <meta name="image" content="/og-image-3.png" />

    <!-- Open Graph / Facebook -->
    <meta property="og:site_name" content="kj-diagramming" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="/" />
    <meta
      property="og:title"
      content="kj-diagramming — Collaborative whiteboarding made easy"
    />
    <meta property="og:image:alt" content="kj-diagramming logo" />
    <meta
      property="og:description"
      content="kj-diagramming is a virtual collaborative whiteboard tool (an excalidraw fork) that lets you easily sketch diagrams with a hand-drawn feel."
    />
    <meta property="og:image" content="/og-image-3.png" />

    <!-- Twitter -->
    <meta property="twitter:card" content="summary_large_image" />
    <meta property="twitter:site" content="@kjdiagramming" />
    <meta property="twitter:url" content="/" />
    <meta
      property="twitter:title"
      content="kj-diagramming — Collaborative whiteboarding made easy"
    />
    <meta
      property="twitter:description"
      content="kj-diagramming is a virtual collaborative whiteboard tool (an excalidraw fork) that lets you easily sketch diagrams with a hand-drawn feel."
    />
    <meta
      property="twitter:image"
      content="/og-image-3.png"
    />

    <link rel="canonical" href="/" />

    <!------------------------------------------------------------------------->
    <!--   to minimize white flash on load when user has dark mode enabled   -->
    <script>
      try {
        function setTheme(theme) {
          if (theme === "dark") {
            document.documentElement.classList.add("dark");
          } else {
            document.documentElement.classList.remove("dark");
          }
        }

        function getTheme() {
          const theme = window.localStorage.getItem("kj-diagramming-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);
      }
    </script>
    <style>
      html.dark {
        background-color: #121212;
        color: #fff;
      }
    </style>

    <!-- Warmup the connection for Google fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />

    <!------------------------------------------------------------------------->
    <% if (typeof PROD != 'undefined' && PROD == true) { %>
    <script>
      // Redirect plus 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")
      ) {
        // disabled in this fork
      }
    </script>

    <!-- Following placeholder is replaced during the build step -->
    <!-- PLACEHOLDER:EXCALIDRAW_APP_FONTS -->

    <!-- Register Assistant as the UI font, before the scene inits -->
    <link
      rel="stylesheet"
      href="../packages/excalidraw/fonts/fonts.css"
      type="text/css"
    />

    <% } else { %>
    <script>
      window.EXCALIDRAW_ASSET_PATH = window.origin;
    </script>
    <% } %>

    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />

    <!-- kj-diagramming version -->
    <meta name="version" content="{version}" />

    <% if (typeof VITE_APP_DEV_DISABLE_LIVE_RELOAD != 'undefined' &&
    VITE_APP_DEV_DISABLE_LIVE_RELOAD == true) { %>
    <script>
      {
        const _WebSocket = window.WebSocket;
        window.WebSocket = function (url) {
          if (/ws:\/\/localhost:.+?\/sockjs-node/.test(url)) {
            console.info(
              "[!!!] Live reload is disabled via VITE_APP_DEV_DISABLE_LIVE_RELOAD [!!!]",
            );
          } else {
            return new _WebSocket(url);
          }
        };
      }
    </script>
    <% } %>
    <script>
      // setting this so that libraries installation reuses this window tab.
      window.name = "_kj-diagramming";
    </script>

    <!-- FIXME: remove this when we update CRA (fix SW caching) -->
    <style>
      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;
        }
      }
    </style>
  </head>

  <body>
    <noscript> You need to enable JavaScript to run this app. </noscript>
    <header>
      <h1 class="visually-hidden">kj-diagramming</h1>
    </header>
    <div id="root"></div>
    <script type="module" src="index.tsx"></script>
    <% if (typeof PROD != 'undefined' && PROD == true) { %>
    <!-- 100% privacy friendly analytics -->
    <script>
      // 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,
            });
          }
        });
      }
    </script>
    <!-- end LEGACY GOOGLE ANALYTICS -->
    <% } %>
  </body>
</html>