-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
78 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
function highlightAnnotation() { | ||
if (Number(location.hash.substr(1,))) { | ||
Array.from(document.querySelectorAll('.mark')).forEach(e => e.classList.remove('mark')) | ||
document.querySelector(`[id="${location.hash.slice(1,)}"]`).classList.add('mark') | ||
const $ = query => document.querySelector(query) | ||
const $$ = query => Array.from(document.querySelectorAll(query)) | ||
|
||
{% include scripts/font.js %} | ||
|
||
{% include scripts/book.js %} | ||
|
||
window.addEventListener("load", function () { | ||
if (localStorage.getItem('font')) { | ||
setFont(localStorage.getItem('font')) | ||
} | ||
} | ||
highlightAnnotation() | ||
window.onhashchange = highlightAnnotation; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function setFont(font) { | ||
const selectEl = $(`#fontselect [name=${font}]`) | ||
const sitefont = selectEl.value | ||
selectEl.selected = true | ||
$("body").style.setProperty("--body-font", sitefont) | ||
$("html").style.fontSize = selectEl.getAttribute("size") | ||
} | ||
|
||
function changeBodyFont(ev) { | ||
const fontname = $("#fontselect").selectedOptions[0].getAttribute("name") | ||
setFont(fontname) | ||
localStorage.setItem("font", fontname) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,46 @@ | ||
body{width:100%;height:100%;overflow-x:hidden;margin:0 0;padding:0 0;font-size:inherit;font-family:var(--body-font,courier);font-variant:proportional-nums} | ||
a:hover{font-weight:700;color:#045bb1} | ||
a{color:#0063c4} | ||
.container{line-height:1.3} | ||
.container main{padding:0 1rem} | ||
header{padding:.5rem 1rem;margin-bottom:.5rem;background:#fff;position:sticky;top:0} | ||
.mark q{background:#ff0} | ||
hr{border:0;border-bottom:1px solid #aaa;box-shadow:0} | ||
.bookmark q{white-space:pre-wrap} | ||
.chapters ul[data-label]:before{font-size:1.35rem;content:attr(data-label);margin-top:1.5rem;font-family:times;font-weight:700;margin-left:-1.25rem} | ||
.chapters ul{display:flex;flex-direction:column;gap:1rem} | ||
.toc{max-height:min(300px,40vh);position:sticky;top:0;font-size:.9rem;z-index:1;width:20px;max-width:20px} | ||
.toc a{display:block;text-decoration:none;color:var(--body-color);font-weight:400;white-space:pre;padding:0 4px;line-height:1} | ||
.toc a:hover{text-decoration:none;color:var(--accent-color)} | ||
.toc a:hover:before{content:attr(title);position:absolute;right:1.5rem;background:hsl(var(--h),90%,80%);padding:2px 4px;color:hsl(var(--h),40%,20%);z-index:1;font-size:.8rem} | ||
.toc{max-height:min(300px,40vh);position:sticky;top:1rem;font-size:.9rem;z-index:1;width:20px;max-width:20px} | ||
.toc a{display:block;text-decoration:none;font-weight:400;white-space:pre;padding:0 4px;line-height:1;color:#222} | ||
.toc a:hover{text-decoration:none;background:#eee} | ||
.toc a:hover:after{text-decoration:none;border:0;content:attr(title);position:absolute;right:1.5rem;background:#fff;padding:2px 4px;z-index:1;font-size:.8rem} | ||
.flex{display:flex} | ||
.sb{justify-content:space-between} | ||
.wrap{flex-wrap:wrap} | ||
.gap{gap:var(--gap,1rem)} | ||
.column-reverse{flex-direction:column-reverse} | ||
.col{flex-direction:column} | ||
table{line-height:1.3;border-collapse:collapse} | ||
tr>*{padding-bottom:.5rem} | ||
.acenter{align-content:center;align-items:center} | ||
.my-0{margin-top:0;margin-bottom:0} | ||
table{line-height:1.3;border-collapse:collapse;width:100%;margin:1rem 0} | ||
tr.header{border-bottom:1px solid #aaa} | ||
th[data-level="1"]{margin-bottom:0;padding-bottom:0;padding:.25rem} | ||
tr>*{padding-top:.75rem} | ||
td,th{vertical-align:top} | ||
th date{white-space:pre;font-weight:400;color:#8e8e8e} | ||
th{border-right:1px dotted var(--body-color);line-height:1} | ||
th[data-level="1"]{border:0;white-space:pre;transition:all .6s linear;max-width:min-content;text-align:right} | ||
th[data-level="1"]{text-align:left;border:0;white-space:pre;transition:all .6s linear;max-width:min-content} | ||
th[data-level="2"]{text-align:right} | ||
td[colspan]{padding-left:11%} | ||
tr{line-height:1.2} | ||
tr .padded:nth-child(1){padding-right:.75rem} | ||
tr .padded:nth-child(2){padding-left:.75rem} | ||
.muted,a.muted{text-decoration:none;color:gray} | ||
|
||
q:before{content:""} | ||
q:after{content:""} | ||
q:after{content:""} | ||
aside ul{width:80%} | ||
.bookmark .meta{color:#a5a5a5;margin-top:.25rem} | ||
.bookmark .meta a:hover+span+time{color:#000} | ||
.site-title{margin:0 0;font-size:1.5rem} | ||
.small{font-size:80%} | ||
h2{margin:.5rem 0} | ||
h3{margin:.25rem 0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters