pressidium / pressidium-cookie-consent

🍪 Lightweight, user-friendly and customizable cookie consent banner to help you comply with the EU GDPR cookie law and CCPA regulations.
https://wordpress.org/plugins/pressidium-cookie-consent/
GNU General Public License v2.0
53 stars 4 forks source link

Floating settings button #24

Closed over-engineer closed 3 months ago

over-engineer commented 1 year ago

One potential feature to consider is a floating button at the bottom-left corner of the window, providing easy access to the cookie settings modal.

This button would be customizable and, when clicked, would call pressidiumCookieConsent.showSettings()

(originally suggested by @partner4 in #22)

partner4 commented 1 year ago

Hi, again!

I made a suggestion of onAccept function to show floating button with SVG image in it. Button is shown if pressidiumCookieConsent.displaybutton settings is enabled. It creates a div with SVG image with pressidiumCookieConsent.title from settings and link to open modal window.

JS: onAccept: function(e) { if (("1" == pressidiumCookieConsent.displaybutton) && e) { var t = document.createElement("div"); t.className = "cookiebutton-settings", t.setAttribute("data-cc", "c-settings"), t.setAttribute("aria-haspopup", "dialog"), t.setAttribute("tabindex", "0"), t.setAttribute("title", pressidiumCookieConsent.title), t.innerHTML = '', document.body.appendChild(t), t.addEventListener("click", function() { pressidiumCookieConsent.showSettings() }, !1), t.addEventListener("keypress", function(e) { "Enter" === e.key && pressidiumCookieConsent.showSettings() }, !1) }, },

CSS: .cookiebutton-settings { position: fixed; width: 42px; height: 42px; bottom: 35px; left: 30px; z-index: 1000000; background: #fff; border: 1px solid #333; border-radius: 50%; padding: 8px; cursor: pointer; box-sizing: border-box; display: block }

RESULT:

partner4 commented 1 year ago

RESULT:

<div class="cookiebutton-settings" data-cc="c-settings" aria-haspopup="dialog" tabindex="0" title="Open Cookie Consent Settingss"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><path fill="#333" d="M21.598 11.064a1.006 1.006 0 00-.854-.172A2.938 2.938 0 0120 11c-1.654 0-3-1.346-3.003-2.937.005-.034.016-.136.017-.17a.998.998 0 00-1.254-1.006A2.963 2.963 0 0115 7c-1.654 0-3-1.346-3-3 0-.217.031-.444.099-.716a1 1 0 00-1.067-1.236A9.956 9.956 0 002 12c0 5.514 4.486 10 10 10s10-4.486 10-10c0-.049-.003-.097-.007-.16a1.004 1.004 0 00-.395-.776zM12 20c-4.411 0-8-3.589-8-8a7.962 7.962 0 016.006-7.75A5.006 5.006 0 0015 9l.101-.001a5.007 5.007 0 004.837 4C19.444 16.941 16.073 20 12 20z"></path><circle cx="12.5" cy="11.5" r="1.5"></circle><circle cx="8.5" cy="8.5" r="1.5"></circle><circle cx="7.5" cy="12.5" r="1.5"></circle><circle cx="15.5" cy="15.5" r="1.5"></circle><circle cx="10.5" cy="16.5" r="1.5"></circle></svg></div>

techpressrocks commented 1 year ago

Hi!

I really think this feature is necessary so you thank for looking into adding it in the future!

Just a question: will you implement the "revisit content button" (as CookieYes calls it) in the plugin settings?

Just for reference:

At https://gdpr.eu/cookies/ (that's the official GDPR site) under "cookie complicance" it says:

"Make it as easy for users to withdraw their consent as it was for them to give their consent in the first place."

Nikodemsky commented 8 months ago

Bump, this is only thing that is missing right now.

DennisRas commented 7 months ago

Also curious about the progress on this one.
It's mandatory that the user can redact/change their choices.

I understand that we can code this ourselves, but that kinda defeats the purpose :P

Edit: Is there any way we can contribute to this? What's the development environment/setup looking like for this project, so we can contribute settings for a button like this.

over-engineer commented 3 months ago

Hey @partner4, @techpressrocks, @Nikodemsky, and @DennisRas!

Great news everyone!

This was addressed in 1.5.0, which was just released on the WordPress Plugin Directory.

screenshot

This new version introduces a “Floating Button” tab, allowing you to:

Thanks for bearing with me on this one 🙂

I’m closing this issue as resolved. If you need more information on the floating settings button, please don’t hesitate to reopen it.


Is there any way we can contribute to this? What's the development environment/setup looking like for this project, so we can contribute settings for a button like this.

@DennisRas We don’t have a CONTRIBUTING document available right now, but feel free to open a PR if you’d like to contribute to a feature like this in the future. To develop locally, you’ll need to clone the GitHub repo, install the Composer and npm dependencies, and run npm start or npm build to build any JavaScript files.