feat(cookies): add Cookie consent banner (#355)

This commit is contained in:
Dillon
2020-05-13 21:19:39 +08:00
committed by GitHub
parent 8d491509e0
commit 0a9ec97450
32 changed files with 237 additions and 44 deletions

View File

@@ -626,6 +626,10 @@ class Theme {
if (SmoothScroll) new SmoothScroll('[href^="#"]', { speed: 300, speedAsDuration: true, header: '#header-desktop' });
}
initCookieconsent() {
if (this.config.cookieconsent) cookieconsent.initialise(this.config.cookieconsent);
}
onScroll() {
const $headers = [];
if (document.body.getAttribute('header-desktop') === 'auto') $headers.push(document.getElementById('header-desktop'));
@@ -706,6 +710,7 @@ class Theme {
this.initEcharts();
this.initTypeit();
this.initMapbox();
this.initCookieconsent();
this.onScroll();
this.onResize();