-
Notifications
You must be signed in to change notification settings - Fork 80
Downloading as a .zip
Downloading the HTMLified project as a .zip file will store the Scratch engine and project files separate from the HTML file. This will help reduce the total file size (images and sounds are stored inside HTML files about 33% larger than the original file) and thus might help a bit with performance and loading times.
However, you will find that when you open index.html inside the .zip file in your browser, the project will not work. This is because browsers do not let HTML files opened locally to get the contents of other files on your computer. To fix this, you'll have to host the files on a web server.
You can preview the HTMLified project locally by starting a local HTTP server. You can probably search up "start http server" or something similar.
If you have Python installed on your computer, then you can follow these directions to use Python's built-in HTTP server.
# If you have Python 3
python3 -m http.server
# If you have Python 2
python -m SimpleHTTPServerand then open http://localhost:8000/ in your browser.
Personally, I use http-server. If you have Node installed, then you can do
http-serverand then open http://localhost:8080/ in the browser.
As a third alternative that avoids the command line, you can try out a Chrome extension to start a local web server. I've never tried it myself though.
You can also host the files publicly so that anyone in the world can view your project. Note that there's a slight (~1 minute) delay whenever you make a change before you can see those changes live, so I strongly recommend using a local web server if you intend on changing the files frequently.
I recommend using GitHub Pages. After creating a GitHub account, you can create a new repository:
-
If you name it
your-username.github.io, whereyour-usernameexactly matches your GitHub username, then you will find your project at https://your-username.github.io/. -
If you name it anything else, then your project will be at https://your-username.github.io/project-name/, where
project-nameis the name of the repository.
Then, you can click "uploading an existing file" and upload the files from the .zip file. Once they're uploaded, your website should be live!