How to implement 360 viewer
To implement a 360 sphere viewer on Squarespace, follow these steps below to create and use animated sprites.
Preparing the Images
Create Sprites: Prepare the individual images for your animation and combine them into a single spritesheet.
Insert Image: Use the Image block to add the viewer to your page.
Attach Spriteify URLs: Attach link to Image block in order to activate the view
Spriteify URLs
A Spriteify URL is a special link with reserved parameters that configure how the viewer plays a spritesheet animation. URL parameters begin with a question mark (?
). The parameters are joined using an ampersand (&
) and follow the format parameter=value
.
Supported parameters
Parameter | Required/Optional | Description | Values | Default Value |
---|---|---|---|---|
spriteify |
Required | Turns the image into a spritesheet animation. | true /false or 1 /0 |
1 |
width |
Optional | Specifies the width of the sprite. | Any valid pixel value | Image block width |
height |
Optional | Specifies the height of the sprite. | Any valid pixel value | Image block height |
frames |
Required | Specifies the total number of frames in the merged sprite image. | Any positive integer | N/A |
framesX |
Required | Specifies the number of columns in the merged sprite. | Any positive integer | N/A |
responsive |
Optional | Determines whether the viewer dimensions change when resizing. | true /false or 1 /0 |
1 |
animate |
Optional | Determines whether the viewer auto-rotates on load. | true /false or 1 /0 |
1 |
loop |
Optional | Determines whether the viewer loops when animate is true. | true /false or 1 /0 |
0 |
sense |
Optional | Specifies the direction of the animation. | 1 or -1 |
N/A |
Example URL
For example, given a spritesheet with 40 frames and 6 frames per row, the URL might look like this:
https://images.squarespace-cdn.com/content/660f72446b381f5933e3f1c9/48950111-b977-4fff-bf15-9c4611af8091/Heart-40-Frames-min.jpg?spriteify=true&frames=40&framesX=6&responsive=true&animate=true&loop=false
Before ?
: The Image URL
https://images.squarespace-cdn.com/content/660f72446b381f5933e3f1c9/48950111-b977-4fff-bf15-9c4611af8091/Heart-40-Frames-min.jpg
This part of the URL points to the actual image file. It is a direct link to the image hosted on Squarespace's CDN (Content Delivery Network).
?
: The URL Parameter Separator
The question mark (
?
) indicates the beginning of the URL parameters. These parameters are used to configure how the image should be processed or displayed.
URL Parameters and Their Values
spriteify=true:
This required parameter activates the spritesheet animation feature. Setting it totrue
enables the image to be treated as a spritesheet.frames=40:
Specifies the total number of frames in the merged sprite image. In this case, there are 40 frames.framesX=6
: Indicates the number of columns in the merged sprite image. This means there are 6 frames per row in the spritesheet.responsive=true
: Determines whether the viewer dimensions change when resizing. Setting it totrue
makes the viewer responsive to different screen sizes.animate=true
: Specifies whether the viewer should auto-rotate the spritesheet on load. Setting it totrue
means the animation will start automatically when the viewer loads.loop=false
: Determines whether the viewer should loop the animation whenanimate
is set totrue
. Setting it tofalse
ensures that the animation play just once.
Detail Instructions
Insert Image Block: Add the image block to your page.
Add Sprite Image: Upload the first sprite image.
Upload Spritesheet to Asset Library and get its URL to create the spriteify URLs
Attach Link: Click on "Attach link" and use the spriteify URLs.
Save the Page: Save your changes.
Here's an interactive tutorial
** Best experienced in Full Screen (click the icon in the top right corner before you begin) **
Takeaway
Image Width Limitation: Since Squarespace limits image width to 2500px, create a maximum of 2-column spritesheets to ensure the highest quality.
Use this online tool to merge the spritesheet, MacOS users can use Combine Images Shortcut