|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | + <meta name="google" value="notranslate"> |
| 7 | + <meta name="description" content="NitroBolt is a TurboWarp mod with many changes that builds upon and enhances TurboWarp with many useful features." /> |
| 8 | + <title>NitroBolt - Editor</title> |
| 9 | + <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> |
| 10 | + |
| 11 | + <link rel="manifest" href="manifest.webmanifest"> |
| 12 | + |
| 13 | + <style> |
| 14 | + .splash-screen { |
| 15 | + position: absolute; |
| 16 | + width: 100%; |
| 17 | + height: 100%; |
| 18 | + top: 0; |
| 19 | + left: 0; |
| 20 | + display: flex; |
| 21 | + flex-direction: column; |
| 22 | + gap: 1rem; |
| 23 | + align-items: center; |
| 24 | + justify-content: center; |
| 25 | + text-align: center; |
| 26 | + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; |
| 27 | + } |
| 28 | + .splash-screen[hidden] { |
| 29 | + display: none; |
| 30 | + } |
| 31 | + .splash-screen[data-theme="dark"] { |
| 32 | + background-color: #333; |
| 33 | + color: white; |
| 34 | + } |
| 35 | + .splash-screen > * { |
| 36 | + max-width: 80%; |
| 37 | + } |
| 38 | + .splash-spinner:after { |
| 39 | + content: " "; |
| 40 | + display: block; |
| 41 | + width: 64px; |
| 42 | + height: 64px; |
| 43 | + border-radius: 50%; |
| 44 | + border: 6px solid; |
| 45 | + border-color: currentColor transparent currentColor transparent; |
| 46 | + animation: splash-spinner 1.2s linear infinite; |
| 47 | + } |
| 48 | + @keyframes splash-spinner { |
| 49 | + 0% { transform: rotate(0deg); } |
| 50 | + 100% { transform: rotate(360deg); } |
| 51 | + } |
| 52 | + .splash-error-title { |
| 53 | + font-weight: bold; |
| 54 | + } |
| 55 | + .splash-error-title a { |
| 56 | + color: inherit; |
| 57 | + } |
| 58 | + .splash-errors { |
| 59 | + font-family: monospace; |
| 60 | + } |
| 61 | + .splash-error-list { |
| 62 | + white-space: pre-wrap; |
| 63 | + } |
| 64 | + .splash-reset { |
| 65 | + color: inherit; |
| 66 | + background: none; |
| 67 | + padding: 0; |
| 68 | + margin: 0; |
| 69 | + border: none; |
| 70 | + text-decoration: underline; |
| 71 | + cursor: pointer; |
| 72 | + } |
| 73 | + .splash-reset:disabled { |
| 74 | + opacity: 0.8; |
| 75 | + } |
| 76 | + </style> |
| 77 | + </head> |
| 78 | + <body> |
| 79 | + <noscript> |
| 80 | + <div class="splash-screen"> |
| 81 | + <div> |
| 82 | + <h1>NitroBolt requires JavaScript</h1> |
| 83 | + <p>Consider using <a href="https://desktop.nitrobolt.org/">Nitrobolt Desktop</a> if you are afraid of remote JavaScript.</p> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + </noscript> |
| 87 | + |
| 88 | + <div class="splash-screen spash-waiting-for-js" hidden> |
| 89 | + <div class="splash-spinner"></div> |
| 90 | + <div class="splash-error-title" hidden>Something went wrong. <a href="https://scratch.mit.edu/users/CubesterYT/#comments" target="_blank" rel="noreferrer">Please report</a> with the information below.</div> |
| 91 | + <div class="splash-errors" hidden></div> |
| 92 | + <button class="splash-reset" hidden>Click here to reset caches (can fix some errors)</button> |
| 93 | + </div> |
| 94 | + |
| 95 | + <script> |
| 96 | + (function () { |
| 97 | + 'use strict'; |
| 98 | + |
| 99 | + var theme = ''; |
| 100 | + var accent = '#ff5726'; |
| 101 | + |
| 102 | + try { |
| 103 | + var themeSetting = localStorage.getItem('tw:theme'); |
| 104 | + } catch (e) { |
| 105 | + // ignore |
| 106 | + } |
| 107 | + if (themeSetting === 'light') { |
| 108 | + theme = 'light'; |
| 109 | + } else if (themeSetting === 'dark') { |
| 110 | + theme = 'dark'; |
| 111 | + } else if (themeSetting) { |
| 112 | + try { |
| 113 | + var parsed = JSON.parse(themeSetting); |
| 114 | + if (parsed.accent === 'purple') { |
| 115 | + accent = '#855cd6'; |
| 116 | + } else if (parsed.accent === 'blue') { |
| 117 | + accent = '#4c97ff'; |
| 118 | + } else if (parsed.accent === 'red') { |
| 119 | + accent = '#ff4c4c'; |
| 120 | + } |
| 121 | + if (parsed.gui === 'dark' || parsed.gui === 'light') { |
| 122 | + theme = parsed.gui; |
| 123 | + } |
| 124 | + } catch (e) { |
| 125 | + // ignore |
| 126 | + } |
| 127 | + } |
| 128 | + |
| 129 | + if (!theme) { |
| 130 | + theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; |
| 131 | + } |
| 132 | + |
| 133 | + var splash = document.querySelector('.spash-waiting-for-js'); |
| 134 | + splash.setAttribute('data-theme', theme); |
| 135 | + if (theme !== 'dark') { |
| 136 | + |
| 137 | + splash.style.backgroundColor = accent; |
| 138 | + splash.style.color = 'white'; |
| 139 | + |
| 140 | + } |
| 141 | + splash.hidden = false; |
| 142 | + |
| 143 | + var splashErrorTitle = document.querySelector('.splash-error-title'); |
| 144 | + var splashError = document.querySelector('.splash-errors'); |
| 145 | + var splashReset = document.querySelector('.splash-reset'); |
| 146 | + |
| 147 | + var totalErrors = 0; |
| 148 | + window.onerror = function (event, source, line, col, err) { |
| 149 | + if (++totalErrors > 5) return; // dont bother logging more |
| 150 | + splashErrorTitle.hidden = splashError.hidden = splashReset.hidden = false; |
| 151 | + var el = document.createElement('div'); |
| 152 | + el.textContent = 'Error (splash) in ' + source + ' (' + line + ':' + col + '): ' + err; |
| 153 | + splashError.appendChild(el); |
| 154 | + }; |
| 155 | + |
| 156 | + splashReset.onclick = function () { |
| 157 | + splashReset.disabled = true; |
| 158 | + function hardRefresh() { |
| 159 | + var search = location.search.replace(/[?&]nocache=[\d.]+(?=$|&)/, ''); |
| 160 | + // This is a functional cookie used so that we respond with Clear-Site-Data just once. No tracking. |
| 161 | + // Can't use nocache parameter to trigger this because people might accidentally bookmark that, and |
| 162 | + // then we would be clearing their cache on every visit. |
| 163 | + document.cookie = 'tw_clear_cache_once=1; max-age=60; path=/; samesite=strict; secure'; |
| 164 | + location.replace(location.pathname + search + (search ? '&' : '?') + 'nocache=' + Math.floor(Math.random() * 10000000)); |
| 165 | + } |
| 166 | + if ('serviceWorker' in navigator) { |
| 167 | + setTimeout(hardRefresh, 5000); |
| 168 | + navigator.serviceWorker.getRegistration("") |
| 169 | + .then(function(registration) { |
| 170 | + if (registration) { |
| 171 | + return registration.unregister(); |
| 172 | + } |
| 173 | + }) |
| 174 | + .then(hardRefresh) |
| 175 | + .catch(hardRefresh); |
| 176 | + } else { |
| 177 | + hardRefresh(); |
| 178 | + } |
| 179 | + }; |
| 180 | + |
| 181 | + window.SplashEnd = () => { |
| 182 | + splash.hidden = true; |
| 183 | + window.onerror = null; |
| 184 | + }; |
| 185 | + })(); |
| 186 | + </script> |
| 187 | + |
| 188 | + <div id="app"></div> |
| 189 | + <script src="js/vendors~addon-settings~credits~editor~embed~fullscreen~player.js"></script><script src="js/vendors~editor~embed~fullscreen~player.js"></script><script src="js/addon-settings~editor~embed~fullscreen~player.js"></script><script src="js/editor~embed~fullscreen~player.js"></script><script src="js/editor.js"></script></body> |
| 190 | +</html> |
0 commit comments