# Privacy popup as in RWC

**URL:** <https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786>\
**Category:** Elements\
**Created:** [July 11, 2025, 8:18pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786 "2025-07-11T20:18:24Z")\
**Posts on this page:** 13\
**Page:** 6

<div class="post-metadata">

**Author:** ![handshaper](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/handshaper/32/27373_2.png) [@handshaper](https://forums.realmacsoftware.com/u/handshaper)\
**Post date:** [July 20, 2025, 8:29pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/101 "2025-07-20T20:29:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![handshaper](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/handshaper/32/27373_2.png) [@handshaper](https://forums.realmacsoftware.com/u/handshaper)\
**Post date:** [July 20, 2025, 8:48pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/102 "2025-07-20T20:48:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [July 20, 2025, 9:16pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/103 "2025-07-20T21:16:44Z")

</div>

What did you change to get that to work, sounds progress

---

<div class="post-metadata">

**Author:** ![handshaper](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/handshaper/32/27373_2.png) [@handshaper](https://forums.realmacsoftware.com/u/handshaper)\
**Post date:** [July 20, 2025, 10:52pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/104 "2025-07-20T22:52:33Z")

</div>

Added the following code to the existing JS to ensure it does not show on different pages if the consent has been set.

```auto
  // 🔒 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";
    }
  }

```

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [July 20, 2025, 10:55pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/105 "2025-07-20T22:55:36Z")

</div>

I moved the if else end only need code once flicker needs to be removed

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [July 20, 2025, 11:14pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/106 "2025-07-20T23:14:14Z")

</div>

no flicker??

---

<div class="post-metadata">

**Author:** ![handshaper](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/handshaper/32/27373_2.png) [@handshaper](https://forums.realmacsoftware.com/u/handshaper)\
**Post date:** [July 20, 2025, 11:16pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/107 "2025-07-20T23:16:04Z")

</div>

No flicker on this end with the existing code.

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [July 20, 2025, 11:18pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/108 "2025-07-20T23:18:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [July 20, 2025, 11:22pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/109 "2025-07-20T23:22:46Z")

</div>

dont think this allowed, but might be wrong

```auto
 x-show="{{preview}} || show"

```

---

<div class="post-metadata">

**Author:** ![handshaper](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/handshaper/32/27373_2.png) [@handshaper](https://forums.realmacsoftware.com/u/handshaper)\
**Post date:** [July 20, 2025, 11:28pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/110 "2025-07-20T23:28:51Z")

</div>

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.

 ![CleanShot 2025-07-20 at 13.24.43@2x](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/d/b/db90cedbca3b582b0b8cb783e802f98af9d2f4a3.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [July 20, 2025, 11:34pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/111 "2025-07-20T23:34:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![handshaper](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/handshaper/32/27373_2.png) [@handshaper](https://forums.realmacsoftware.com/u/handshaper)\
**Post date:** [July 20, 2025, 11:35pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/112 "2025-07-20T23:35:41Z")

</div>

I’ll PM it too you once I finish cleaning it up a little.

---

<div class="post-metadata">

**Author:** ![upssjw](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/upssjw/32/26063_2.png) [@upssjw](https://forums.realmacsoftware.com/u/upssjw)\
**Post date:** [July 20, 2025, 11:36pm UTC](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786/113 "2025-07-20T23:36:44Z")

</div>

Impressed with the background

[Previous page](https://forums.realmacsoftware.com/t/privacy-popup-as-in-rwc/48786.md?page=5)
