Skip to content

Cookier is a lightweight, customizable cookie consent banner that informs users about cookie usage. It includes a simple "accept" button and a link for more information about cookies.

License

Notifications You must be signed in to change notification settings

Decaded/Cookier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cookier

GitHub License Minified Size

Cookier is a lightweight, customizable cookie consent banner that informs users about cookie usage. It includes a simple "accept" button and a link for more information about cookies.

Demo website

Features

  • Cookie consent banner: Displays a notification informing users about cookies.
  • Accept button: Users can close the banner using a close (X) button, which stores a cookie in their browser.
  • Learn more link: A customizable link that explains what cookies are.
  • Responsive design: The banner adjusts for different screen sizes.

How to use

To implement Cookier in your project, follow these steps:

  1. Place the following HTML snippet where you'd like the cookie consent banner to appear in your code (typically just inside the <body> tag):
<div id="cookierBanner" class="cookierAlert">
  <p>It doesn't change anything, but we must inform you that we use cookies.</p>
  <a href="https://www.cookiesandyou.com/" target="_blank">What are cookies?</a>
  <button id="closeCookierButton" class="closeCookierButton">X</button>
</div>
  1. Place cookier.css in your project CSS folder (or wherever you hold styles) and link it:
<link rel="stylesheet" href="css/cookier.css"/>
  1. Include cookier.js in your project JS folder (or wherever you hold scripts) and link it:
<script src="js/cookier.js"></script>

Customization

You can easily:

  • Change the consent message and link in the HTML.
  • Adjust the look and feel by modifying the CSS.
  • Change the cookie expiration or behavior by editing the JavaScript.

Browser Support

Works in all modern browsers. Tested on Chrome, Firefox, Edge, and Safari.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Like what I do?

If you find this project helpful or fun to use, consider supporting me on Ko-fi! Your support helps me keep creating and improving.

ko-fi

About

Cookier is a lightweight, customizable cookie consent banner that informs users about cookie usage. It includes a simple "accept" button and a link for more information about cookies.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project