1
0
mirror of https://github.com/ipdb/website.git synced 2024-12-28 15:47:44 +01:00

cookie banner

* closes #4
This commit is contained in:
Matthias Kretschmann 2017-09-05 23:54:33 +02:00
parent 12b973ef54
commit 6bbf89731b
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 41 additions and 2 deletions

View File

@ -1,11 +1,11 @@
/* global SmoothScroll */
/* global Autogrow */
/* global SmoothScroll, Autogrow, Cookiebanner */
/* eslint-disable spaced-comment */
//=include _dnt.js
//=include _newsletter.js
//=include smooth-scroll/dist/js/smooth-scroll.js
//=include textarea-autogrow/textarea-autogrow.js
//=include cookie-banner/src/cookiebanner.js
/* eslint-enable spaced-comment */
document.addEventListener('DOMContentLoaded', () => {
@ -25,3 +25,25 @@ document.addEventListener('DOMContentLoaded', () => {
const growingTextarea = new Autogrow(textarea)
}
})
//
// Cookie banner
//
// this global variable name seem not smart, plugin requires it though
// https://github.com/dobarkod/cookie-banner
const options = {
message: 'By using this website you agree to our <a>cookie policy</a>.',
linkmsg: ' ',
fontFamily: 'inherit',
fontSize: '15px',
bg: 'rgba(234, 243, 245, .7)',
fg: 'inherit',
link: '#cc6bb3',
closeText: '&times;',
closeStyle: 'font-size:1.1rem;float:right;padding:5px;margin:-5px;margin-top:-4px',
minHeight: '18px',
moreinfo: '/privacy/',
effect: 'fade'
}
const cookiebanner = new Cookiebanner(options); cookiebanner.run()

View File

@ -0,0 +1,15 @@
// Mostly styled with options in js, the rest here
.cookiebanner {
border-top-left-radius: 1rem;
border-top-right-radius: 1rem;
@media ($screen-sm) {
// stylelint-disable declaration-no-important
left: 30% !important;
right: 30% !important;
line-height: 18px !important;
// stylelint-enable declaration-no-important
max-width: 25rem;
}
}

View File

@ -16,6 +16,7 @@
@import 'logo';
@import 'caretakers';
@import 'board';
@import 'cookiebanner';
.content--page--markdown {
padding-top: $spacer * 2;

View File

@ -29,6 +29,7 @@
],
"dependencies": {
"ajaxchimp": "^1.3.0",
"cookie-banner": "github:dobarkod/cookie-banner",
"jquery": "^3.2.1",
"smooth-scroll": "^12.1.4",
"textarea-autogrow": "^1.0.0"