diff --git a/CREDITS.md b/CREDITS.md index 448532e..a72b3c3 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -1,15 +1,5 @@ # Credits / Third-party assets -## 3D model — “Laptop” -- Author: **Kenney** (https://kenney.nl) -- Source: https://poly.pizza/m/GnbwSUiVty -- License: **CC0 1.0 Universal (Public Domain)** (https://creativecommons.org/publicdomain/zero/1.0/) -- Used in: `app/components/story/NotebookStage3D.tsx`, - file at `public/models/laptop-kenney.glb`. -- Modifications: the downloaded open-laptop geometry was split into - `Laptop_Base` and `Laptop_Lid` nodes around the hinge for scroll-driven - animation. CC0 does not require attribution; credit given anyway. - ## Project screenshots - `public/assets/prints/*.png` are captures taken with headless Chrome from production deployments owned by the site author (evandro.dev.br), used as diff --git a/app/components/story/NotebookBrowser.test.tsx b/app/components/story/NotebookBrowser.test.tsx index 2867654..db431ad 100644 --- a/app/components/story/NotebookBrowser.test.tsx +++ b/app/components/story/NotebookBrowser.test.tsx @@ -126,18 +126,29 @@ describe("NotebookBrowser", () => { const { container } = renderBrowser({ frame: { ...frame, cursorClicking: true }, }); + const cursor = container.querySelector(".notebook-cursor"); - expect(container.querySelector(".notebook-cursor")).toHaveAttribute( - "aria-hidden", - "true", + expect(cursor).toHaveAttribute("aria-hidden", "true"); + expect(cursor).toHaveStyle({ left: "40%", top: "60%" }); + expect(cursor?.closest(".notebook-browser")).toBe( + container.querySelector(".notebook-browser"), ); - expect(container.querySelector(".notebook-cursor")).toHaveStyle({ - left: "40%", - top: "60%", - }); expect(container.querySelector("iframe")).not.toBeInTheDocument(); }); + it("marks only the selected tab as pressed by the choreographed cursor", () => { + const { container } = renderBrowser({ + activeIndex: 1, + frame: { ...frame, cursorClicking: true }, + }); + const tabs = container.querySelectorAll(".notebook-tab"); + + expect(tabs[1]).toHaveAttribute("data-cursor-clicking", "true"); + expect(tabs[0]).toHaveAttribute("data-cursor-clicking", "false"); + expect(tabs[2]).toHaveAttribute("data-cursor-clicking", "false"); + expect(tabs[3]).toHaveAttribute("data-cursor-clicking", "false"); + }); + it("uses the selected tab to label the panel and screenshot", () => { renderBrowser({ activeIndex: 2 }); diff --git a/app/components/story/NotebookBrowser.tsx b/app/components/story/NotebookBrowser.tsx index d798ad8..3efbc5e 100644 --- a/app/components/story/NotebookBrowser.tsx +++ b/app/components/story/NotebookBrowser.tsx @@ -142,6 +142,9 @@ export default function NotebookBrowser({ aria-controls={panelId} aria-selected={isSelected} className="notebook-tab" + data-cursor-clicking={ + isSelected && frame.cursorClicking ? "true" : "false" + } id={tabId} key={project.id} onClick={() => onSelectTab(index)} @@ -213,20 +216,20 @@ export default function NotebookBrowser({ unoptimized /> ) : null} - {frame.cursorVisible ? ( -