initial commit for segment introduction (#998)

* initial commit for segment introduction

* conditionals to check for window.analytics
This commit is contained in:
jasonbryant84
2024-07-02 23:51:14 +02:00
committed by GitHub
parent 87d9b71fbd
commit c22a4ceb61
9 changed files with 306 additions and 30 deletions
@@ -1,9 +1,18 @@
import scrollHandler from './scroll-handler';
import { XXL_BREAKPOINT } from './constants';
import { initGoToTopButton } from './helpers';
import { initGoToTopButton, getCookie } from './helpers';
import { loadSegment, createSegmentStoredPage, tagAllAnchors } from './segment-helpers'
createSegmentStoredPage();
// on document ready
document.addEventListener('DOMContentLoaded', function () {
tagAllAnchors();
if (!window.analytics && getCookie('cookie-consent')) {
loadSegment();
}
// Header scroll
const body = document.querySelector('body');
const header = document.querySelector('.site-header');