bootstrap-cookie-alert

WebJar for bootstrap-cookie-alert

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

bootstrap-cookie-alert
Last Version

Last Version

1.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

bootstrap-cookie-alert
WebJar for bootstrap-cookie-alert
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/Wruczek/Bootstrap-Cookie-Alert

Download bootstrap-cookie-alert

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/bootstrap-cookie-alert/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>bootstrap-cookie-alert</artifactId>
    <version>1.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/bootstrap-cookie-alert/
implementation 'org.webjars.npm:bootstrap-cookie-alert:1.2.1'
// https://jarcasting.com/artifacts/org.webjars.npm/bootstrap-cookie-alert/
implementation ("org.webjars.npm:bootstrap-cookie-alert:1.2.1")
'org.webjars.npm:bootstrap-cookie-alert:jar:1.2.1'
<dependency org="org.webjars.npm" name="bootstrap-cookie-alert" rev="1.2.1">
  <artifact name="bootstrap-cookie-alert" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='bootstrap-cookie-alert', version='1.2.1')
)
libraryDependencies += "org.webjars.npm" % "bootstrap-cookie-alert" % "1.2.1"
[org.webjars.npm/bootstrap-cookie-alert "1.2.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Bootstrap-Cookie-Alert

A simple, good looking cookie alert for Bootstrap. No dependencies required.
We recommend using Bootstrap 4, but Boostrap 3 should work fine as well.

Demo (with Bootstrap 4)

I unfortunately dont remeber 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
I try to keep it up-to-date. Let me know if I forget to release an update.

How to use

1. In the head of your document, include cookiealert.css after Bootstrap.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Wruczek/Bootstrap-Cookie-Alert@gh-pages/cookiealert.css">

2. Add the html markup:

<!-- START Bootstrap-Cookie-Alert -->
<div class="alert text-center cookiealert" role="alert">
    <b>Do you like cookies?</b> &#x1F36A; We use cookies to ensure you get the best experience on our website. <a href="https://cookiesandyou.com/" target="_blank">Learn more</a>

    <button type="button" class="btn btn-primary btn-sm acceptcookies">
        I agree
    </button>
</div>
<!-- END Bootstrap-Cookie-Alert -->

3. Include the JavaScript after the html markup

<script src="https://cdn.jsdelivr.net/gh/Wruczek/Bootstrap-Cookie-Alert@gh-pages/cookiealert.js"></script>

Take a look at demo.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.

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

Versions

Version
1.2.1