GROCreativeStudio Posted June 7 Share Posted June 7 (edited) Site url (copy of actual site that I'm using just for testing): gro-testing-tha.squarespace.com Password: tha I have this code to change sitewide animations for one text block so the animation slides right to left instead of up on load (this is for the text block that starts with "Why Bio-Identical Hormone Pellet Therapy?") and it works great, but the text is no longer editable when I go into editing mode (block just appears empty). Any help would be so appreciated! Thanks in advance for any help!!🫶🏻 <style> /* Initial state for block-b4afc95a0259f2af8dec (left to right) */ #block-b4afc95a0259f2af8dec { opacity: 0; transform: translateX(-100%); transition: transform 1s ease, opacity 1s ease; } /* Animated state for block-b4afc95a0259f2af8dec */ #block-b4afc95a0259f2af8dec.visible { opacity: 1; transform: translateX(0); } /* Override existing animations */ #block-b4afc95a0259f2af8dec.preSlide, #block-b4afc95a0259f2af8dec.slideIn { animation: none !important; } </style> <script> document.addEventListener("DOMContentLoaded", function() { const block = document.getElementById('block-b4afc95a0259f2af8dec'); if (block) { const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { block.classList.add('visible'); observer.unobserve(block); // Stop observing after the animation } }); }); observer.observe(block); } }); </script> Edited June 7 by GROCreativeStudio Clarity Link to comment
Solution Beyondspace Posted June 7 Solution Share Posted June 7 13 hours ago, GROCreativeStudio said: Site url (copy of actual site that I'm using just for testing): gro-testing-tha.squarespace.com Password: tha I have this code to change sitewide animations for one text block so the animation slides right to left instead of up on load (this is for the text block that starts with "Why Bio-Identical Hormone Pellet Therapy?") and it works great, but the text is no longer editable when I go into editing mode (block just appears empty). Any help would be so appreciated! Thanks in advance for any help!!🫶🏻 <style> /* Initial state for block-b4afc95a0259f2af8dec (left to right) */ #block-b4afc95a0259f2af8dec { opacity: 0; transform: translateX(-100%); transition: transform 1s ease, opacity 1s ease; } /* Animated state for block-b4afc95a0259f2af8dec */ #block-b4afc95a0259f2af8dec.visible { opacity: 1; transform: translateX(0); } /* Override existing animations */ #block-b4afc95a0259f2af8dec.preSlide, #block-b4afc95a0259f2af8dec.slideIn { animation: none !important; } </style> <script> document.addEventListener("DOMContentLoaded", function() { const block = document.getElementById('block-b4afc95a0259f2af8dec'); if (block) { const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { block.classList.add('visible'); observer.unobserve(block); // Stop observing after the animation } }); }); observer.observe(block); } }); </script> You can use the following additional selector for CSS to prevent it working on your edit mode body:not(.sqs-edit-mode) #block... BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace 🚀 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
GROCreativeStudio Posted June 8 Author Share Posted June 8 10 hours ago, Beyondspace said: You can use the following additional selector for CSS to prevent it working on your edit mode body:not(.sqs-edit-mode) #block... Amazing, thanks so much!! Beyondspace 1 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