Jump to content

thephase51

Member
  • Posts

    7
  • Joined

  • Last visited

Posts posted by thephase51

  1. Hi i coded a fix for this, add this code to the developer - page injection - footer 

    Replace 'my url.com' with required url

     

    <script src="https://cdn.jsdelivr.net/npm/js-cookie@3.0.1/dist/js.cookie.min.js"></script>
    <script>
    const div = document.querySelector("body");

    const callback = function(records) {
        records.forEach(function(record) {
            if (record.removedNodes.length > 0) {
                if (record.removedNodes[0].classList.contains('auth')) {
                    Cookies.remove('logged-in');
                }
                if (record.removedNodes[0].classList.contains('unauth')) {
                    // logged in action
                    if (!Cookies.get('logged-in')) {
                        Cookies.set('logged-in', 'true');
                        if (window.location.href !== 'https://www.myurl.com') {
                            window.location.href = 'https://www.myurl.com';
                        }
                    }
                }
            }
        });
    }

    const config = {
        childList: true,
        subtree: true
    };

    const observer = new MutationObserver(callback);
    observer.observe(div, config);
    </script>

  2. Hi, i need to have an optimised video on my mobile home page, I have been using the following code on page header injection but to no avail. The page is accessible via https://www.bumphaus.com/home-1

    <style>

    @media screen and ( max-width : 767px ) {

    [data-section-id="64f5a7264f39e02a98d3cc42"] {

        display : none ! Important;

        }

      }

    @media screen and ( min-width : 768px ) {

     [data-section-id="645a5771a9fcec01afb17139"] {

        display : none! Important;

        }    

      }

    </style>

  3. Hi, im trying to add alternate mobile and desktop video banners and having trouble with the code, can someone help?

    Im using the following in the page settings - page header injections 

    <style>
    @media screen and ( max-width : 767px ) {
    [data-section-id="64f5a7264f39e02a98d3cc42"] {
        display : none ! Important;
        }
      }
    @media screen and ( min-width : 768px ) {
     [data-section-id="645a5771a9fcec01afb17139"] {
        display : none! Important;
        }    
      }
    <style>

    You can see the page here https://www.bumphaus.com/home-1

     

     

×
×
  • 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.