1
0
mirror of https://github.com/ipdb/website.git synced 2024-11-12 00:04:48 +01:00
website/_src/_assets/js/ipdb.js

50 lines
1.3 KiB
JavaScript
Raw Normal View History

2017-09-05 23:54:33 +02:00
/* global SmoothScroll, Autogrow, Cookiebanner */
2017-08-29 15:09:36 +02:00
/* eslint-disable spaced-comment */
//=include _dnt.js
//=include _newsletter.js
//=include smooth-scroll/dist/js/smooth-scroll.js
//=include textarea-autogrow/textarea-autogrow.js
2017-09-05 23:54:33 +02:00
//=include cookie-banner/src/cookiebanner.js
/* eslint-enable spaced-comment */
2017-08-09 17:38:44 +02:00
2017-08-29 13:51:54 +02:00
document.addEventListener('DOMContentLoaded', () => {
2017-08-30 15:58:38 +02:00
//
// init smooth scroll
//
2017-08-29 13:51:54 +02:00
const scroll = new SmoothScroll('a[data-scroll]', {
easing: 'easeOutQuint'
})
2017-08-30 15:58:38 +02:00
//
// init textarea autogrow
//
const textarea = document.querySelector('textarea')
if (textarea) {
const growingTextarea = new Autogrow(textarea)
}
2017-08-29 13:51:54 +02:00
})
2017-09-05 23:54:33 +02:00
//
// 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()