Jump to content

Wanting to have a page with randomized image on reload

Recommended Posts

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)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
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

Link to comment

Hi. I wrote recently a blog article about implementing a tarot card random show when clicking on a button. Maybe it helps.

https://www.ui-workarounds.com/random-tarot-cards-on-a-click-of-a-button-using-svg-sprites/

Jozsef Kerekes - Front-end developer and Squarespace enthusiast
My Blog: https://ui-workarounds.com
If you like my answer, please give me an upvote/like. Highly appreciated.

 

 

Link to comment
  • 2 weeks later...
  • 1 year later...
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. 

Link to comment

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.