Rik_Nvgtr Posted September 13, 2021 Share Posted September 13, 2021 (edited) I am currently working on a website (7.1 blank template) where I am looking for that the header navigation links to change depending on the image that they scroll over (so for example on a light image we would like the text to be black, but as soon as the image is darker for the font to change to white). I have been trying to solve this with css only : /* Nav item color */ .header-nav-item a{ color: transparent; filter: invert(1) grayscale(1) contrast(9); } Or with the color-Blend mode: /* Nav item color */ .header-nav-item a{ color: white !important; mix-blend-mode: multiply; } Any help would be appreciated. Edited September 13, 2021 by Rik_Nvgtr Beyondspace and djshiflet 2 Link to comment
Beyondspace Posted November 9, 2021 Share Posted November 9, 2021 On 9/13/2021 at 3:53 PM, Rik_Nvgtr said: I am currently working on a website (7.1 blank template) where I am looking for that the header navigation links to change depending on the image that they scroll over (so for example on a light image we would like the text to be black, but as soon as the image is darker for the font to change to white). I have been trying to solve this with css only : /* Nav item color */ .header-nav-item a{ color: transparent; filter: invert(1) grayscale(1) contrast(9); } Or with the color-Blend mode: /* Nav item color */ .header-nav-item a{ color: white !important; mix-blend-mode: multiply; } Any help would be appreciated. It may need javascript to detect the scroll position and extract the image's lumiance to change the nav color accordingly, rough plan should be - Intersection Observer to detect scroll position - Library such as Vibrant.js - Extract prominent colors from an image. (jariz.github.io) BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🚀 Learn how to rank new pages on Google in 48 hours! 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment