That is what I plan to try next: eliminate all the JS code and see if it can all be done in HTML. Plus, I want to factor out the repeating code so it can be accessed from multiple locations without duplicating code.
Got this figured out where it is now working correctly across multiple pages without using a global, just an instance on each page. Sounds like it is not possible to completely avoid JS for something like this though.
What did you change to get that to work, sounds progress
Added the following code to the existing JS to ensure it does not show on different pages if the consent has been set.
// 🔒 Prevent popup on subsequent pages
if (!hasConsent()) {
showPopup();
} else {
// Hide immediately just in case it's visible in markup
if (reveal) {
reveal.style.display = "none";
}
}
I moved the if else end only need code once flicker needs to be removed
no flicker??
No flicker on this end with the existing code.
the second one only use all the code once and not repeat no flicker, my previous attempt with @if(edit) used the code twice, thought I would try and streamline
learnt quite a bit from this
cool
dont think this allowed, but might be wrong
x-show="{{preview}} || show"
Aloha Steve,
I have a completely new version that I created with AI over the last two days, it allows for a lot more control, and it displays the Privacy Policy on a page instead of a pop-up. This new version offers more control over everything and appears to be working very well. I’m in the process of integrating it on all my sites.
The only missing piece is that the switch for showing and hiding the pop-up in the editor is not working, yet. However, because the pop-up is much smaller, it gets in the way a lot less.
Please let me know if you would like to review the code.
Here is what the pop-up currently looks like.
Currently, through properties, you can set all of the text in the popup, the page link to the privacy policy, and the background color. The other colors all come from the “brand” color for the site.
The only remaining piece I’m trying to solve is how to specify the fill color for the embedded SVG shown in the pop-up.
Would be great to see the code, going to bed now though it’s 12:34am here in the UK need to be up at 5
Looks really
great work on the background really steps up privacy policy pops impressed
I’ll PM it too you once I finish cleaning it up a little.
Impressed with the background
