Skip to content

Commit

Permalink
Changelog update, fix positioning of loading image (and hide stage wh…
Browse files Browse the repository at this point in the history
…ile it loads)
  • Loading branch information
SheepTester committed Jun 2, 2020
1 parent dd507eb commit 5b4a225
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 12 deletions.
10 changes: 10 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ <h3><em>Convert a Scratch project to HTML</em></h3>
<p id="note-4"><a href="#ref-4"><sup>4</sup></a>If a cloud variable with the name "☁ eval" is set, it'll run the variable value as JavaScript and store it in a cloud variable named "☁ eval output"; if there is an error, it'll be stored in "☁ eval error." If you're using a custom cloud server, then cloud variables whose names start with "☁ local storage" will store their values in localStorage instead of in the server.</p>
<h2>Update history</h2>
<p>See the code and previous versions on <a href="https://github.com/SheepTester/htmlifier/">Github</a>.</p>
<h3>2020-06-01</h3>
<ul>
<li>Option to remove clone/list length limits</li>
<li>Option to hide the cursor</li>
<li>Ability to distinguish between cloud variables for localStorage and the server (and run JavaScript using cloud variables)</li>
<li>Option for rudimentary pointer lock</li>
<li>Fixed mouse position and unresized lists not showing</li>
<li>Default project changed to one of <a href="https://scratch.mit.edu/users/ScratchCat/">ScratchCat</a>'s</li>
<li>Unfortunately, as part of these changes, I removed the option for a progress bar. If there's demand, I'll try to add it back.</li>
</ul>
<h3>2020-05-01</h3>
<ul>
<li>Support for custom extensions from a URL</li>
Expand Down
38 changes: 26 additions & 12 deletions template.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
position: relative;
% no-cursor % cursor: none; % /no-cursor %
}
.loading #wrapper {
visibility: hidden;
}
#monitors {
position: absolute;
top: 0;
Expand Down Expand Up @@ -64,6 +67,11 @@
position: fixed;
max-width: 100%;
max-height: 100%;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
}
% /loading-image %
% fullscreen %
Expand Down Expand Up @@ -204,7 +212,12 @@
}
</style>
</head>
<body>
<body class="loading">
<script type="text/javascript">
if (true % loading-image % && false % /loading-image %) {
document.body.classList.remove('loading');
}
</script>
<div id="wrapper">
<canvas id="stage"></canvas>
<div id="monitors"></div>
Expand Down Expand Up @@ -921,17 +934,6 @@
.then(r => r.arrayBuffer())
.then(b => vm.loadProject(b))

% loading-progress %
if (progress.parentNode) {
progress.parentNode.removeChild(progress);
}
% /loading-progress %
% loading-image %
if (loadingImage.parentNode) {
loadingImage.parentNode.removeChild(loadingImage);
}
% /loading-image %

vm.setCloudProvider(cloudProvider);
% cloud-localstorage %
const stageVariables = vm.runtime.getTargetForStage().variables;
Expand Down Expand Up @@ -968,6 +970,18 @@
openConnection();
% /cloud-ws %

% loading-progress %
if (progress.parentNode) {
progress.parentNode.removeChild(progress);
}
% /loading-progress %
% loading-image %
if (loadingImage.parentNode) {
loadingImage.parentNode.removeChild(loadingImage);
}
document.body.classList.remove('loading');
% /loading-image %

vm.greenFlag();
};

Expand Down

0 comments on commit 5b4a225

Please sign in to comment.