|
@@ -9,12 +9,16 @@ window.addEventListener('scroll', function(e) { |
|
|
let grid = document.querySelector('.grid') |
|
|
let grid = document.querySelector('.grid') |
|
|
let gridrect = mantletitle.getBoundingClientRect(); |
|
|
let gridrect = mantletitle.getBoundingClientRect(); |
|
|
|
|
|
|
|
|
|
|
|
if ((document.querySelector('body').clientHeight - (grid.clientHeight + mantle.clientHeight + 32)) < window.innerHeight) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (gridrect.top < 20 && !grid.classList.contains('moved')) { |
|
|
if (gridrect.top < 20 && !grid.classList.contains('moved')) { |
|
|
grid.classList.add('moved'); |
|
|
grid.classList.add('moved'); |
|
|
mantlebar.style.display = "inline"; |
|
|
mantlebar.style.display = "inline"; |
|
|
mantletitle.style.visibility = "hidden"; |
|
|
mantletitle.style.visibility = "hidden"; |
|
|
grid.style.display = "none"; |
|
|
grid.style.display = "none"; |
|
|
window.scrollBy({top: grid.clientHeight + mantletitle.clientHeight, behavior: 'smooth'}) |
|
|
|
|
|
|
|
|
window.scrollBy({top: mantletitle.clientHeight, behavior: 'smooth'}) |
|
|
} else if (gridrect.top > 21 && grid.classList.contains('moved')) { |
|
|
} else if (gridrect.top > 21 && grid.classList.contains('moved')) { |
|
|
grid.classList.remove('moved'); |
|
|
grid.classList.remove('moved'); |
|
|
mantletitle.style.visibility = "visible"; |
|
|
mantletitle.style.visibility = "visible"; |
|
@@ -53,11 +57,14 @@ window.addEventListener('DOMContentLoaded', (e) => { |
|
|
document.querySelector("#TableOfContents > ol:first-child").insertBefore(s, document.querySelector("#TableOfContents > ol:first-child").firstChild) |
|
|
document.querySelector("#TableOfContents > ol:first-child").insertBefore(s, document.querySelector("#TableOfContents > ol:first-child").firstChild) |
|
|
|
|
|
|
|
|
if (document.querySelector(".soundcite")) { |
|
|
if (document.querySelector(".soundcite")) { |
|
|
|
|
|
let relPath ="../".repeat(relPathDepth - 1); |
|
|
|
|
|
|
|
|
var popcorn = document.createElement('script'); |
|
|
var popcorn = document.createElement('script'); |
|
|
popcorn.src = `/js/popcorn.min.js`; |
|
|
|
|
|
|
|
|
popcorn.src = `${relPath}js/popcorn.min.js`; |
|
|
document.body.appendChild(popcorn); |
|
|
document.body.appendChild(popcorn); |
|
|
|
|
|
|
|
|
var soundcite = document.createElement('script'); |
|
|
var soundcite = document.createElement('script'); |
|
|
soundcite.src = `/js/soundcite.min.js`; |
|
|
|
|
|
|
|
|
soundcite.src = `${relPath}js/soundcite.min.js`; |
|
|
document.body.appendChild(soundcite); |
|
|
document.body.appendChild(soundcite); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|