Jump to content

Header navigation and logo invert against background on scroll

Recommended Posts

  • 4 weeks later...

Try this code to Website > Website Tools (under Not Linked) > Custom CSS

@media screen and (min-width:992px) {
header#header {
    mix-blend-mode: difference;
    background-color: transparent !important;
}

header#header * {
    color: white !important;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 months later...
On 4/12/2024 at 3:21 AM, cscholz said:

@tuanphan I tried this code and it works, but it is also applying this effect to my custom nav links..I would only like this applied to my logo. Is this possible?

 

https://www.chrisscholzdesign.com

pw: CSDesign123

Change this ID

header#header * 

to this

header#header a#site-title 

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 4/16/2024 at 11:49 PM, cscholz said:

thank you @tuanphan!! I have decided to keep the blend mode active on header title and links. Is there a CSS code to have it applied to mobile as well?

Change 992px in the code to 1px

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 1 month later...
On 5/27/2024 at 6:08 AM, BLK said:

Can this invert of header come into effect after first section please?

 

Thank you!

You can use this code, but you need to add it to Website > Website Tools > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(function(){
 var visibleTop = 800;
  $(window).scroll(function() {
    var scroll = getCurrentScroll();
      if ( scroll >= visibleTop ) {
           $('header#header').addClass('tp-invest');
        }
        else {
            $('header#header').removeClass('tp-invest');
        }
  });
function getCurrentScroll() {
    return window.pageYOffset || document.documentElement.scrollTop;
    }
});
</script>
<style>
  @media screen and (min-width:992px) {
.tp-invest {
    mix-blend-mode: difference;
    background-color: transparent !important;
}

.tp-invest * {
    color: white !important;
}
}
</style>

Adjust 800 to value what you want

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (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.