Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wruczek/bootstrap-cookie-alert

A simple, good looking cookie alert built for Bootstrap 3/4. No dependencies required.
https://github.com/wruczek/bootstrap-cookie-alert

bootstrap cookie-alert lightweight small

Last synced: 8 minutes ago
JSON representation

A simple, good looking cookie alert built for Bootstrap 3/4. No dependencies required.

Awesome Lists containing this project

README

        

# Bootstrap-Cookie-Alert
A simple cookie alert for Bootstrap 5 and 4. No dependencies required.

[**Demo with Bootstrap 5**](https://wruczek.github.io/Bootstrap-Cookie-Alert/demo-bs5)

[**Demo with Bootstrap 4**](https://wruczek.github.io/Bootstrap-Cookie-Alert/demo-bs4)

I unfortunately don't remember the source of the cubes pattern :(
If someone know, please email me or create an issue. I would love to credit the author.

## npm package
`npm i bootstrap-cookie-alert`

## How to use
#### 1. In the `head` of your document, include `cookiealert.css` **after Bootstrap**.
```html

```

#### 2. Add the html markup:
```html


Do you like cookies? 🍪 We use cookies to ensure you get the best experience on our website. Learn more


I agree

```

#### 3. Include the JavaScript after the html markup
```html

```

### Take a look at [`demo-bs5.html`](https://github.com/Wruczek/Bootstrap-Cookie-Alert/blob/gh-pages/demo-bs5.html) for a working example

### Accept event
If you need to, you can listen for the `cookieAlertAccept` event to get notified when the user accepts the cookies.

```js
window.addEventListener("cookieAlertAccept", function() {
alert("cookies accepted")
})
```