diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index 934d6b6..0000000
Binary files a/.DS_Store and /dev/null differ
diff --git a/.github/.DS_Store b/.github/.DS_Store
deleted file mode 100644
index ca27011..0000000
Binary files a/.github/.DS_Store and /dev/null differ
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..29527b9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+# Ignore Mac system files
+.DS_store
\ No newline at end of file
diff --git a/README.md b/README.md
index a41a458..37d3cf1 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,8 @@
-
+
+  [](https://github.com/AmauriC/tarteaucitron.js/graphs/contributors) 
-   
-
-# GlowCookies - Cookie Consent Banner In JavaScript for Google Analytics, Facebook Pixel & more
+# GlowCookies 🍪 - Powerful Cookie Consent Banner In JavaScript
Simple and full automated cookies banner for any website. Complies with the new European regulations with GlowCookies. Activate and deactivate Google Analytics, Facebook Pixel, Hotjar (and coming soon) cookies whenever the user wishes, with just 1 click.
[](https://manucaralmo.github.io/glow-cookies-web/)
@@ -18,69 +17,102 @@ You just have to install the code. When the user clicks on accept cookies, the g
## How to use
Add this code to your html `
` or `` tag.
```html
-
+
```
-## Languages `New`
-Now you can choose between two available languages: English and Spanish.
-In the first parameter of the start() method add `'es'` for Spanish or `'en'` for English.
+## Banner styles
+Now you can choose between these available banner styles:
+- Style `1`, `2` or `3`
+
+Set style in config object `glowCookies.start('en', { style: 3 })`
+
+## Languages
+Now you can choose between these available languages:
+- Afrikaans (`af`)
+- Brazilian portugese (`pt_BR`)
+- Bulgarian (`bg`)
+- Catalan (`ca`)
+- Chinese Simple (`zh`)
+- Chinese Traditional (`zh_TW`)
+- Danish (`da`)
+- Dutch (`nl`)
+- English (`en`)
+- French (`fr`)
+- German (`de`)
+- Italian (`it`)
+- Japanese (`ja`)
+- Malagasy (`mg`)
+- Norwegian (`no`)
+- Occitan (`oc`)
+- Polish (`pl`)
+- Russian (`ru`)
+- Slovak (`sk`)
+- Spanish (`es`)
+- Swedish (`sv`)
+- Thai (`th`)
+- Turkish (`tr`)
+- Ukrainian (`uk`)
+
+Set language in the first parameter of `glowCookies.start('en', { })` method.
## Tracking options
These are the parameters that you can modify to add your tracking codes or custom scripts.
-| Parameter | Type | Values |
-| ------------- | ------------- | ------------- |
-| `analytics` | String | Example: `"G-FH87DE17XF"` (Analytics tracking code) |
-| `facebookPixel` | String | Example: `"990955817632355"` (Facebook Pixel code) |
-| `HotjarTrackingCode` | String | Example: `"990955817632355"` (Hotjar tracking code) |
-| `customScript` (Inline) | Object | Example: `[{ type: 'custom', position: 'body', content: 'console.log('custom script');' }]` |
-| `customScript` (src) | Object | Example: `[{ type: 'src', position: 'head', content: 'https://www.googletagmanager.com/gtag/js?id=G-FH87DE17XF' }]` |
+| Parameter | Type | Values |
+| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
+| `analytics` | String | Example: `"G-FH87DE17XF"` (Analytics tracking code) |
+| `facebookPixel` | String | Example: `"990955817632355"` (Facebook Pixel code) |
+| `HotjarTrackingCode` | String | Example: `"990955817632355"` (Hotjar tracking code) |
+| `customScript` (Inline) | Object | Example: `[{ type: 'custom', position: 'body', content: 'console.log('custom script');' }]` |
+| `customScript` (src) | Object | Example: `[{ type: 'src', position: 'head', content: 'https://www.googletagmanager.com/gtag/js?id=G-FH87DE17XF' }]` |
## Config Banner
These are the parameters that you can modify to change certain banner options
-| Parameter | Type | Values |
-| ------------- | ------------- | ------------- |
-| `policyLink` | String | Example: `"https://yourlink.com"` (Your cookies policy link) |
-| `hideAfterClick` | Boolean | (`true` or `false`) Default: `true` (Hide banner after Accept or Reject cookies) |
+| Parameter | Type | Values |
+| ---------------- | ------- | -------------------------------------------------------------------------------- |
+| `policyLink` | String | Example: `"https://yourlink.com"` (Your cookies policy link) |
+| `hideAfterClick` | Boolean | (`true` or `false`) Default: `true` (Hide banner after Accept or Reject cookies) |
## Customize Banner
Now there are certain parameters that you can change to customize your banner.
-| Parameter | Type | Values |
-| ------------- | ------------- | ------------- |
-| `border` | String | (`"border"` or `"none"`) Default: `"border"` |
-| `position` | String | (`"left"` or `"right"`) Default: `"left"` |
-| `bannerDescription` | String | Example: `"We use our own and third-party cookies to personalize content and to analyze web traffic."` |
-| `bannerLinkText` | String | Example: `"Read more about cookies"` |
-| `bannerBackground` | String | Example: `"#FAFAFA"` Example: `"lightblue"` |
-| `bannerColor` | String | Example: `"#000"` Example: `"blue"` |
-| `bannerHeading` | String | Example: `"Use of cookies"` Default: None |
-| `acceptBtnText` | String | Example: `"Accept cookies"` |
-| `acceptBtnColor` | String | Example: `"#000"` Example: `"blue"` |
-| `acceptBtnBackground` | String | Example: `"#fff"` Example: `"white"` |
-| `rejectBtnText` | String | Example: `"Reject"` |
-| `rejectBtnBackground` | String | Example: `"#000"` Example: `"blue"` |
-| `rejectBtnColor` | String | Example: `"#fff"` Example: `"white"` |
-| `manageColor` | String | Example: `"#fff"` Example: `"white"` |
-| `manageBackground` | String | Example: `"#f2f2f2"` Example: `"blue"` |
-| `manageText` | String | Example: `"Manage cookies"` |
+| Parameter | Type | Values |
+| --------------------- | ------ | ------------------------------------------------------------------------------------------------------ |
+| `border` | String | (`"border"` or `"none"`) Default: `"border"` |
+| `position` | String | (`"left"` or `"right"`) Default: `"left"` |
+| `bannerDescription` | String | Example: `"We use our own and third-party cookies to personalize content and to analyze web traffic."` |
+| `bannerLinkText` | String | Example: `"Read more about cookies"` |
+| `bannerBackground` | String | Example: `"#FAFAFA"` Example: `"lightblue"` |
+| `bannerColor` | String | Example: `"#000"` Example: `"blue"` |
+| `bannerHeading` | String | Example: `"Use of cookies"` Default: None |
+| `acceptBtnText` | String | Example: `"Accept cookies"` |
+| `acceptBtnColor` | String | Example: `"#000"` Example: `"blue"` |
+| `acceptBtnBackground` | String | Example: `"#fff"` Example: `"white"` |
+| `rejectBtnText` | String | Example: `"Reject"` |
+| `rejectBtnBackground` | String | Example: `"#000"` Example: `"blue"` |
+| `rejectBtnColor` | String | Example: `"#fff"` Example: `"white"` |
+| `manageColor` | String | Example: `"#fff"` Example: `"white"` |
+| `manageBackground` | String | Example: `"#f2f2f2"` Example: `"blue"` |
+| `manageText` | String | Example: `"Manage cookies"` |
## Fully customized banner
```html
-
+
```
+## Contribute
+If you know any other language, please help translate.
+- Update the `arrLang` of the `LanguageGC` class in glowCookies.js (Add an entry in this fashion.)
+- Update language documentation in README.md
+- Create a pull request
+```
+en: {
+ 'bannerHeading': 'We use cookies',
+ 'bannerDescription' : 'We use our own and third-party cookies to personalize content and to analyze web traffic.',
+ 'bannerLinkText' : 'Read more about cookies',
+ 'acceptBtnText' : 'Accept cookies',
+ 'rejectBtnText' : 'Reject',
+ 'manageText' : 'Manage cookies'
+}
+```
+Thanks for your help! 🎉
+
## Next steps
- [ ] Advanced cookies management
-- [ ] Banner templates
-- [ ] Custom cookies icon
+- [ ] Cookie settings
### Request features
info@glowmedia.es
diff --git a/src/glowCookies.js b/src/glowCookies.js
index 176b7f7..6aadeb8 100644
--- a/src/glowCookies.js
+++ b/src/glowCookies.js
@@ -2,58 +2,58 @@
GLOW COOKIES
CREATED BY MANUEL CARRILLO
https://github.com/manucaralmo/GlowCookies
- 2021 - v 3.1
+ 2021 - v 3.1.3
*/
class GlowCookies {
- constructor() {
- // Cookies banner
- this.banner = undefined
- // Config
- this.config = undefined
- this.tracking = undefined
- // DOM ELEMENTS
- this.PreBanner = undefined
- this.Cookies = undefined
- this.DOMbanner = undefined
- }
+ constructor() {
+ // Cookies banner
+ this.banner = undefined
+ // Config
+ this.config = undefined
+ this.tracking = undefined
+ // DOM ELEMENTS
+ this.PreBanner = undefined
+ this.Cookies = undefined
+ this.DOMbanner = undefined
+ }
- render() {
- this.addCss()
- this.createDOMElements()
- this.checkStatus()
- }
+ render() {
+ this.addCss()
+ this.createDOMElements()
+ this.checkStatus()
+ }
- addCss() {
- const stylesheet = document.createElement('link');
- stylesheet.setAttribute('rel', 'stylesheet');
- stylesheet.setAttribute('href', `https://cdn.jsdelivr.net/gh/manucaralmo/GlowCookies@3.1/src/glowCookies.min.css`);
- document.head.appendChild(stylesheet);
- }
+ addCss() {
+ const stylesheet = document.createElement('link');
+ stylesheet.setAttribute('rel', 'stylesheet');
+ stylesheet.setAttribute('href', `https://cdn.jsdelivr.net/gh/manucaralmo/GlowCookies@3.1.3/src/glowCookies.min.css`);
+ document.head.appendChild(stylesheet);
+ }
- createDOMElements() {
- // COOKIES BUTTON
- this.PreBanner = document.createElement("div");
- this.PreBanner.innerHTML = `