on master help sign in
Indice navigation JS (first time)
209a84cMatilde Park
content/faq.md+2−2
@@ -53,13 +53,13 @@ Moons are 64 bits, issued by planets, and have names like `~doznec-salfun-naptul
53
53
54Comets are 128 bits and have no parents. They can be launched by anyone. They are temporary, disposable identities. Being disposable and essentially unlimited, they will likely not be trusted by default by others on the Arvo network, though you shouldn't have any problem until the network grows much larger. They have long, hard-to-memorize names, like `~racmus-mollen-fallyt-linpex--watres-sibbur-modlux-rinmex`.
54Comets are 128 bits and have no parents. They can be launched by anyone. They are temporary, disposable identities. Being disposable and essentially unlimited, they will likely not be trusted by default by others on the Arvo network, though you shouldn't have any problem until the network grows much larger. They have long, hard-to-memorize names, like `~racmus-mollen-fallyt-linpex--watres-sibbur-modlux-rinmex`.
55
55
56−### What is a `@p`? Why is my username generated for me? {#what-is-@p}
56+### What is a `@p`? Why is my username generated for me? {#what-is-patp}
57
57
58A `@p` (pronounced *pat-pee*) is a name like `~zod` or `~lodleb-ritrul` composed of pronounceable, three-letter phonemic elements like `zod`, `lod`, `leb`, `rit` and `rul`. Shorter names, such as `~zod` and `~marzod`, are assigned to ships with special duties on the Arvo network ([stars and galaxies](@/docs/concepts/galaxies-stars-and-planets.md), respectively. Longer names like `~palfun-foslup` are identities for typical users.
58A `@p` (pronounced *pat-pee*) is a name like `~zod` or `~lodleb-ritrul` composed of pronounceable, three-letter phonemic elements like `zod`, `lod`, `leb`, `rit` and `rul`. Shorter names, such as `~zod` and `~marzod`, are assigned to ships with special duties on the Arvo network ([stars and galaxies](@/docs/concepts/galaxies-stars-and-planets.md), respectively. Longer names like `~palfun-foslup` are identities for typical users.
59
59
60These names map directly to a corresponding number in the urbit address space. Galaxies occupy the 8-bit address space, so any galaxy is actually a number between zero and 255. Stars occupy the 16-bit address space, and planets occupy the 32-bit address space.
60These names map directly to a corresponding number in the urbit address space. Galaxies occupy the 8-bit address space, so any galaxy is actually a number between zero and 255. Stars occupy the 16-bit address space, and planets occupy the 32-bit address space.
61
61
62−### Can I change my `@p`? {#change-my-@p}
62+### Can I change my `@p`? {#change-my-patp}
63
63
64Unfortunately not, since there is a 1:1 mapping between name and point.
64Unfortunately not, since there is a 1:1 mapping between name and point.
65
65
sass/_main.scss+3
@@ -391,4 +391,7 @@ body.page-indiced {
391 max-height: 100vh;
391 max-height: 100vh;
392 overflow-y: scroll;
392 overflow-y: scroll;
393 }
393 }
394+ a.current {
395+ font-weight: 600;
396+ }
394}
397}
static/scripts.js+43−11
@@ -314,18 +314,7 @@ if (document.readyState === "complete" ||
314 });
314 });
315}
315}
316
316
317−// Scroll to current document in nav list.
318−// let docsNavScroll = function() {
319−// let docsNav = document.querySelectorAll("ul.content-nav__index a")
320−// for (let link in docsNav) {
321−// if (window.location.href.includes(docsNav[link].href)) {
322−// docsNav[link].scrollIntoView()
323−// }
324−// }
325−//}
326−
327if (window.location.href.includes("docs")) {
317if (window.location.href.includes("docs")) {
328−// docsNavScroll();
329 tippy('.tooltip', {
318 tippy('.tooltip', {
330 content(reference) {
319 content(reference) {
331 const title = reference.getAttribute('title')
320 const title = reference.getAttribute('title')
@@ -335,4 +324,47 @@ if (window.location.href.includes("docs")) {
335 animateFill: false,
324 animateFill: false,
336 animation: 'fade'
325 animation: 'fade'
337 })
326 })
327+}
328+
329+// same-page navigation on-scroll behaviour
330+
331+if (document.body.classList.contains("page-indiced")) {
332+let h2 = document.getElementsByTagName("h2");
333+let h3 = document.getElementsByTagName("h3");
334+let all = document.querySelectorAll("nav details li a");
335+let headers = document.querySelectorAll("details summary");
336+
337+// smooth scrolling on click
338+all.forEach(link => {
339+ link.addEventListener("click", event => {
340+ event.preventDefault();
341+ let target = document.querySelector(event.target.hash);
342+ target.scrollIntoView({
343+ behavior: "smooth",
344+ block: "start"
345+ });
346+ });
347+});
348+
349+let lastId;
350+let cur = [];
351+
352+window.addEventListener("scroll", event => {
353+ let fromTop = window.scrollY;
354+
355+ all.forEach(link => {
356+ let section = document.querySelector(link.hash);
357+
358+ if (
359+ section.offsetTop <= fromTop &&
360+ section.offsetTop + section.offsetHeight > fromTop
361+ ) {
362+ link.classList.add("current");
363+ } else {
364+ link.classList.remove("current");
365+ }
366+ });
367+
368+});
369+
338}
370}
templates/page_indiced.html+1−1
@@ -38,7 +38,7 @@
38{% if h2.children %}
38{% if h2.children %}
39<details class="page-indiced"><summary>{{ h2.title }}</summary>
39<details class="page-indiced"><summary>{{ h2.title }}</summary>
40 {% for h3 in h2.children %}
40 {% for h3 in h2.children %}
41− <li class="ml3 mv1"><a href="{{h3.permalink}}">{{h3.title}}</a></li>
41+ <li class="ml3 mv1"><a href="{{h3.permalink | safe}}">{{h3.title}}</a></li>
42 {% endfor %}
42 {% endfor %}
43</details>
43</details>
44{% else %}
44{% else %}