Bladeren bron

sandpoints updates

master
Sean Dockray 4 jaren geleden
bovenliggende
commit
5a0c26e445
4 gewijzigde bestanden met toevoegingen van 19 en 11 verwijderingen
  1. +1
    -1
      static/css/site.min.css
  2. +4
    -4
      themes/sandpoints/assets/css/site.css
  3. +10
    -3
      themes/sandpoints/assets/js/sandpoints.js
  4. +4
    -3
      themes/sandpoints/layouts/partials/head.html

+ 1
- 1
static/css/site.min.css
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 4
- 4
themes/sandpoints/assets/css/site.css Bestand weergeven

@@ -9,7 +9,7 @@
*/

html {
line-height: 1.15; /* 1 */
line-height: 1.4; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}

@@ -434,6 +434,7 @@ body {

.header {
display: grid;
grid-template-columns: auto;
grid-auto-flow: column;
position: sticky;
top: 0;
@@ -540,14 +541,13 @@ img {
}

.nosup a {
color: red;
color: red;
}

.nosup a span.sup {
display: none;
display: none;
}


.syllabustitle, .coretitle {
margin-top: 4rem;
font-style: italic;


+ 10
- 3
themes/sandpoints/assets/js/sandpoints.js Bestand weergeven

@@ -9,12 +9,16 @@ window.addEventListener('scroll', function(e) {
let grid = document.querySelector('.grid')
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')) {
grid.classList.add('moved');
mantlebar.style.display = "inline";
mantletitle.style.visibility = "hidden";
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')) {
grid.classList.remove('moved');
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)

if (document.querySelector(".soundcite")) {
let relPath ="../".repeat(relPathDepth - 1);

var popcorn = document.createElement('script');
popcorn.src = `/js/popcorn.min.js`;
popcorn.src = `${relPath}js/popcorn.min.js`;
document.body.appendChild(popcorn);

var soundcite = document.createElement('script');
soundcite.src = `/js/soundcite.min.js`;
soundcite.src = `${relPath}js/soundcite.min.js`;
document.body.appendChild(soundcite);

}


+ 4
- 3
themes/sandpoints/layouts/partials/head.html Bestand weergeven

@@ -25,9 +25,10 @@
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#996561">

<script type="text/javascript">var relPathDepth = {{ .RelPermalink | strings.Count "/" }};</script>

{{ $sjsopts := dict "targetPath" "js/sandpoints.js" "minify" "true"}}
{{ $sjs := resources.Get "js/sandpoints.js" | js.Build $sjsopts }}
<script defer src='{{ $sjs.Permalink }}' type="application/javascript"></script>
<link href='https://cdn.knightlab.com/libs/soundcite/latest/css/player.css' rel='stylesheet' type='text/css'><script type='text/javascript' src='https://cdn.knightlab.com/libs/soundcite/latest/js/soundcite.min.js'></script>
<title>{{ block "title" . }}{{- .Title }} -- {{ .Site.Title -}}{{ end }}</title>
<script defer src='{{ $sjs.RelPermalink }}' type="application/javascript"></script>
<title>{{ block "title" . }}{{- .Title }} - {{ .Site.Title -}}{{ end }}</title>
</head>

Laden…
Annuleren
Opslaan