@rizom/site-rizom-ai 0.2.0-alpha.265 → 0.2.0-alpha.266

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -39095,9 +39095,45 @@ var story_default = `/* The story pages: chapters beside one drawing, under the
39095
39095
  .net-leads {
39096
39096
  opacity: calc(1 - clamp(0, var(--handover, 0) * 2, 1));
39097
39097
  }
39098
- /* The figure's first drawing opens out of the point the network drew into. */
39098
+ /* The figure's first drawing opens out of the point the network drew into;
39099
+ the figure draws back into the point as the Asked-before chapter arrives
39100
+ with its own drawing, and opens again as the chapter after it does. */
39099
39101
  .living-org .o-box {
39100
- scale: clamp(0, var(--handover, 0) - 1, 1);
39102
+ scale: min(
39103
+ clamp(0, var(--handover, 0) - 1, 1),
39104
+ max(
39105
+ 1 - clamp(0, var(--asked, 0), 1),
39106
+ clamp(0, (var(--leaving, 0) - 1) * 2, 1)
39107
+ )
39108
+ );
39109
+ }
39110
+ /* The Asked-before chapter's drawing holds the figure's centre line while
39111
+ the chapter is read: first in the chapter's flow, so it is at the line
39112
+ from the moment the chapter reaches it. It opens out of the point as the
39113
+ chapter arrives, in half the line's distance so a short chapter still
39114
+ shows it whole, and draws back in as the next chapter does. */
39115
+ .asked > .net-layer {
39116
+ position: sticky;
39117
+ order: -1;
39118
+ top: calc(
39119
+ var(--bar-height, 4.6rem) + (100svh - var(--bar-height, 4.6rem)) / 2
39120
+ );
39121
+ left: auto;
39122
+ right: auto;
39123
+ height: 0;
39124
+ margin-left: calc(100% + var(--words-gap));
39125
+ width: calc(
39126
+ 100cqi - max(0px, (100cqi - 80rem) / 2) - clamp(1rem, 5vw, 5rem) -
39127
+ var(--words) - var(--words-gap) - clamp(1rem, 6vw, 7rem)
39128
+ );
39129
+ translate: none;
39130
+ }
39131
+ .asked > .net-layer > * {
39132
+ translate: 0 -50%;
39133
+ scale: calc(
39134
+ clamp(0, (var(--asked, 0) - 1) * 2, 1) *
39135
+ (1 - clamp(0, var(--leaving, 0), 1))
39136
+ );
39101
39137
  }
39102
39138
  }
39103
39139
  .net-svg {
@@ -39716,22 +39752,8 @@ var story_default = `/* The story pages: chapters beside one drawing, under the
39716
39752
  color: var(--color-text-muted);
39717
39753
  quotes: "\u201C" "\u201D";
39718
39754
  }
39719
- /* The chapter's drawing stands where the organism stood, beside the words,
39720
- and the organism steps aside while the chapter is read. */
39721
- .asked .net-layer {
39722
- top: 50%;
39723
- translate: 0 -50%;
39724
- left: calc(100% + var(--words-gap));
39725
- right: auto;
39726
- width: min(
39727
- calc(100svh - var(--bar-height, 4.6rem) - 2rem),
39728
- calc(100cqi - var(--words) - var(--words-gap) - clamp(1rem, 6vw, 7rem))
39729
- );
39730
- }
39731
- .story.is-asked .figure {
39732
- opacity: 0;
39733
- transition: opacity 0.6s ease;
39734
- }
39755
+ /* The chapter's drawing stands where the organism stood, beside the words
39756
+ (placed in the wide-screen block above; on a phone it takes the strip). */
39735
39757
  /* The Ask room's lead layer (the room script draws into it; the kit styles
39736
39758
  the leads): leads join words to the drawing across the page, so the
39737
39759
  viewport is their frame. On a phone the opening's drawing joins the open
@@ -41870,16 +41892,25 @@ function handoverProgress(nextTop, scrolled, viewportHeight, line) {
41870
41892
  const span = viewportHeight - line;
41871
41893
  return span <= 0 ? 2 : 1 + Math.min(1, (line - nextTop) / span);
41872
41894
  }
41895
+ function arrivalProgress(top, viewportHeight, line) {
41896
+ const span = viewportHeight - line;
41897
+ if (span <= 0)
41898
+ return top <= line ? 2 : 0;
41899
+ return Math.min(2, Math.max(0, (viewportHeight - top) / span));
41900
+ }
41873
41901
  var storyRuntimeScript = ASK_ROOM_SCRIPT + `(function () {
41874
41902
  ${currentChapter.toString()}
41875
41903
  ${readingLine.toString()}
41876
41904
  ${handoverProgress.toString()}
41905
+ ${arrivalProgress.toString()}
41877
41906
  function init() {
41878
41907
  var story = document.querySelector(".story");
41879
41908
  if (!story) return;
41880
41909
  var chapters = Array.prototype.slice.call(story.querySelectorAll(".chapter"));
41881
41910
  if (!chapters.length) return;
41882
41911
  var figure = story.querySelector(".figure");
41912
+ // The chapter that takes the figure's place with its own drawing, and the one after it.
41913
+ var lights = chapters.findIndex(function (chapter) { return chapter.hasAttribute("data-lights-network"); });
41883
41914
  var stageCount = figure ? Number(figure.dataset.stages || chapters.length) : chapters.length;
41884
41915
  var rail = document.querySelector(".rail");
41885
41916
  var railNodes = [];
@@ -41927,6 +41958,10 @@ var storyRuntimeScript = ASK_ROOM_SCRIPT + `(function () {
41927
41958
  var stage = currentChapter(tops, line, stageCount);
41928
41959
  if (figure) figure.dataset.stage = String(stage);
41929
41960
  if (tops.length > 1) story.style.setProperty("--handover", handoverProgress(tops[1], scrollY, innerHeight, line).toFixed(4));
41961
+ if (lights >= 0) {
41962
+ story.style.setProperty("--asked", arrivalProgress(tops[lights], innerHeight, line).toFixed(4));
41963
+ story.style.setProperty("--leaving", (lights + 1 < tops.length ? arrivalProgress(tops[lights + 1], innerHeight, line) : 0).toFixed(4));
41964
+ }
41930
41965
  chapters.forEach(function (chapter, i) { chapter.classList.toggle("is-current", i === current); });
41931
41966
  // A chapter that lights the network keeps the live drawing in view while it is read.
41932
41967
  story.classList.toggle("is-asked", !!(chapters[current] && chapters[current].hasAttribute("data-lights-network")));
@@ -57980,4 +58015,4 @@ export {
57980
58015
  workSections
57981
58016
  };
57982
58017
 
57983
- //# debugId=213DF796E82D7BB964756E2164756E21
58018
+ //# debugId=B1F5BE6FAAA7D59664756E2164756E21