Jump to content

Choose Color From List And Set To Text Color

Recommended Posts

Site URL: https://www.yoloyoli.art/

I have four main colors that I use on my website. I would like to make the color of certain text change every time the page is visited to one of the four colors. I would assume to use an array and have it pick a random from that list and set it to the text color. However, I need help on going about this. Every attempt I made to create an array came with a syntax error. Got any ideas? Thanks!

Link to comment
  • Replies 1
  • Views 145
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

On 9/12/2022 at 12:46 AM, yoloyoli123 said:

Site URL: https://www.yoloyoli.art/

I have four main colors that I use on my website. I would like to make the color of certain text change every time the page is visited to one of the four colors. I would assume to use an array and have it pick a random from that list and set it to the text color. However, I need help on going about this. Every attempt I made to create an array came with a syntax error. Got any ideas? Thanks!

I imagine that when client visit you site, it always pop-up a modal to pick the color.

After picking color, the page will be set the appropriate style.

Is it your requirement?

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

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.