Jump to content

Wanting to have a page with randomized image on reload

Recommended Posts

Posted

I want a user to click a button that takes them to a page that has a randomized image either as a background or in a single image gallery. It is used to simulate a tarot card reading. When you click the button you get a new card that tells your fortune. There are 36 possible cards.

Posted
9 hours ago, badidea said:

I want a user to click a button that takes them to a page that has a randomized image either as a background or in a single image gallery. It is used to simulate a tarot card reading. When you click the button you get a new card that tells your fortune. There are 36 possible cards.

It means that every time when user access this special page, it will show only one random image (in total 36 cards, right? Have you consider the solution when user click on this button, it will render directly on the current page the random image?

 

This requirement needs javascript to randomize your images. Therefore, you need at least the business plan. What is your current one?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> No-code customisations for Squarespace

Posted
11 hours ago, bangank36 said:

It means that every time when user access this special page, it will show only one random image (in total 36 cards, right? Have you consider the solution when user click on this button, it will render directly on the current page the random image?

 

This requirement needs javascript to randomize your images. Therefore, you need at least the business plan. What is your current one?

Hi, yes I have the business plan on this site. And yes, displaying the card on the same page as the button would work great! I'm attaching a rough mockup. Thank you!!

pick_a_card_01.jpg

pick_a_card_02.jpg

  • 2 weeks later...
  • 1 year later...
Posted
On 11/11/2022 at 10:12 PM, badidea said:

Thanks for this! I think I got it worked out but this article is amazing!

Hi! How did you end up doing it? The link doesn't work anymore and I would love to add this to my website as well! I'd really appreciate any help. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.