@rizom/site-rizom-ai 0.2.0-alpha.264 → 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
@@ -39062,9 +39062,11 @@ var story_default = `/* The story pages: chapters beside one drawing, under the
39062
39062
  before the opening in the chapters column and sticks at the figure's centre
39063
39063
  line down the whole story (the story is a size container, so nothing in it
39064
39064
  can be fixed to the screen). It stays while the opening is read, an answer
39065
- included, and the words scroll past it. Once the reading has moved the
39066
- figure on, it draws into its centre point and the figure's first drawing
39067
- opens out of that same point; back up the page, the other way round. */
39065
+ included, and the words scroll past it. The handover to the figure follows
39066
+ the scroll (--handover, set by the runtime from the science's top on the
39067
+ screen): as the science comes up the network draws into its centre point,
39068
+ and past the reading line the figure's first drawing opens out of that same
39069
+ point; scrolling back runs it backwards. */
39068
39070
  @media not all and (max-width: 60rem) {
39069
39071
  /* The words are the room's column (the kit scrolls it within the screen);
39070
39072
  the bar and the opening's 4rem of padding above and below stay clear, so
@@ -39085,26 +39087,53 @@ var story_default = `/* The story pages: chapters beside one drawing, under the
39085
39087
  100cqi - max(0px, (100cqi - 80rem) / 2) - clamp(1rem, 5vw, 5rem) -
39086
39088
  var(--words) - var(--words-gap) - clamp(1rem, 6vw, 7rem)
39087
39089
  );
39088
- /* Back from the point, lit at once. */
39089
- transition: opacity 0.3s ease;
39090
39090
  }
39091
39091
  :where(.chapters) > .net-layer > * {
39092
39092
  translate: 0 -50%;
39093
- transition: scale 1.2s cubic-bezier(0.3, 0.7, 0.2, 1);
39093
+ scale: calc(1 - clamp(0, var(--handover, 0), 1));
39094
39094
  }
39095
- .story:has(.figure:not([data-stage="0"])) :where(.chapters) > .net-layer > * {
39096
- scale: 0;
39097
- }
39098
- .story:has(.figure:not([data-stage="0"])) :where(.chapters) > .net-layer,
39099
- .story:has(.figure:not([data-stage="0"])) .net-leads {
39100
- opacity: 0;
39095
+ .net-leads {
39096
+ opacity: calc(1 - clamp(0, var(--handover, 0) * 2, 1));
39097
+ }
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. */
39101
+ .living-org .o-box {
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
+ );
39101
39109
  }
39102
- /* Lit while it draws in; out at the point. */
39103
- .story:has(.figure:not([data-stage="0"])) :where(.chapters) > .net-layer {
39104
- transition: opacity 0.6s ease 0.6s;
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;
39105
39130
  }
39106
- .net-leads {
39107
- transition: opacity 0.6s ease;
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
+ );
39108
39137
  }
39109
39138
  }
39110
39139
  .net-svg {
@@ -39723,22 +39752,8 @@ var story_default = `/* The story pages: chapters beside one drawing, under the
39723
39752
  color: var(--color-text-muted);
39724
39753
  quotes: "\u201C" "\u201D";
39725
39754
  }
39726
- /* The chapter's drawing stands where the organism stood, beside the words,
39727
- and the organism steps aside while the chapter is read. */
39728
- .asked .net-layer {
39729
- top: 50%;
39730
- translate: 0 -50%;
39731
- left: calc(100% + var(--words-gap));
39732
- right: auto;
39733
- width: min(
39734
- calc(100svh - var(--bar-height, 4.6rem) - 2rem),
39735
- calc(100cqi - var(--words) - var(--words-gap) - clamp(1rem, 6vw, 7rem))
39736
- );
39737
- }
39738
- .story.is-asked .figure {
39739
- opacity: 0;
39740
- transition: opacity 0.6s ease;
39741
- }
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). */
39742
39757
  /* The Ask room's lead layer (the room script draws into it; the kit styles
39743
39758
  the leads): leads join words to the drawing across the page, so the
39744
39759
  viewport is their frame. On a phone the opening's drawing joins the open
@@ -40487,11 +40502,7 @@ var livingOrganism = organism({
40487
40502
  ...Object.fromEntries(economy.map((_2, i) => [`E${i + 1}`, i % 3 === 0 ? "lantern" : ""]))
40488
40503
  },
40489
40504
  stages: [
40490
- {
40491
- T1: [C3, 300, 0, 0],
40492
- T2: [C3, 300, 0, 0],
40493
- T3: [C3, 300, 0, 0]
40494
- },
40505
+ {},
40495
40506
  {
40496
40507
  L: [C3, 300, 8, 1],
40497
40508
  T1: at(team2[0], 6),
@@ -41874,15 +41885,32 @@ function readingLine(viewportHeight, stripBottom) {
41874
41885
  const beside = 0.45;
41875
41886
  return stripBottom === null ? viewportHeight * beside : stripBottom + 1;
41876
41887
  }
41888
+ function handoverProgress(nextTop, scrolled, viewportHeight, line) {
41889
+ if (nextTop > line) {
41890
+ return scrolled <= 0 ? 0 : scrolled / (scrolled + nextTop - line);
41891
+ }
41892
+ const span = viewportHeight - line;
41893
+ return span <= 0 ? 2 : 1 + Math.min(1, (line - nextTop) / span);
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
+ }
41877
41901
  var storyRuntimeScript = ASK_ROOM_SCRIPT + `(function () {
41878
41902
  ${currentChapter.toString()}
41879
41903
  ${readingLine.toString()}
41904
+ ${handoverProgress.toString()}
41905
+ ${arrivalProgress.toString()}
41880
41906
  function init() {
41881
41907
  var story = document.querySelector(".story");
41882
41908
  if (!story) return;
41883
41909
  var chapters = Array.prototype.slice.call(story.querySelectorAll(".chapter"));
41884
41910
  if (!chapters.length) return;
41885
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"); });
41886
41914
  var stageCount = figure ? Number(figure.dataset.stages || chapters.length) : chapters.length;
41887
41915
  var rail = document.querySelector(".rail");
41888
41916
  var railNodes = [];
@@ -41929,6 +41957,11 @@ var storyRuntimeScript = ASK_ROOM_SCRIPT + `(function () {
41929
41957
  var current = currentChapter(tops, line);
41930
41958
  var stage = currentChapter(tops, line, stageCount);
41931
41959
  if (figure) figure.dataset.stage = String(stage);
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
+ }
41932
41965
  chapters.forEach(function (chapter, i) { chapter.classList.toggle("is-current", i === current); });
41933
41966
  // A chapter that lights the network keeps the live drawing in view while it is read.
41934
41967
  story.classList.toggle("is-asked", !!(chapters[current] && chapters[current].hasAttribute("data-lights-network")));
@@ -57982,4 +58015,4 @@ export {
57982
58015
  workSections
57983
58016
  };
57984
58017
 
57985
- //# debugId=5C42B2A5AC99CE6264756E2164756E21
58018
+ //# debugId=B1F5BE6FAAA7D59664756E2164756E21