Uputstvo na engleskom
Show a product in 3D on your website
For a plain HTML website. You need: the splat-viewer folder, your product’s 3D file (ending in .sog), its photo (ending in .webp or .jpg), and a way to put files on your website, such as your host’s file manager or an FTP program.
1. Put the files on your website
- Upload the whole
splat-viewer-0.1.0folder to the top level of your website, next to your home page. - Make a folder called
productsnext to it, and upload your product’s.sogfile and its photo there.
To check: open https://your-site/splat-viewer-0.1.0/README.md in your browser. You should see the README text. If you see “Not found”, the folder is in the wrong place.
2. Paste the snippet into your page
- Open
snippet.htmlfrom the splat-viewer folder in a text editor (Notepad, TextEdit), and copy everything in it. - Open your product page’s HTML, and paste it where the product should appear.
- In what you pasted, change the three names in capitals:
PRODUCT.sogto your 3D file’s name;PRODUCT.webpto your photo’s name (both times);PRODUCT NAMEto a few words describing the product (both times), for people who can’t see the picture.
- Save the page and upload it again.
3. Check it
Open your product page. The photo shows first; a moment later it turns into the 3D product, which you can turn with the mouse or a finger.
If only the photo stays:
- Check the file names in the snippet against the files you uploaded, letter for letter, including capitals.
- If your site has a security policy, it must allow what
script-policy.mdlists. Your web host can tell you whether you have one. - Still stuck: send us the page address.
Size and options
The viewer is a square, as wide as its space, up to 600 pixels. To change it, and for turning on its own, preset views, labels and colours, see element.md.