When you have ‘Show Loading indicator’ checked in the Document inspector, your visitors will see a notice when your document is loading. Below are a couple ways you can change this loading screen:
Show an image while your Tumult Hype document loads
First of all, if your Tumult Hype document is loading slowly, this article gives tips on speeding it up. The quickest thing you can do is to open the Resource Library and uncheck ‘Preload’ for large images.
First, we’ll make sure that the ‘loading’ image you’re going to use will appear:
In the ‘Document Inspector’ make sure ‘Make background transparent’ is checked.
Uncheck ‘Show Loading Indicator’
Export your Hype animation into a folder. Make sure you select ‘Also create html file’ in the export options. Edit the exported .html file in your HTML editor, and you’ll see a div that looks like this:
Next, create an image you’d like to show when that Tumult Hype document is loading. Ideally, this would be the same size as your Tumult Hype document’s scene size. (The size is shown above is width:600px;height:400px;). A small animated GIF might be perfect for your needs.
You’ll need to save this image in the folder where your DOCUMENTNAME.html file is located.
Next, we’ll add a reference to that image into the exported HTML code generated by Tumult Hype by modifying the code above. It will be placed within the div that centers our Tumult Hype document, which is also directly above the small code snippet above.
This code (part of the above code) centers your loading image and references it:
<div style="position:absolute;height:400px;top:0;left:0px;"> <img src="image.jpg"> <h3 style="color:gray;">Loading...</h3> </div>
Notice that the height of the div containing your image is the same as the height of your document. If your image is smaller than your Hype document, you’ll need adjust the ‘top:’ and ‘left:’ values to move your image to the center of the DIV that contains your Tumult Hype document.
That’s it – open your main .html file from your web server and you should see your loading image. If you open this HTML file from your computer, it will likely load so quickly that you won’t see your image (try it on a mobile device, or use Network Link Conditioner.
Please make sure that your loading image is a very low file size!
Spin.js - An image-free loading spinner
Spin.js is a customizable loading graphic that is pretty easy to integrate into a Hype document.
Two things need to be changed in your exported .html document to get this to work: First, open up the included .hype file at the bottom of this document. You’ll notice that spin.js is included in the resources library. (You can use the .hype document as a starting point). The other modification to this file is in the HEAD area of the document. You can edit the contents of the
<head>...</head>of your exported .html file by clicking on ‘Edit HTML Head’ in the Document Inspector. After exporting, you’ll need to add this code to your document:
<div style="margin:150px auto;" id="spinnerarea"></div>
The ‘margin’ value pushes the spinner down slightly, and centers it in the window.
Next, you’ll need to add the settings code at the bottom of your document before the body tag:
That’s it! Please take a look at the attached .html document and .hype file for an example.
spinnerdemo.zip (6.2 MB)