cookie consent template

by John Doe

HTML

<script src="https://cdn.jsdelivr.net/gh/orestbida/[email protected]/dist/cookieconsent.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/orestbida/[email protected]/dist/cookieconsent.css">

JavaScript

const SERVICES = {
	'mapbox': {
		name: '',
		type: '',
		purpose: '',
		privacyUrl: ''
	}
}

const PRIVACY_POLICY_URL = 'https://maps.greenpeace.org';
const EN_LANG = {
  consent_modal: {
    title: 'We use cookies!',
    description: `We use cookies to enhance your experience. By clicking "Accept all cookies" you agree to our <a target="_blank" href="${PRIVACY_POLICY_URL}">Privacy & Cookies Policy</a>. You can <a data-cc="c-settings" class="cc-link">change your cookies settings anytime</a>.`,
    primary_btn: {
      text: 'Accept all',
      role: 'accept_all' // 'accept_selected' or 'accept_all'
    },
    secondary_btn: {
      text: 'Reject all',
      role: 'accept_necessary' // 'settings' or 'accept_necessary'
    }
  },
  settings_modal: {
    title: 'Manage your cookies preferences',
    save_settings_btn: 'Save settings',
    accept_all_btn: 'Accept all',
    reject_all_btn: 'Reject all',
    close_btn_label: 'Close',
    cookie_table_headers: [
      {col1: 'Name'},
      {col2: 'Domain'},
      {col3: 'Expiration'},
      {col4: 'Description'}
    ],
    blocks: [
      {
        title: 'Cookie usage 📢',
        description: `We use cookies to ensure the basic functionalities of the website and to enhance your experience. You can choose for each category to opt-in/out whenever you want. For more details relative to cookies and other sensitive data, please read the full <a target="_blank" href="${PRIVACY_POLICY_URL}" class="cc-link">privacy policy</a>.`
      }, {
        title: 'Strictly necessary services',
        description: 'These cookies are essential for the proper functioning of this map. Without these cookies, the website would not work properly',
        toggle: {
          value: 'necessary',
          enabled: true,
          readonly: true // cookie categories with readonly=true are all treated as "necessary cookies"
        }
      },
      {
        title: 'Performance and Analytics cookies',
        description: 'These cookies allow...