GDPR / Privacy Policy Modal
- About
- Install
- Contribute
Download the files
P.S You can download and run the modal as is if you wish to see it in action.
just open index.html with your live server option
Put the files in your project
add the javascript file to your page.
<script src="./privacy-popup/js/privacy.js"></script>
add a div to your page where the modl will live
<div id ="privacyPopup" class="privacy-popup ">
The modal takes two json objects
const gdpr = new GDPR({
"header": "Cookie Policy",
"declaration": "This is the declaration under main header",
"categorys": {
"Esssential": "essence text",
"Functionality": "function text",
"Analytical": "analytical text",
"Marketing": "marketing text"
},
}, 'privacyPopup', {
"storageType": window.localStorage,
"storageKey": "p_consent",
"formId": "tos-form",
"url": "/test/data",
"method": "POST",
"mode": "no-cors",
"credentials": "same-origin",
"headers": {
"Content-Type": "application/json"
}
})
you can add / remove css as you please in the css file
Once configured to your liking you are ready to go
Feel free to contribute what ever you like
Constructive criticism is appreciated