diff --git a/_layouts/delta-refgram.html b/_layouts/delta-refgram.html index d05a63a..b8bb859 100644 --- a/_layouts/delta-refgram.html +++ b/_layouts/delta-refgram.html @@ -33,6 +33,8 @@
+
Table of contents
+ {% include toc.html html=content ordered=true h_min=2 h_max=3 sanitize=true %}
{{ content }} @@ -56,4 +58,5 @@ + diff --git a/refgram/css/style.css b/refgram/css/style.css index 4c4fe84..f372163 100644 --- a/refgram/css/style.css +++ b/refgram/css/style.css @@ -665,24 +665,6 @@ table.conjunctionexamples th { } } -@media (min-width: 1200px) { - .delta-refgram .toc { - position: fixed; - right: 0; - top: 0; - bottom: 0; - display: block; - border-top: none; - border-bottom: none; - width: calc(min(15%, 250px)); - overflow-y: auto; - } - .delta-refgram { - margin-left: calc(max(-15%, -250px)); - position: relative; - } -} - .toc { border: 1px solid #00aaff; margin: auto; @@ -691,6 +673,17 @@ table.conjunctionexamples th { font-size: 14px; } +.toc-header { + text-align: center; +} + +.toc-title { + display: none; + text-align: center; + font-size: 24px; + font-weight: bold; +} + .toc ol { padding-inline-start: 20px; } @@ -702,4 +695,28 @@ table.conjunctionexamples th { .toc a:hover { text-decoration: underline; -} \ No newline at end of file +} + +@media (min-width: 1200px) { + .delta-refgram .toc { + position: fixed; + right: 0; + top: 0; + bottom: 0; + display: block; + border-top: none; + border-bottom: none; + width: calc(min(15%, 250px)); + overflow-y: hidden; + } + .toc-header { + display: none; + } + .toc-title { + display: block; + } + .delta-refgram { + margin-left: calc(max(-15%, -250px)); + position: relative; + } +} diff --git a/refgram/css/toc.js b/refgram/css/toc.js new file mode 100644 index 0000000..2af5eac --- /dev/null +++ b/refgram/css/toc.js @@ -0,0 +1,25 @@ +function handleScroll() { + const as = [...document.querySelectorAll(".toc a")].reverse(); + const toc = document.querySelector(".toc"); + const scrollable = toc.scrollHeight > toc.clientHeight; + let done = false; + for (const a of as) { + a.style.color = ""; + if (!done) { + const header = document.getElementById(a.href.split("#")[1]); + if (!header) continue; + const top = header.getBoundingClientRect().top; + if (top < window.innerHeight / 5) { + a.style.color = "white"; + if (scrollable) { + a.scrollIntoView({ block: "center" }); + } + done = true; + } + } + } + document.querySelector(".toc-title>a").style.color = done ? "" : "white"; +} + +window.addEventListener("scroll", handleScroll); +handleScroll(); diff --git a/refgram/orthography/index.html b/refgram/orthography/index.html index 725c1ba..0d6a33f 100644 --- a/refgram/orthography/index.html +++ b/refgram/orthography/index.html @@ -5,6 +5,8 @@ ---

Orthography

+

Latin orthography

+ @@ -129,9 +131,9 @@

Orthograph

In informal, relaxed settings, these conventions need not apply.

-

󱚶󱚴󱚻󱚺󱚵󱚹

+

Derani

-

Deranı (pronounced [ˈdɛːɾani]) is the native writing system of Toaq and the official script of Toaq Delta. It is written in a pink font throughout the website, while romanized words are written in light blue.

+

Deranı 󱚶󱚴󱚻󱚺󱚵󱚹 (pronounced [ˈdɛːɾani]) is the native writing system of Toaq and the official script of Toaq Delta. It is written in a pink font throughout the website, while romanized words are written in light blue.

Deranı is an alphabet with a number of special symbols and markings for various grammar-related phenomena.

@@ -239,7 +241,7 @@

The Derani vowelsThe default assumption when reading Deranı words should be that they begin with a consonant. If the second letter is a consonant-only glyph, then the reader immediately knows that the first letter must be a vowel. With practice, this becomes automatic.

-

Tone marking

+

Tone marking

The falling tone is never marked.

@@ -282,7 +284,7 @@

Tone marking

! 'the sand' -

Prefix-stem delineation

+

Prefix-stem delineation

The stem of a word is separated from its prefixes by 󱛒