diff --git a/README.md b/README.md index a04d447..a5aa94f 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,9 @@ tarteaucitron.init({ "orientation": "middle", /* Banner position (top - bottom) */ "showAlertSmall": true, /* Show the small banner on bottom right */ "cookieslist": true, /* Show the cookie list */ + + "showIcon": true, /* Show cookie icon to manage cookies */ + "iconPosition": "BottomRight", /* Position of the icon between BottomRight, BottomLeft, TopRight and TopLeft */ "adblocker": false, /* Show a Warning if an adblocker is detected */ "DenyAllCta" : true, /* Show the deny all button */ diff --git a/css/tarteaucitron.css b/css/tarteaucitron.css index dd5ad28..a41e9b1 100644 --- a/css/tarteaucitron.css +++ b/css/tarteaucitron.css @@ -495,7 +495,7 @@ div#tarteaucitronServices { text-align: center; padding: 10px 0 10px 0; margin: auto; - width: 100%; + width: calc(100% - 20px); /* 100 % - padding-right - padding-left */ } #tarteaucitronAlertBig #tarteaucitronPrivacyUrl, @@ -556,6 +556,46 @@ div#tarteaucitronServices { z-index: 2147483644; } +/*** + * Icon + */ +.tarteaucitronIconBottomRight { + bottom: 0; + right: 0; +} +.tarteaucitronIconBottomLeft { + bottom: 0; + left: 0; +} +.tarteaucitronIconTopRight { + top: 0; + right: 0; +} +.tarteaucitronIconTopLeft { + top: 0; + left: 0; +} + +#tarteaucitronIcon { + background: transparent; + position: fixed; + display: none; + width: auto; + z-index: 2147483646; +} +#tarteaucitronIcon #tarteaucitronManager { + color: transparent; + cursor: pointer; + display: inline-block; + font-size: 11px !important; + padding: 8px 10px 8px; + border: none; +} +#tarteaucitronIcon #tarteaucitronManager img { + width: 50px; + height: 50px; +} + /*** * Small alert */ diff --git a/tarteaucitron.js b/tarteaucitron.js index 367f8b3..1c80ce9 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -208,6 +208,8 @@ var tarteaucitron = { "bodyPosition": "bottom", "removeCredit": false, "showAlertSmall": true, + "showIcon": true, + "iconPosition": "BottomRight", "cookieslist": true, "handleBrowserDNTRequest": false, "DenyAllCta": true, @@ -430,6 +432,14 @@ var tarteaucitron = { html += '
'; } + if (tarteaucitron.parameters.showIcon === true) { + html += '
'; + html += ' '; + html += '
'; + } + if (tarteaucitron.parameters.showAlertSmall === true) { html += '
'; html += '