Skip to content

Commit 8b86dd1

Browse files
committed
Make startup errors more prominent and clear.
Also recommend TurboWarp Packager because it is cooler and more epic
1 parent bfdf427 commit 8b86dd1

6 files changed

Lines changed: 74 additions & 32 deletions

File tree

index.bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,42 @@ <h3><em>Convert a Scratch project to HTML</em></h3>
9999
contains the entire Scratch engine (2.6 MB) and the costume and sound
100100
files used in the project.
101101
</p>
102-
<p>
103-
The HTMLifier may not be the best option for you; refer to the
104-
<a href="#see-also">See also section</a> for alternatives.
105-
</p>
102+
<div class="notice info">
103+
<p>
104+
Note: The
105+
<strong
106+
><a href="https://packager.turbowarp.org/"
107+
>TurboWarp Packager</a
108+
></strong
109+
>
110+
has better performance and can produce .exe files. Refer to the
111+
<a href="#see-also">See also section</a> for more alternatives.
112+
</p>
113+
</div>
106114
<div id="root">
107115
<noscript>
108-
<p class="problem">
109-
Please enable JavaScript. Converting projects can't be done with
110-
HTML and CSS alone.
111-
</p>
116+
<div class="notice start-warning">
117+
<p>
118+
Please enable JavaScript. Converting projects can't be done with
119+
HTML and CSS alone.
120+
</p>
121+
</div>
112122
</noscript>
113-
<p class="problem delayed">
114-
If you see this, you can check to see if there were
115-
<a href="#errors">any issues</a> loading the HTMLifier. Make sure
116-
you're using a modern browser.
117-
</p>
123+
<div class="notice start-warning hidden" id="js-enabled">
124+
<p>
125+
If you see this, you can check to see if there were
126+
<a href="#errors">any issues</a> loading the HTMLifier. Make sure
127+
you're using a modern browser.
128+
</p>
129+
<p class="hidden" id="no-nullish-coalescing">
130+
Your browser does not support modern JavaScript features; check to
131+
make sure
132+
<a
133+
href="https://caniuse.com/mdn-javascript_operators_nullish_coalescing"
134+
>your browser is modern</a
135+
>.
136+
</p>
137+
</div>
118138
</div>
119139
<p>
120140
If you want to view or edit the HTML file, you can use the specialized
@@ -129,6 +149,15 @@ <h2 id="updates">Update history</h2>
129149
See the code and previous versions on
130150
<a href="https://github.com/SheepTester/htmlifier/">Github</a>.
131151
</p>
152+
<h3>
153+
2021-08-12 (<a
154+
href="https://github.com/SheepTester/htmlifier/releases/download/v1.0.2/htmlifier-offline.html"
155+
>download</a
156+
>)
157+
</h3>
158+
<ul>
159+
<li>Fixed connecting to cloud servers.</li>
160+
</ul>
132161
<h3>
133162
2021-08-09 (<a
134163
href="https://github.com/SheepTester/htmlifier/releases/download/v1.0.1/htmlifier-offline.html"
@@ -480,8 +509,8 @@ <h2 id="see-also">See also</h2>
480509
<p>
481510
If you want better performance, <em>compile</em> the project to
482511
JavaScript:
483-
<a href="https://phosphorus.github.io/">Phosphorus</a> (Scratch 2.0),
484-
<a href="https://forkphorus.github.io/">Forkphorus</a>, and
512+
<a href="https://phosphorus.github.io/">Phosphorus</a> (Scratch 2.0
513+
only), <a href="https://forkphorus.github.io/">Forkphorus</a>, and
485514
<a href="https://turbowarp.org/">TurboWarp</a>.
486515
</p>
487516
<p>
@@ -500,6 +529,16 @@ <h2 id="see-also">See also</h2>
500529
}
501530
window.onNewError()
502531
}
532+
try {
533+
eval('0 ?? 0')
534+
} catch (_) {
535+
var oldBrowserNotice = document.getElementById('no-nullish-coalescing')
536+
oldBrowserNotice.className = ''
537+
}
538+
var hasJs = document.getElementById('js-enabled')
539+
if (hasJs) {
540+
hasJs.classList.remove('hidden')
541+
}
503542
</script>
504543
</body>
505544
</html>

main.css

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,22 @@ body {
5252
font-weight: bold;
5353
color: #faa;
5454
}
55-
.delayed {
56-
animation: appear 0.5s 3s backwards;
57-
}
58-
@keyframes appear {
59-
from {
60-
opacity: 0;
61-
pointer-events: none;
62-
user-select: none;
63-
visibility: hidden;
64-
}
65-
to {
66-
opacity: 1;
67-
}
55+
.hidden {
56+
display: none;
57+
}
58+
.notice {
59+
border-radius: 5px;
60+
padding: 5px 20px;
61+
border-left: 5px solid white;
62+
margin: 1em 0;
63+
}
64+
.start-warning {
65+
background-color: rgba(255, 195, 0, 0.3);
66+
border-color: #ffc300;
67+
}
68+
.info {
69+
background-color: rgba(2, 185, 255, 0.2);
70+
border-color: #02b9ff;
6871
}
6972
#root,
7073
.footnotes {

node/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ main()
6161
## Documentation
6262

6363
[Auto-generated
64-
documentation](https://doc.deno.land/https/github.com/SheepTester/htmlifier/raw/v1.0.0/src/htmlifier.ts)
64+
documentation](https://doc.deno.land/https/github.com/SheepTester/htmlifier/raw/v1.0.2/src/htmlifier.ts)
6565
is available courtesy of deno doc.

node/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sheeptester/htmlifier",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Packages a Scratch project in an HTML file with no optimisations.",
55
"type": "module",
66
"main": "index.min.js",

0 commit comments

Comments
 (0)