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 djshiflet and Beyondspace 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) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment