Skip to content

vielhuber/ilovecookies

Repository files navigation

installation

use it as a module:

npm install ilovecookies
import iLoveCookies from 'ilovecookies';

or embed it directly:

<script src="ilovecookies.min.js"></script> 

usage

document.addEventListener('DOMContentLoaded', () =>
{
    let ilovecookies = new iLoveCookies({
        expiration: 30,
        css: true,
        padding_bottom: true, // increase padding bottom with height of cookiebar to prevent overlapping important links
        de: {
            text: 'Um die Webseite optimal gestalten und fortlaufend verbessern zu können, verwenden wir Cookies. Durch die weitere Nutzung der Webseite stimmen Sie der Verwendung von Cookies zu.',
            close_text: 'Schließen',
            more_text: 'Weitere Informationen',
            more_link: 'datenschutz'
        },
        en: {
            text: 'To ensure that our web site is well managed and to facilitate improved navigation within the site, we may use cookies. By using this website, you agree to the use of cookies.',
            close_text: 'Close',
            more_text: 'Further information',
            more_link: function() { alert('foo'); }
        }
    });
});

About

Shows a cookie bar without any dependencies.

Resources

Stars

Watchers

Forks

Packages

No packages published