Skip to content

faesslich/cookieconsent_v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cookie Consent V2 - by Faesslich

Add JavaScript

JS (ES6 import):

import cookieConsent from './src/js/cookieconsent_v2'; // path may depend on your installation

var ccObjOverride = {}; // can override all given options in cookieConsent object
document.addEventListener('DOMContentLoaded', cookieConsent.onFirstLoad);
cookieConsent.initialise(ccObjOverride);

JS static include:

<script src="./dist/js/cookieconsent_v2.min.js"></script>
<script>
    var ccObjOverride = {}; // can override all given options in cookieConsent object
    document.addEventListener('DOMContentLoaded', cookieConsent.onFirstLoad);
    cookieConsent.initialise(ccObjOverride);
</script>

Add styling (optional if you'd like to style by yourself)

SCSS

@import 'cookieconsent_v2.scss';

CSS

<link rel="stylesheet" href="./dist/css/cookieconsent_v2.min.css">

(S)CSS & JavaScript

  • For changing and compiling SCSS and JavaScript we need to work with webpack.

navigate to root folder where package.json is located and type in:

npm install

Obviously we need Node.js and npm installed on our machine.


Now webpack needs to be triggered to watch the specific files. Therefore use:

npm run watcher

Webpack will now watch all of the files in the subfolder scss and js and will compile them to a browser ready file you're NOT allowed to change anymore!

The compiled files will be placed inside dist/css and dist/js.

Browsers support

IE / Edge Firefox Chrome Safari iOS Safari Opera
IE11, Edge last 5 versions last 5 versions last 2 versions last 2 versions last 5 versions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors