Added course's notes
This commit is contained in:
1 parent
e07993262c
commit
dcd2c072ae
191 files changed
+42866
-12
No files matched your search
@@ -0,0 +1,77 @@
|
||||
/* glossary — usages, entries, hover tooltip */
|
||||
|
||||
/* usages: dotted underline, keep math color */
|
||||
a.gls-sym,
|
||||
mjx-container a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
.gls-sym {
|
||||
border-bottom: 1px dotted currentColor;
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
/* rendered glossary list */
|
||||
.glossary .gls-entry {
|
||||
margin: 0.8rem 0;
|
||||
padding: 0.35rem 0.7rem;
|
||||
border-left: 3px solid var(--calc-notecolor, #B45309);
|
||||
scroll-margin-top: 5rem; /* don't hide behind Quarto's sticky header */
|
||||
}
|
||||
.glossary .gls-entry p { margin: 0 0 0.2rem; }
|
||||
.glossary .gls-entry:target {
|
||||
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
/* floating hover tooltip (filled by glossary.js) */
|
||||
.gls-float {
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
max-width: 26rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
border: 1px solid var(--calc-notecolor, #B45309);
|
||||
border-radius: 0.4rem;
|
||||
background: var(--bs-body-bg, #fff);
|
||||
color: var(--bs-body-color, #1a1a1a);
|
||||
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
|
||||
font-size: 0.9em;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.gls-float p { margin: 0 0 0.25rem; }
|
||||
.gls-float p:last-child { margin-bottom: 0; }
|
||||
|
||||
/* in-place definition cards and property sub-entries */
|
||||
.gls-inline {
|
||||
margin: 1rem 0;
|
||||
padding: 0.4rem 0.8rem;
|
||||
border-left: 3px solid var(--calc-notecolor, #B45309);
|
||||
scroll-margin-top: 5rem;
|
||||
}
|
||||
.gls-inline p { margin: 0 0 0.3rem; }
|
||||
.gls-inline:target,
|
||||
.gls-prop-entry:target {
|
||||
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
.gls-prop-entry {
|
||||
margin: 0.5rem 0 0.5rem 1.2rem;
|
||||
padding: 0.25rem 0.6rem;
|
||||
border-left: 2px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 45%, transparent);
|
||||
font-size: 0.95em;
|
||||
scroll-margin-top: 5rem;
|
||||
}
|
||||
.gls-back {
|
||||
font-size: 0.85em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
/* standalone property cards keep the section flow (no indent) */
|
||||
.gls-prop-entry.gls-standalone {
|
||||
margin-left: 0;
|
||||
font-size: 1em;
|
||||
}
|
||||
.glossary .gls-prop-line {
|
||||
margin: 0.1rem 0 0.1rem 1.2rem;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
// glossary — hover tooltip for .gls-sym usages (prose links and MathJax \class nodes)
|
||||
(function () {
|
||||
var tip = null;
|
||||
|
||||
function ensureTip() {
|
||||
if (tip === null) {
|
||||
tip = document.createElement("div");
|
||||
tip.className = "gls-float";
|
||||
tip.style.display = "none";
|
||||
document.body.appendChild(tip);
|
||||
}
|
||||
return tip;
|
||||
}
|
||||
|
||||
function keyOf(el) {
|
||||
if (el.dataset && el.dataset.glsKey) return el.dataset.glsKey;
|
||||
for (var i = 0; i < el.classList.length; i++) {
|
||||
var c = el.classList[i];
|
||||
if (c.indexOf("gls-key-") === 0) return c.slice(8);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function show(target) {
|
||||
var key = keyOf(target);
|
||||
if (!key) return;
|
||||
var entry = document.getElementById("gls-" + key);
|
||||
var t = ensureTip();
|
||||
if (entry) {
|
||||
// for a main entry, don't drag every property into the popup
|
||||
var node = entry.cloneNode(true);
|
||||
node.querySelectorAll(".gls-prop-entry").forEach(function (n) { n.remove(); });
|
||||
t.innerHTML = node.innerHTML;
|
||||
} else if (window.__glsData && window.__glsData[key]) {
|
||||
// entry lives on another page (book chapters render separately)
|
||||
t.innerHTML = window.__glsData[key];
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
t.style.display = "block";
|
||||
if (window.MathJax && window.MathJax.typesetPromise) {
|
||||
window.MathJax.typesetPromise([t]).catch(function () {});
|
||||
}
|
||||
var r = target.getBoundingClientRect();
|
||||
var x = r.left + window.scrollX;
|
||||
var y = r.bottom + window.scrollY + 6;
|
||||
// keep it on screen horizontally
|
||||
var w = t.offsetWidth;
|
||||
var maxX = window.scrollX + document.documentElement.clientWidth - w - 12;
|
||||
t.style.left = Math.max(window.scrollX + 8, Math.min(x, maxX)) + "px";
|
||||
t.style.top = y + "px";
|
||||
}
|
||||
|
||||
function hide() {
|
||||
if (tip !== null) tip.style.display = "none";
|
||||
}
|
||||
|
||||
document.addEventListener("mouseover", function (e) {
|
||||
var el = e.target.closest ? e.target.closest(".gls-sym") : null;
|
||||
if (el) show(el);
|
||||
});
|
||||
document.addEventListener("mouseout", function (e) {
|
||||
var el = e.target.closest ? e.target.closest(".gls-sym") : null;
|
||||
if (el) hide();
|
||||
});
|
||||
document.addEventListener("click", hide);
|
||||
window.addEventListener("scroll", hide, { passive: true });
|
||||
})();
|
||||
Reference in new issue
Block a user