diff --git a/.claude/launch.json b/.claude/launch.json index 16e2941..4a60dd9 100644 --- a/.claude/launch.json +++ b/.claude/launch.json @@ -5,7 +5,7 @@ "name": "robokit-site", "runtimeExecutable": "make", "runtimeArgs": ["serve"], - "port": 8734 + "port": 8914 } ] } diff --git a/Makefile b/Makefile index 89a9e5e..20267dd 100644 --- a/Makefile +++ b/Makefile @@ -2,18 +2,19 @@ # committed corpus, so CI and a fresh clone both work with no sibling repos. PROJECT ?= SRC ?= -PORT ?= 8734 +PORT ?= 8914 # What a browser is allowed to see. Everything else in the checkout -- the # scripts, the Makefile, the README -- is how the site is made, not part of it. PUBLIC = index.html CNAME .nojekyll assets graspkit retargetingkit robokit roboskills -.PHONY: serve import pages site benchmark-image check-docs check-site test clean +.PHONY: serve import site benchmark-image check-docs check-site test clean # The pages use root-relative paths, so the site must be served from this # built directory — opening HTML over file:// will not resolve /assets or /data. serve: site - python3 scripts/serve.py $(PORT) _page + @printf '\nSite: http://localhost:$(PORT)/\nDocs: http://localhost:$(PORT)/docs/robokit/overview/\n\n' + python3 -u scripts/serve.py $(PORT) _page # Convert one product repo's Markdown into its own file under data/docs/, then # rebuild. Each kit owns one path, so two imports never touch the same file. @@ -22,16 +23,9 @@ serve: site # # In CI this runs from the product repo, which then commits the result here. import: - @test -n "$(PROJECT)" || { echo "PROJECT= is required"; exit 1; } - @test -n "$(SRC)" || { echo "SRC= is required"; exit 1; } - @test -f "scripts/import_$(PROJECT)_docs.py" -o -n "$(filter robokit graspkit,$(PROJECT))" \ - || { echo "no importer for $(PROJECT)"; exit 1; } - uv run scripts/$(if $(filter robokit graspkit,$(PROJECT)),import_docs.py --project $(PROJECT),import_$(PROJECT)_docs.py) $(SRC) + uv run scripts/import_docs.py $(PROJECT) $(SRC) $(MAKE) site -# Rebuild from the committed corpus. -pages: site - # Assemble the complete site without writing generated files into source paths. # Everything it needs is committed here, so this works on a bare clone. site: clean diff --git a/README.md b/README.md index 84f3e3e..07e6542 100644 --- a/README.md +++ b/README.md @@ -1,158 +1,60 @@ # OpenRoboKit website -A static site — no framework, and nothing rendered at request time. The hand- -written pages are markup only; the documentation is generated once, up front, -into one HTML file per page. All CSS and JS live under `assets/`. +The static site behind openrobokit.com. Each page is a small HTML stub that +`assets/js/` renders from the content in `data/`. The docs are built ahead of +time into one HTML page per document. ## Running it ```shell -./scripts/preview.sh # build, then preview http://localhost:8914/retargetingkit/ -make serve # build, then serve http://localhost:8734 from _page/ -make test # the converter and page-builder tests -make site # rebuild the complete site in ignored _page/ -make check-site # build twice; check links, search, and reproducibility -make clean # remove _page/ +make serve # build into _page/ and serve http://localhost:8914 (PORT=… to change) +make test # converter and page-builder tests, JS syntax checks +make check-site # links, search coverage, and reproducible output ``` -The preview script works from any directory and accepts an optional port: -`./scripts/preview.sh 8915`. Keep its terminal open while browsing, or run it -in the background from the repository root: - -```shell -mkdir -p output -nohup ./scripts/preview.sh 8914 > output/preview.log 2>&1 < /dev/null & -``` - -When the repository is on a remote machine, forward port 8914 in your editor -or SSH connection before opening the localhost URL on your computer. - -All paths in the site are **root-relative** (`/assets/…`, `/data/…`), so the -site has to be served from `_page/`. Opening an `.html` file over -`file://` will not resolve anything. - -Building requires `make`, `uv`, and Node.js. `uv` selects Python 3.12 for the -build and tests. Everything a build reads is committed here, so `make site` -works on a bare clone — no sibling checkouts. Only `make import` needs one, and -only for the project being imported. - -`scripts/serve.py` serves the built tree with HTTP Range support so the video -scrubbers can seek locally. +You need `make`, `uv` and Node.js. Everything the build reads is committed +here. Paths are root-relative, so browse through the server rather than +`file://`. `scripts/serve.py` answers Range requests so videos can seek. ## Layout ``` -index.html landing page -robokit/ ┐ -retargetingkit/ ├ one stub each: title, favicon, RK_PROJECT, script tags -graspkit/ ┘ - -assets/css/site.css nav + mobile menu, shared by every page -assets/css/{home,project,docs}.css -assets/js/site.js nav render, menu toggle, hero-video fallback -assets/js/{home,project,docs}.js - docs.js is page behaviour only — no router -assets/{brand,images,videos}/ - -data/projects.js content + theme for the three project pages -data/docs/.js the documentation corpus, one file per kit; - build input, never served - -scripts/ the Python importers and page builder -.github/workflows/ci.yml test, validate, and upload a downloadable site artifact - -_page/ complete built site; ignored by Git -_page/docs/ generated pages and legacy URL redirects -_page/data/search.json full-text search index +index.html landing page +robokit/ retargetingkit/ one stub per project page; the directory name is the URL +graspkit/ roboskills/ (roboskills/showcase/ holds the run gallery) +assets/js/site.js nav, copy buttons, code highlighting; every page +assets/js/project.js renders a project page from data/projects.js +assets/js/*.js, assets/css/ each page's script and stylesheet +data/projects.js project page content and themes +data/showcase* RoboSkills showcase runs +data/docs/.js docs source, one file per kit; read by the build, never served +scripts/ docs importer and builder, site checks, benchmark tools +_page/ the built site (ignored) ``` -Each project page is a directory so its URL is just its name — -`openrobokit.com/robokit` — which is what paper and preprint links need. -The local server resolves `/robokit` to `robokit/index.html`. - -### Shared chrome - -`assets/css/site.css` owns the nav's structure; every colour in it comes from a -custom property the page sets (`--nav-bg`, `--nav-ink`, `--nav-muted`, -`--nav-hover-bg`, `--nav-dot`, `--brand-shadow`, `--menu-bg`, `--menu-line`). -Re-tint the nav by setting those, not by writing new `nav …` rules. - -The burger and mobile overlay are always in the DOM but hidden; a page opts in -by unhiding `nav .right button.burger` in its own media query. The landing page -deliberately does not, and so has no mobile menu. +To add a project, copy a stub such as `graspkit/index.html`, change its +`` and `window.RK_PROJECT`, then add the kit to `RK_PROJECTS`, +`RK_THEMES` and `RK_VIDEOS` in `data/projects.js`, to `RK_NAMES` in +`assets/js/site.js`, to the chapters in `assets/js/project-nav.js`, and to +`PUBLIC` in the `Makefile`. -### Adding a project +## Docs -1. Copy an existing stub, e.g. `graspkit/index.html`, changing the `<title>` and - `window.RK_PROJECT`. -2. Add the matching entry to `RK_PROJECTS`, `RK_THEMES` and `RK_VIDEOS` in - `data/projects.js`. A project that rotates multiple hero clips can also add - an `RK_HERO_REELS` entry. -3. Add it to `NAV` in `assets/js/site.js`. - -## CI - -On pushes to `main`, pull requests, and manual runs, CI runs the tests and -`make check-site`, then uploads `_page/` as a `site` artifact. Only the public -`openrobokit/website` repo publishes that artifact to GitHub Pages, from `main`. - -`make check-site` checks local HTML links and assets, documentation anchors, -and search-index coverage. It builds twice and compares every output file, -then verifies that source files have not changed. CI also requires a clean -Git checkout. The workflow still needs RoboKit's asset input provisioned. - -Only handwritten pages, assets, scripts, and the documentation corpus are -tracked. Generated HTML, redirects, and the search index live in `_page/`. -The build excludes the corpus, scripts, README, and Makefile from that tree. - -## Documentation - -Every document is a static page at `/docs/<kit>/<id>/`, built from the -committed corpus. Each kit owns one file, so two projects importing at once -never touch the same path: +Docs are written in each kit's repository (`docs/*.md`, with the sidebar in +`docs/nav.yml`) and imported here: ```shell -make site # build from the corpus -make import PROJECT=robokit SRC=../robokit # re-convert one project -make check-docs PROJECT=robokit SRC=../robokit # fails if it would change +make import PROJECT=robokit SRC=../robokit # or retargetingkit, graspkit +make check-docs PROJECT=robokit SRC=../robokit # fails if an import would change anything ``` -`data/docs/<kit>.js` stays the corpus: `scripts/import_docs.py` splices the generated -groups into it, and `scripts/build_docs.py` turns the whole thing into -`_page/docs/<kit>/<id>/index.html` plus `_page/data/search.json`. Importing is -an explicit source update; ordinary builds never rewrite `data/docs/`. - -RoboKit's README and overview images have one source: RoboKit's `docs/assets/`. -The importer rewrites image URLs without copying files into this repository. -`make site` bundles the banner, framework, teaser, and six `built-in-tasks/` images -into `_page/assets/docs/robokit/assets/`; -these are generated output and are never committed. Gallery previews, task videos, -and images used only by the website remain under `assets/`. +An import replaces only that kit's generated block in `data/docs/<kit>.js` +and, where a kit has them, its API examples in `data/projects.js`. +`make site` turns the docs source into `_page/docs/<kit>/<id>/` and +`_page/data/search.json`. Edit docs in the kit's repository, not here. -The browser gets no router and no corpus. `assets/js/docs.js` handles only what -needs a live page — syntax highlighting, copy buttons, the scroll-spy rail, the -sidebar folds — and fetches the search index the first time somebody types. - -A page selects reference blocks the way mkdocstrings does — a line of -`::: robokit.opt.GDOptimizer` in the Markdown, next to the prose. What gets -published, and in what order, is decided there rather than in a config file -here. - -`scripts/md2doc.py` turns such a line into a `<div data-api="...">` -placeholder; `scripts/apimodel.py` reads the name out of the source with -griffe, and `scripts/apihtml.py` fills the placeholder in with the signature -card, parameters and members. - -RetargetingKit works the same way: its pages, sidebar order (`docs/nav.yml`), -API reference pages, and device screenshots live in the RetargetingKit repo. -Rebuild them against that checkout: - -```shell -make import PROJECT=retargetingkit SRC=../retargetingkit -``` +## Publishing -The importer copies the original device screenshots into -`assets/docs/retargetingkit/` and frames the PICO and Vision Pro panels without -changing their pixels. Edit the Markdown in RetargetingKit, never -here. Only `data/docs/retargetingkit.js` is replaced, then the static site is -rebuilt in `_page/`. +CI (`.github/workflows/deploy.yml`) runs the tests and `make check-site` on +every push and pull request. Only the public `openrobokit/website` repository +deploys `main` to GitHub Pages. diff --git a/assets/css/project.css b/assets/css/project.css index 206c7f7..489ae70 100644 --- a/assets/css/project.css +++ b/assets/css/project.css @@ -11,6 +11,8 @@ a:hover { color: var(--accent); } ::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-track { background: #F0F0EE; } ::-webkit-scrollbar-thumb { background: #C6C6C2; border: 2px solid #F0F0EE; } +/* the nav's active-link dot keeps its size in a crowded bar */ +nav .links a .dot { flex: none; } body { min-height: 100vh; background: #FAFAF8; color: #15171F; @@ -22,14 +24,6 @@ body { /* ---------- hero ---------- */ .hero { position: relative; height: 100vh; min-height: 560px; background: #FAFAF8; overflow: hidden; } -/* The neutral render already sits on the page ground, so it is placed by - height rather than cropped to fit: only its left edge needs a fade. */ -.hero .hero-figure { - position: absolute; width: 178vh; top: -0.5vh; left: calc(70vw - 116.6vh); - pointer-events: none; - mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 100%); - -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 100%); -} .hero .hero-media { position: absolute; inset: 0; width: 100%; height: 100%; @@ -47,7 +41,7 @@ body { linear-gradient(to bottom, transparent 0, #000 var(--edge), #000 calc(100% - var(--edge)), transparent 100%); -webkit-mask-composite: source-in; } -.hero video.hero-media { z-index: 1; filter: var(--hero-vid-filter, none); } +.hero video.hero-media { z-index: 1; } .hero .hero-reel-still, .hero .hero-clip { transform: var(--clip-fit, var(--hero-vid-tf, translate(16%, -5%) scale(0.78))); } .hero .hero-reel-still { transition: opacity 260ms ease; } @@ -364,10 +358,6 @@ h1 .kit { color: var(--pop, var(--accent)); } } .api__copy-cmd:hover { border-color: rgba(21,23,31,0.44); transform: translate(1.5px, 1.5px); box-shadow: 1.5px 1.5px 0 rgba(21,23,31,.16); } .api__copy-cmd .p { color: var(--pop, var(--accent)); } -.api__note { max-width: 780px; margin: -4px 0 24px; color: #596157; font-size: 15px; line-height: 1.7; } -.api__launch { border-top: 1px solid #EDEDEB; } -.api__launch .api__bar { justify-content: space-between; } -.api__launch pre { margin: 0; padding: 18px clamp(16px, 2vw, 26px); overflow-x: auto; color: #15171F; font: 12px/1.75 'JetBrains Mono', monospace; } /* one card, matching .scale__demo, so the two interactive blocks read as a pair */ .api__demo { @@ -389,15 +379,10 @@ h1 .kit { color: var(--pop, var(--accent)); } .api__copy:hover { color: var(--accent); } .api__copy .o, .api__copy-cmd .o { color: var(--accent); } .api__body { - padding: clamp(18px, 2vw, 26px) clamp(16px, 2vw, 26px); + margin: 0; padding: clamp(18px, 2vw, 26px) clamp(16px, 2vw, 26px); font-family: 'JetBrains Mono', monospace; font-size: clamp(11.5px, .92vw, 13.5px); line-height: 1.75; - overflow-x: auto; - /* every pane reserves the tallest example's height, so switching tabs does - not shift the page under the pointer */ - min-height: calc(var(--api-lines, 12) * 1.75em + 2 * clamp(18px, 2vw, 26px)); + overflow-x: auto; white-space: pre; color: #15171F; } -.api__body div { white-space: pre; color: #15171F; } -pre.api__body { min-height: 0; margin: 0; white-space: pre; color: #15171F; } .api__body[hidden] { display: none; } /* same token palette as the docs bodies, so a snippet reads the same in both */ .api__body .tok-k, .api__body .tok-o { color: #C6304C; } @@ -523,91 +508,6 @@ pre.api__body { min-height: 0; margin: 0; white-space: pre; color: #15171F; } margin: clamp(15px, 2vh, 22px) 0 0; max-width: 640px; text-wrap: pretty; } - -/* ---------- body ---------- */ -.wrap { max-width: 1180px; margin: 0 auto; padding: 0 56px 120px; } - -.hl { - display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; - background: #DEDEDA; border: 1px solid #DEDEDA; - border-radius: 6px; overflow: hidden; margin-top: 56px; -} -.hl > div { min-width: 0; background: #FFFFFF; padding: 18px 20px; display: flex; flex-direction: column; gap: 5px; } -.hl .k { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); } -.hl .v { font-size: 14px; line-height: 1.5; color: #6B7080; } - -.meta { display: flex; flex-wrap: wrap; gap: 0 28px; padding: 18px 0 0; margin-top: 18px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; } -.meta span.row { display: flex; gap: 8px; padding: 4px 0; } -.meta .k { color: #8A8F9C; letter-spacing: 0.04em; } -.meta .status { margin-left: auto; } -.meta .status .v { color: var(--accent); } - -.sec, .end { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; } -.sec { padding: 56px 0; border-bottom: 1px solid #E4E4E1; } -.end { padding: 88px 0 0; } -.sec__label, .end__label { - font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.12em; - text-transform: uppercase; color: #8A8F9C; padding-top: 8px; -} -.sec__label .n, .end__label .n { display: block; margin-bottom: 6px; font-size: 10.5px; color: var(--accent); } -.sec h2 { - font-family: 'Archivo', 'Inter', system-ui, sans-serif; font-weight: 700; - font-size: 36px; line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 22px; max-width: 700px; -} -.sec p { font-size: 16px; line-height: 1.65; color: #6B7080; max-width: 680px; margin: 0 0 18px; } -.sec p a { color: var(--accent); border-bottom: 1px solid currentColor; } - -.cards { display: grid; gap: 14px; margin: 24px 0; } -.cards > div { - min-width: 0; background: #FFFFFF; border: 1px solid rgba(21,23,31,0.20); - border-radius: 6px; box-shadow: 4px 4px 0 rgba(21,23,31,.16); - padding: 20px; display: flex; flex-direction: column; gap: 8px; -} -.cards .kicker { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--accent); letter-spacing: 0.06em; } -.cards .name { font-family: 'Archivo', 'Inter', system-ui, sans-serif; font-weight: 600; font-size: 21px; line-height: 1.2; letter-spacing: -0.02em; } -.cards .desc { font-size: 13.5px; color: #6B7080; line-height: 1.55; } - -ul.bullets { list-style: none; padding: 0; margin: 20px 0 26px; max-width: 680px; } -ul.bullets li { - position: relative; padding: 8px 0 8px 22px; font-size: 15.5px; line-height: 1.6; - border-bottom: 1px dashed rgba(21,23,31,0.16); -} -ul.bullets li::before { content: "›"; position: absolute; left: 0; top: 8px; color: var(--accent); font-family: 'JetBrains Mono', monospace; } - -.callout { - display: grid; grid-template-columns: 10px 1fr; gap: 16px; - background: var(--tint-soft); border: 1px solid rgba(21,23,31,0.20); border-radius: 6px; - box-shadow: 4px 4px 0 rgba(21,23,31,.16); overflow: hidden; margin: 24px 0; max-width: 680px; -} -.callout__bar { background: var(--accent); } -.callout__body { padding: 18px 20px 18px 0; font-size: 14.5px; line-height: 1.6; color: #15171F; } -.callout__body .t { - display: block; margin-bottom: 6px; font-family: 'JetBrains Mono', monospace; - font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); -} - -.code { - background: #FFFFFF; border: 1px solid rgba(21,23,31,0.20); border-radius: 6px; - box-shadow: 5px 5px 0 rgba(21,23,31,.16); margin: 26px 0; overflow: hidden; - font-family: 'JetBrains Mono', monospace; font-size: 12.5px; -} -.code__bar { - display: flex; align-items: center; padding: 10px 14px; - border-bottom: 1px solid rgba(21,23,31,0.20); background: #F0F0EE; - font-size: 11px; color: #8A8F9C; letter-spacing: 0.04em; -} -.code__bar .file { color: #6B7080; } -.code__bar .copy { margin-left: auto; cursor: pointer; border: 0; padding: 0; background: none; font: inherit; color: inherit; } -.code__bar .copy:hover { color: var(--accent); } -.code__body { padding: 16px 18px; line-height: 1.65; overflow-x: auto; } -.code__body div { white-space: pre; color: #15171F; } -.code__body div.c { color: #8A8F9C; } - -.end h2 { - font-family: 'Archivo', 'Inter', system-ui, sans-serif; font-weight: 700; - font-size: 52px; line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 28px; -} - /* Below four columns the bento stops filling the viewport and just flows. Six cards divide evenly by three, so this tier still lands in two rows. */ @media (max-width: 1250px) { @@ -631,7 +531,6 @@ ul.bullets li::before { content: "›"; position: absolute; left: 0; top: 8px; c .bento__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } } @media (max-width: 880px) { - .wrap { padding: 0 24px 80px; } .band { --band-pad-top: 56px; padding: var(--band-pad-top) 24px 64px; } .method__grid { grid-template-columns: 1fr; } .bench__row { gap: 14px; } @@ -648,13 +547,8 @@ ul.bullets li::before { content: "›"; position: absolute; left: 0; top: 8px; c .bench--wide .bench__fig .vs { grid-area: 3 / 1 / auto / -1; margin-top: 0; font-size: 12px; } .bench--wide .bench__group { padding: 14px 0 8px; } .bench--wide .bench__group:first-child { padding-top: 8px; } - .sec, .end { grid-template-columns: 1fr; gap: 24px; } .pitch { padding: 0 24px; } - .hl { grid-template-columns: 1fr; } h1 { font-size: 45px; } - .cards { grid-template-columns: 1fr !important; } - .end h2 { font-size: 40px; } - .sec h2 { font-size: 30px; } } /* Six cards in one column ran the section past five screens. Two columns hold at any width — the cards square up so three rows still fit a phone. */ @@ -687,9 +581,6 @@ ul.bullets li::before { content: "›"; position: absolute; left: 0; top: 8px; c .scale__tasks, .api__tabs { display: flex; overflow-x: auto; scrollbar-width: none; } .scale__tasks::-webkit-scrollbar, .api__tabs::-webkit-scrollbar { display: none; } .scale__tasks button, .api__tabs button { flex: 0 0 auto; padding: 11px 14px; white-space: nowrap; } - /* a phone cannot fit the widest line anyway; let the body scroll on its own - and stop reserving the tallest pane's height */ - .api__body { min-height: 0; } } /* Portrait: the hero stops being a two-column overlay and becomes a column — @@ -712,7 +603,6 @@ ul.bullets li::before { content: "›"; position: absolute; left: 0; top: 8px; c the subject sits a touch left of frame centre. The ground is a level or two off the band, so every edge fades, wide enough that none shows. Size containment keeps the media's intrinsic height out of the 1fr row. */ - .hero .hero-figure, .hero .hero-media { position: relative; grid-area: 1 / 1; inset: auto; transform: none; width: 100%; height: 100%; min-height: 0; contain: size; @@ -753,13 +643,9 @@ ul.bullets li::before { content: "›"; position: absolute; left: 0; top: 8px; c /* ================================================================ Imported footage ================================================================ - Six bands built out of the RetargetingKit clips. They speak the band - vocabulary above — mono eyebrow, mono h2, white card on a hairline ring — - and add the three things camera footage needs that a render on the page - ground did not: a scrim under a label that lands on a photograph, a caption - strip for footage too busy to letter over, and a fixed-height frame so - clips of different shapes can share a row without the row resizing. */ - + Bands of camera footage speak the band vocabulary above — mono eyebrow, + mono h2, white card on a hairline ring — in frames sized so clips of + different shapes can share a row without the row resizing. */ /* ---------- bento: justified rows of whole frames ---------- */ /* robokit's bento crops every card into one grid cell. This page cannot: each @@ -779,121 +665,12 @@ ul.bullets li::before { content: "›"; position: absolute; left: 0; top: 8px; c margin-bottom: clamp(34px, 3.6vw, 54px); -webkit-mask-image: linear-gradient(#000 86%, transparent); mask-image: linear-gradient(#000 86%, transparent); } -/* A card that rolls through a family stacks its clips and crossfades between - them. The outgoing clip stays opaque underneath for the length of the fade, - so the poster behind the stack never shows through the middle of it. */ -.bento__row .card-clip { opacity: 0; z-index: 1; transition: opacity 320ms ease; } -.bento__row .card-clip.is-under { opacity: 1; z-index: 1; } -.bento__row .card-clip.is-active { opacity: 1; z-index: 2; } -.bento__row .card-clip.is-entering { opacity: 0; } - -/* ---------- bento, on photographs ---------- */ -/* A label laid over camera footage needs a scrim; over a render on the page - ground it did not. It rides the frame rather than the label, above the clip - and below the words, and is clipped by the card's overflow. */ -.bento--photo .bento__frame::after { - content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 172px; - z-index: 2; pointer-events: none; - background: linear-gradient(to top, rgba(10,18,30,.74), rgba(10,18,30,.34) 46%, rgba(10,18,30,0)); -} -.bento--photo .card-label { z-index: 3; } -.bento--photo h3 { color: #FFFFFF; text-shadow: 0 1px 14px rgba(10,18,30,.5); } -/* Four autoplaying rooms is a lot of motion to put in front of someone who has - asked for less of it. The still behind each card is a frame of the same - footage, so hiding the clip costs the card nothing. */ -@media (prefers-reduced-motion: reduce) { - .bento--photo .card-video { display: none; } -} - -/* Every clip below is a <figure>, and the UA sheet gives those 40px of side - margin — enough to squeeze a five-column strip to nothing on a phone. */ -.tile { margin: 0; } - -/* ---------- tile: a clip with its name under it ---------- */ -/* Camera footage is busy enough that a caption laid over it competes with the - subject, so these carry theirs in a strip beneath the frame. */ -.tile { - position: relative; min-width: 0; display: flex; flex-direction: column; - background: #FFFFFF; border-radius: 16px; overflow: hidden; - box-shadow: 0 14px 34px rgba(21,23,31,0.04), inset 0 0 0 1px #DEDEDA; - transition: box-shadow 220ms ease, transform 220ms ease; -} -.tile:hover { transform: translateY(-2px); box-shadow: 0 20px 44px rgba(21,23,31,0.09), inset 0 0 0 1px #C6C6BF; } -/* The frame is the shape of the clip in it, so the clip fills it exactly and - nothing is cut off — which also rules out the usual hover push-in, since a - scale() inside an overflow-hidden frame is a crop by another name. */ -.tile__frame { position: relative; aspect-ratio: var(--tile-ar, 16 / 9); overflow: hidden; background: #FFFFFF; } -.tile__frame video { display: block; width: 100%; height: 100%; object-fit: contain; } -.tile figcaption { - display: flex; align-items: center; gap: 9px; min-width: 0; - justify-content: var(--cap-align, flex-start); - font-family: 'JetBrains Mono', monospace; font-size: clamp(10.5px, .84vw, 12.5px); - line-height: 1.35; letter-spacing: 0.01em; color: #15171F; -} -/* The bench legend's marks, reused wherever two clips are a comparison. */ -.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; font-style: normal; } -.dot--on { background: var(--accent); } -.dot--off { background: #C4CBD4; } -.dot--src { box-shadow: inset 0 0 0 1.5px #9AA6B4; } -@media (prefers-reduced-motion: reduce) { - .tile { transition: none; } - .tile:hover { transform: none; } -} - -/* ---------- method: the three layers ---------- */ -.layers__head, .reel__head { - max-width: 880px; margin: 0 0 clamp(18px, 2.6vh, 32px); -} -.layers__lead, .reel__lead { - margin: 12px 0 0; color: #6B7080; font-size: clamp(14px, 1.1vw, 17px); - line-height: 1.62; text-wrap: pretty; -} -.layers__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 20px); } -.layers__card { - min-width: 0; background: #FFFFFF; border-radius: 16px; - box-shadow: 0 16px 40px rgba(21,23,31,0.04), inset 0 0 0 1px #DEDEDA; - padding: clamp(18px, 1.9vw, 26px); -} -/* The figures that used to head these cards were renders, so the card leads - with its layer number instead — the same rule-and-label vocabulary the - section headings downpage use. */ -.layers__head-row { - display: flex; align-items: baseline; gap: 11px; - padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid #EDEDEB; -} -.layers__head-row .n { - font-family: 'Archivo', 'Inter', system-ui, sans-serif; font-weight: 700; - font-size: clamp(26px, 2.4vw, 36px); line-height: 1; letter-spacing: -0.03em; color: var(--accent); -} -.layers__card .kicker { - font-family: 'JetBrains Mono', monospace; - font-size: 10.5px; letter-spacing: 0.14em; color: var(--label-muted, #8A8F9C); -} -.layers__card h3 { - margin: 7px 0 9px; font-family: 'Archivo', 'Inter', system-ui, sans-serif; font-weight: 700; - font-size: clamp(17px, 1.45vw, 21px); line-height: 1.2; letter-spacing: -0.02em; color: #15171F; -} -.layers__card p { margin: 0; font-size: 13.5px; line-height: 1.6; color: #6B7080; } -body.project--legacy .layers__head-row { border-bottom-color: rgba(24,43,73,0.12); } -/* ---------- humanoid reel ---------- */ -/* Two across, full width. These clips are shot at room distance, so a card - narrower than half the band loses the robot in the room. */ -.reel__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); } - /* ---------- imported footage: narrower screens ---------- */ -@media (max-width: 1000px) { - .layers__grid { grid-template-columns: 1fr; } -} @media (max-width: 760px) { - /* a phone cannot read four columns of footage; two is the floor at which a - robot hand is still a robot hand */ /* two justified cards side by side put a room at 160px across */ .bento__row { flex-direction: column; gap: clamp(10px, 1vw, 14px); } .bento__row article { flex: none; } } -@media (max-width: 640px) { - .reel__grid { grid-template-columns: minmax(0, 1fr); } -} /* The imported graphite treatment belongs to robokit only. The shared project template keeps the established kit colorways everywhere else. */ @@ -909,33 +686,14 @@ body.project--legacy { --menu-bg: var(--band); --menu-line: rgba(24,43,73,0.14); } -body.project--legacy h1, -body.project--legacy .callout__body, -body.project--legacy .code__body div { color: #182B49; } -body.project--legacy .lede, -body.project--legacy .hl .v, -body.project--legacy .sec p, -body.project--legacy .cards .desc, -body.project--legacy .code__bar .file { color: #4A5D73; } +body.project--legacy h1 { color: #182B49; } +body.project--legacy .lede { color: #4A5D73; } body.project--legacy .hero { background: var(--band); } body.project--legacy .chip { box-shadow: 3px 3px 0 rgba(24,43,73,.3); } body.project--legacy .cta { box-shadow: 4px 4px 0 rgba(24,43,73,.85); } body.project--legacy .cta:hover { filter: brightness(1.15); box-shadow: 2px 2px 0 rgba(24,43,73,.85); } body.project--legacy .ghost { color: #182B49; border-color: rgba(24,43,73,0.28); box-shadow: 4px 4px 0 rgba(24,43,73,.3); } body.project--legacy .ghost:hover { border-color: rgba(24,43,73,0.5); background: rgba(24,43,73,0.04); box-shadow: 2px 2px 0 rgba(24,43,73,.3); } -body.project--legacy .meta .k, -body.project--legacy .sec__label, -body.project--legacy .end__label, -body.project--legacy .code__bar { color: var(--label-muted, #7A8798); } -body.project--legacy .hl { background: rgba(24,43,73,0.20); border-color: rgba(24,43,73,0.20); } -body.project--legacy .sec { border-bottom-color: rgba(24,43,73,0.28); } -body.project--legacy .cards > div, -body.project--legacy .callout, -body.project--legacy .code { border-color: rgba(24,43,73,0.28); box-shadow: 4px 4px 0 rgba(24,43,73,.3); } -body.project--legacy .code { box-shadow: 5px 5px 0 rgba(24,43,73,.3); } -body.project--legacy .code__bar { background: var(--bar-bg, #EDE9DC); border-bottom-color: rgba(24,43,73,0.28); } -body.project--legacy .code__body div.c { color: var(--code-comment, #8A8F9C); } -body.project--legacy ul.bullets li { border-bottom-color: rgba(24,43,73,0.18); } /* The bands take the page ground rather than robokit's paper, and every neutral in them moves off the warm greys onto the navy the rest of this @@ -943,22 +701,12 @@ body.project--legacy ul.bullets li { border-bottom-color: rgba(24,43,73,0.18); } body.project--legacy .band { background: var(--band); } body.project--legacy .band h2, body.project--legacy .bento__grid h3, -body.project--legacy .bento__row h3, -body.project--legacy .layers__card h3, -body.project--legacy .tile figcaption { color: #182B49; } +body.project--legacy .bento__row h3 { color: #182B49; } body.project--legacy .band__eyebrow .rule { background: rgba(24,43,73,0.16); } -body.project--legacy .layers__lead, -body.project--legacy .layers__card p, -body.project--legacy .reel__lead { color: #4A5D73; } -body.project--legacy .tile, -body.project--legacy .layers__card { box-shadow: 0 16px 40px rgba(24,43,73,0.05), inset 0 0 0 1px rgba(24,43,73,0.13); } -body.project--legacy .tile:hover { box-shadow: 0 20px 46px rgba(24,43,73,0.10), inset 0 0 0 1px rgba(24,43,73,0.28); } body.project--legacy .bento__grid article::after, body.project--legacy .bento__row article::after { box-shadow: inset 0 0 0 1px rgba(24,43,73,0.13); } body.project--legacy .bento__grid article:hover::after, body.project--legacy .bento__row article:hover::after { box-shadow: inset 0 0 0 1px rgba(24,43,73,0.30); } -/* except a label sitting on camera footage, which stays white on its scrim */ -body.project--legacy .bento--photo h3 { color: #FFFFFF; } /* the sweeping arc picks up the accent here — on the ice ground robokit's warm grey reads as a smudge rather than the border lighting up */ body.project--legacy .bento__grid article::before, .bento__row article::before { @@ -1021,9 +769,6 @@ body.project--retargetingkit .showcase__head h2 { font-size: clamp(25px, 2.4vw, 38px); white-space: nowrap; } -/* The rest of the same sentence, not a subtitle: it runs on from the headline - and is only dropped back in colour. */ -body.project--retargetingkit .showcase__sub { color: #8DA0B4; } body.project--retargetingkit .motion-board { display: grid; @@ -1405,81 +1150,6 @@ body.project--retargetingkit .motion-range__footer button:focus-visible { outline: 3px solid rgba(2,108,143,.5); outline-offset: 1px; } -/* The lower story uses the same restrained RoboKit cards, with only the terms - needed to establish the method. */ -body.project--retargetingkit .layers { - border-block: 1px solid rgba(24,43,73,.09); - background: var(--tint-soft); -} -body.project--retargetingkit .layers__head { - margin-bottom: clamp(20px, 3.2vh, 36px); -} -body.project--retargetingkit .layers__grid { - grid-template-columns: repeat(3, minmax(0, 1fr)); -} -body.project--retargetingkit .layers__card { - border-radius: 20px; - box-shadow: 0 16px 38px rgba(24,43,73,.055), inset 0 0 0 1px var(--rk-line); -} -body.project--retargetingkit .layers__card h3 { margin-bottom: 0; } - -body.project--retargetingkit .wrap { - box-sizing: border-box; - width: 100%; - max-width: 1480px; - padding: clamp(40px, 6vh, 68px) clamp(28px, 6.4vw, 118px) clamp(44px, 6vh, 72px); -} -body.project--retargetingkit .details__head { margin-bottom: clamp(18px, 2.6vh, 30px); } -body.project--retargetingkit .details__intro { display: block; } -body.project--retargetingkit .details__intro h2 { - margin: 0; - color: var(--rk-ink); - font-family: 'JetBrains Mono', monospace; - font-size: clamp(25px, 2.4vw, 38px); - font-weight: 500; - line-height: 1.16; - letter-spacing: -.012em; -} -body.project--retargetingkit .details__intro p { - max-width: 700px; - margin: 12px 0 0; - color: var(--rk-muted); - font-size: clamp(14px, 1.06vw, 16px); - line-height: 1.62; - text-wrap: pretty; -} -body.project--retargetingkit .hl { - margin-top: 0; - border-color: var(--rk-line); - border-radius: 16px; - background: var(--rk-line); -} -body.project--retargetingkit .hl > div { padding: clamp(18px, 2vw, 26px); } -/* Use the same top/bottom cadence as adjacent RoboKit bands. */ -body.project--retargetingkit .sec { - padding-block: clamp(40px, 6vh, 68px) clamp(44px, 6vh, 72px); -} -body.project--retargetingkit .end { padding-top: clamp(40px, 6vh, 68px); } -body.project--retargetingkit .cards > div, -body.project--retargetingkit .callout, -body.project--retargetingkit .code { - border-color: var(--rk-line); - border-radius: 14px; - box-shadow: 0 14px 34px rgba(24,43,73,.055); -} - -@media (max-width: 880px) { - body.project--retargetingkit .wrap { padding: 56px 24px 64px; } - body.project--retargetingkit .sec { padding-block: 56px 64px; } - body.project--retargetingkit .end { padding-top: 56px; } -} - -@media (max-width: 840px) { - body.project--retargetingkit .layers__grid { - grid-template-columns: minmax(0, 1fr); - } -} - @media (max-width: 620px) { body.project--retargetingkit .showcase__head h2 { white-space: normal; @@ -1491,18 +1161,7 @@ body.project--retargetingkit .code { body.project--retargetingkit .motion-card { border-radius: 18px; } /* Six thumbs and a scene name will not share one row at phone widths, so the caption moves to the free corner instead of being cut. */ - /* Last in the caption line, in the same register as the rate beside it: the - headline makes the claim, this says the clip is the evidence for it. */ -body.project--retargetingkit .motion-stage__tag { - color: rgba(255,255,255,.52); - font-size: 11px; -} -body.project--retargetingkit .motion-stage__tag::before { - content: '·'; - margin-right: 11px; -} - -body.project--retargetingkit .motion-stage__caption { + body.project--retargetingkit .motion-stage__caption { top: clamp(12px, 3vw, 18px); bottom: auto; } @@ -1520,11 +1179,6 @@ body.project--retargetingkit .motion-stage__caption { body.project--retargetingkit .motion-stage .motion-picker__item { width: clamp(38px, 11vw, 58px); } - body.project--retargetingkit .motion-stage__nav { - width: clamp(44px, 12%, 64px); - align-items: flex-start; - padding-top: 38%; - } body.project--retargetingkit .scale__demo, body.project--retargetingkit .motion-range__demo { border-radius: 18px; } body.project--retargetingkit .scale__tasks { @@ -1587,25 +1241,6 @@ body.project--retargetingkit .motion-stage__caption { .stage__benchmark .stage__status { min-width: 12ch; font-size: clamp(13.5px, 1.125vw, 16.5px); font-weight: 600; } -.stage__variants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 720px; margin-top: 16px; } -.stage__variant { - min-width: 0; padding: 0; overflow: hidden; text-align: left; cursor: pointer; - border: 1px solid rgba(24,43,73,.18); border-radius: 12px; background: var(--band); color: inherit; -} -.stage__variant.is-active { outline: 2px solid var(--accent); outline-offset: 2px; } -/* Three or more variants share one row under the stage. */ -.stage__variants:has(> :nth-child(3)) { - grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); max-width: none; -} -@media (max-width: 640px) { - .stage__variants:has(> :nth-child(3)) { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; } -} -.stage__variant:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; } -.stage__variant img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; } -.stage__variant > span { display: block; padding: 10px 12px; font: 500 13px/1.4 'JetBrains Mono', monospace; } -.stage__variant small { display: block; margin-top: 4px; font: 400 12px/1.5 Inter, sans-serif; opacity: .72; } -.stage__selection { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 14px 0 0; font: 400 12px/1.5 'JetBrains Mono', monospace; color: var(--accent); } -.stage__selection a { color: inherit; text-underline-offset: 3px; } @media (max-width: 640px) { #grasp-optimization .stage__frame { aspect-ratio: auto; } #grasp-optimization .stage__frame video { position: relative; aspect-ratio: 16 / 9; height: auto; } @@ -1778,11 +1413,10 @@ body.project--retargetingkit .motion-stage__caption { .hero-console:has(> .is-seamless) .hero-console__thumb { width: 96px; } .hero-console:has(> .is-seamless) .hero-console__foot { position: absolute; z-index: 1; left: 66%; bottom: 19%; margin: 0; transform: translateX(-50%); } } -.ghost--status { cursor: default; } /* ---------- bento additions ---------- */ /* The title sits on the footage, which fades into paper beneath it instead of - holding a box; a card can link to its band or hold the place of footage still to come. */ + holding a box; a card can link to its band. */ .bento--pills .card-label { left: 0; right: 0; bottom: 0; padding: clamp(30px, 2.8vw, 44px) clamp(20px, 1.9vw, 30px) clamp(14px, 1.2vw, 18px); @@ -1847,18 +1481,12 @@ body.project--roboskills .bento__grid article:hover .card-media { transform: var } .card-link { position: absolute; inset: 0; z-index: 5; border-radius: inherit; } .card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; } -.bento__grid article.is-placeholder { background: repeating-linear-gradient(135deg, #F3F3F0 0 10px, #EDEDEA 10px 20px); } -.card-placeholder { - position: absolute; top: 22px; left: 0; right: 0; text-align: center; - font-family: 'JetBrains Mono', monospace; font-size: 11.5px; letter-spacing: .06em; color: #8A8F9C; -} /* ---------- stage additions ---------- */ .stage__card { overflow: hidden; background: #FFFFFF; border-radius: 24px; box-shadow: 0 16px 40px rgba(21,23,31,0.04), inset 0 0 0 1px #DEDEDA; } -.stage__card--narrow { width: 100%; max-width: 1080px; margin: 0 auto; } .stage__card .stage__frame { border-radius: 0; } .stage__scene { position: relative; } .stage__scene .stage__frame video { object-fit: contain; } @@ -1934,20 +1562,6 @@ body.project--roboskills .bento__grid article:hover .card-media { transform: var .stage__compare-label--after { right: 12px; } .stage__compare-play { right: 12px; bottom: 12px; } } -.stage__tags { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-columns: repeat(var(--tags), minmax(0, 1fr)); pointer-events: none; } -.stage__tags b { - display: inline-block; margin: 14px; padding: 5px 10px; border-radius: 6px; - background: rgba(250,250,248,.92); box-shadow: 0 0 0 1px rgba(21,23,31,.08); - font: 400 11px/1.4 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: #15171F; -} -.stage__tags span:last-child b { background: var(--accent); box-shadow: none; color: #FFFFFF; } -/* A typed input reads over the empty left half of its stage. */ -.stage__prompt { - position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; width: 50%; margin: 0; - display: flex; align-items: center; padding: 48px clamp(20px, 4vw, 56px) 24px; - font-family: 'JetBrains Mono', monospace; font-size: clamp(13px, 1.5vw, 20px); line-height: 1.6; color: #182B49; -} -.stage__prompt[hidden] { display: none; } /* ---------- shared heading for composed bands ---------- */ .band h2.band__h { margin: 0 0 clamp(22px, 3.6vh, 36px); } @@ -1958,25 +1572,11 @@ body.project--roboskills .bento__grid article:hover .card-media { transform: var .clips__frame { aspect-ratio: 4 / 3; background: #1B1D22; } .clips__frame video { display: block; width: 100%; height: 100%; object-fit: cover; } .clips__item figcaption { padding: 12px 16px 14px; font: 500 14.5px/1.4 'JetBrains Mono', monospace; color: #15171F; } -.clips__kicker, .codeband__k { +.clips__kicker { display: block; margin-bottom: 3px; font: 400 10.5px/1.4 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); } -/* ---------- code beside footage ---------- */ -.codeband__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; } -.codeband__code { display: flex; flex-direction: column; } -.codeband__code pre.api__body { flex: 1; margin: 0; } -.codeband__side { margin-left: auto; } -.codeband__side + .api__copy { margin-left: 0; } -.codeband__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #EDEDEB; } -.codeband__facts > div { padding: 14px 20px; font-size: 13px; color: #5E6373; } -.codeband__facts > div + div { border-left: 1px solid #EDEDEB; } -.codeband__media { position: relative; min-height: 320px; border-radius: 24px; overflow: hidden; box-shadow: inset 0 0 0 1px #DEDEDA; } -.codeband__media video { display: block; width: 100%; height: 100%; object-fit: cover; } -.codeband__media.is-placeholder { display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(135deg, #F3F3F0 0 12px, #EDEDEA 12px 24px); } -.codeband__media.is-placeholder span { font: 500 14px/1.4 'JetBrains Mono', monospace; color: #6B7080; } - /* ---------- Agent: shared tab tray and in-video progress ---------- */ .agent__workspace { min-width: 0; } .agent__tasks button:focus-visible, .agent__step summary:focus-visible, .agent__progress-toggle:focus-visible { @@ -2080,16 +1680,10 @@ body.project--roboskills .bento__grid article:hover .card-media { transform: var .hero-console { flex: none; width: 100%; max-width: 640px; margin: 0 auto; } } @media (max-width: 760px) { - .codeband__grid, .codeband__facts { grid-template-columns: minmax(0, 1fr); } - .codeband__facts > div + div { border-left: 0; border-top: 1px solid #EDEDEB; } .hero--console .pitch__in { width: 100%; } .hero-console__media { border-radius: 16px; } /* a phone has no room beside the hands, so the agent's card follows the clip, overlapping its foot */ .hero-console__card { position: relative; right: auto; bottom: auto; width: auto; max-width: none; margin: -20px 10px 0; } - /* a half-width prompt cannot fit a phone, so it follows the clip instead */ - .stage__frame:has(> .stage__prompt:not([hidden])) { aspect-ratio: auto !important; } - .stage__frame:has(> .stage__prompt:not([hidden])) video { position: relative; height: auto; aspect-ratio: 8 / 3; } - .stage__prompt { position: static; width: auto; padding: 14px 16px; font-size: 13px; border-top: 1px solid #EDEDEB; } } @media (max-width: 520px) { .clips__grid { grid-template-columns: minmax(0, 1fr); } diff --git a/assets/css/showcase.css b/assets/css/showcase.css index a9d5675..047b30c 100644 --- a/assets/css/showcase.css +++ b/assets/css/showcase.css @@ -4,7 +4,6 @@ body.page--showcase, body.page--showcase .band { background: #FFFFFF; } body.page--showcase .band__in { min-width: 0; } -.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* ---------- head ---------- */ .runs { min-height: 100vh; padding-top: calc(var(--site-nav-height) + clamp(28px, 5vh, 56px)); } @@ -211,12 +210,6 @@ nav.crumbs { display: block; height: auto; padding: 0; background: none; } .run__code .tok-c { color: var(--code-comment, #918A7C); font-style: italic; } /* ---------- motion generation: hub cards and a run's page ---------- */ -.mg-status { - display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; - font: 500 12px/1 'JetBrains Mono', monospace; color: #5B6478; -} -.mg-status svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; } -.mg-status.is-pass { color: #36398A; } /* a section's illustration: what goes in → the agent's loop → what comes out */ .runs__flow { display: flex; align-items: stretch; gap: 14px; margin: -4px 0 32px; padding: 20px; @@ -317,17 +310,12 @@ nav.crumbs { display: block; height: auto; padding: 0; background: none; } .mg-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .mg-chain span { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 8px; border: 1px solid #E6E8F0; font-size: 14px; color: #182B49; } .mg-chain i { font-style: normal; color: #8A91A5; } -.mg-credit { margin: 0; font-size: 14px; line-height: 1.6; color: #5B6478; } -.mg-credit a, .mg-fine a { color: var(--accent); border-bottom: 1px solid currentColor; } +.mg-fine a { color: var(--accent); border-bottom: 1px solid currentColor; } .mg-facts { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding: 24px; border-radius: 16px; border: 1px solid #E6E8F0; } .mg-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: 20px; border-bottom: 1px solid #EEF0F5; } .mg-stats > div { display: flex; flex-direction: column; gap: 8px; } .mg-stats b { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; color: #182B49; } .mg-stats small { font-size: 15px; font-weight: 500; color: #5B6478; } -.mg-checks { display: flex; flex-direction: column; padding-bottom: 20px; border-bottom: 1px solid #EEF0F5; } -.mg-checks .mg-label { margin-bottom: 8px; } -.mg-checks > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; font-size: 14px; color: #182B49; } -.mg-checks .mg-status { max-width: 62%; white-space: normal; text-align: right; line-height: 1.4; } .mg-fine { margin: 0; font-size: 13px; line-height: 1.6; color: #5B6478; } .mg-more { margin-top: 48px; } .mg-more__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; } diff --git a/assets/js/project.js b/assets/js/project.js index 0dbc9c8..00f8eea 100644 --- a/assets/js/project.js +++ b/assets/js/project.js @@ -29,7 +29,6 @@ if (theme.slash) document.documentElement.style.setProperty('--slash', theme.sla if (theme.slashShadow) document.documentElement.style.setProperty('--slash-shadow', theme.slashShadow); if (theme.videoFit) document.documentElement.style.setProperty('--hero-vid-tf', theme.videoFit); if (theme.portraitPos) document.documentElement.style.setProperty('--hero-portrait-pos', theme.portraitPos); -if (theme.videoTone) document.documentElement.style.setProperty('--hero-vid-filter', theme.videoTone); document.documentElement.style.setProperty('--accent-lite', theme.accentLite || theme.accent); document.documentElement.style.setProperty('--band', theme.band); document.documentElement.style.setProperty('--tint-soft', theme.tintSoft); @@ -60,17 +59,6 @@ const skillIcon = (t) => `<span class="band__tile-icon${t.logo ? ' band__tile-ic const clip = (o) => `<video class="${o.follower ? 'stage__follower' : 'lz'}" data-src="${o.src}" poster="${o.poster}" muted loop playsinline preload="none" ${o.controls ? `controls aria-label="${esc(o.label || 'Robot task video')}"` : 'aria-hidden="true"'}></video>`; -// The bench legend's vocabulary, reused wherever two clips are a comparison: -// a filled dot for the kit, a hollow one for the baseline, an outline for the -// motion that went in. -const toneDot = (t) => (t ? `<i class="dot dot--${t}"></i>` : ''); - -const tile = (o) => ` - <figure class="tile${o.wide ? ' is-wide' : ''}"> - <div class="tile__frame">${clip(o)}</div> - <figcaption>${toneDot(o.tone)}${esc(o.label)}</figcaption> - </figure>`; - // One capability per band, one 16:9 stage per band. Everything else — the // scene name, the provenance line, the image-only picker — is laid over the // footage, so nothing competes with it for width. The picker shows position @@ -110,7 +98,7 @@ function showcaseSection(group, groupIndex) { <div class="band__in"> ${eyebrow(group.label)} <div class="showcase__head"> - <h2 id="${titleId}">${esc(group.h)}${group.sub ? ` <span class="showcase__sub">${esc(group.sub)}</span>` : ''}</h2> + <h2 id="${titleId}">${esc(group.h)}</h2> </div> <div class="motion-board"> ${showcaseCard(group, groupIndex)} @@ -159,38 +147,9 @@ function scaleSection(s) { </section>`; } -function section(s) { - const paras = (s.paras || []).map((p) => `<p>${esc(p)}</p>`).join(''); - const linkPara = s.links - ? `<p>${esc(s.linkLead)} ${s.links.map((l) => `<a href="${l.href}">${esc(l.label)}</a>${esc(l.sep)}`).join('')}</p>` - : ''; - const cards = s.cards - ? `<div class="cards" style="grid-template-columns:${s.cardCols || 'repeat(3,1fr)'}">` + - s.cards.map((c) => `<div><span class="kicker">${esc(c.kicker)}</span><span class="name">${esc(c.name)}</span><span class="desc">${esc(c.desc)}</span></div>`).join('') + - `</div>` : ''; - const bullets = s.bullets ? `<ul class="bullets">${s.bullets.map((b) => `<li>${esc(b)}</li>`).join('')}</ul>` : ''; - const callout = s.callout - ? `<div class="callout"><div class="callout__bar"></div><div class="callout__body"><span class="t">★ rule of thumb</span>${esc(s.callout)}</div></div>` - : ''; - const code = s.codeLines - ? `<div class="code" data-copy-scope> - <div class="code__bar"><span class="file">${esc(s.codeFile)}</span><button type="button" class="copy copy--swap" data-copy-from=".code__body" title="Click to copy"><span class="t">⧉ copy</span><span class="o">✓ copied</span></button></div> - <div class="code__body">${s.codeLines.map((l) => `<div class="${l.comment ? 'c' : ''}">${esc(l.text) || ' '}</div>`).join('')}</div> - </div>` : ''; - return ` - <section class="sec"> - <div class="sec__label"><span class="n">${esc(s.n)}</span>${esc(s.label)}</div> - <div style="min-width:0"> - <h2>${esc(s.h)}</h2> - ${paras}${linkPara}${cards}${bullets}${callout}${code} - </div> - </section>`; -} - - // The capability grid, as a justified row of frames or a fixed grid of cards. function bentoSection(b) { - return ` <section class="band bento${b.photo ? ' bento--photo' : ''}${b.rows ? ' bento--justified' : ''}${b.pills ? ' bento--pills' : ''}" id="${esc(b.id || 'bento')}"> + return ` <section class="band bento${b.rows ? ' bento--justified' : ''}${b.pills ? ' bento--pills' : ''}" id="${esc(b.id || 'bento')}"> <div class="band__in"> ${eyebrow(b.label || 'Capabilities')} <h2>${esc(b.h)}</h2> @@ -198,10 +157,8 @@ function bentoSection(b) { <div class="bento__row"> ${row.map((c) => ` <article style="--ar:${c.ar}"> - <div class="bento__frame" style="aspect-ratio:${c.ar}"${c.clips ? ` data-bento-reel="${c.dwell || 6000}"` : ''}> + <div class="bento__frame" style="aspect-ratio:${c.ar}"> ${c.still ? `<img class="card-media card-still" src="${c.still}" alt="" />` : ''} - ${c.clips ? `<img class="card-media card-still" src="${c.clips[0].still}" alt="" />` + - c.clips.map((k, i) => `<video class="card-media card-video card-clip${i === 0 ? ' is-active' : ''}" data-src="${k.video}" poster="${k.still}" muted loop playsinline preload="none" aria-hidden="true"></video>`).join('') : ''} ${c.video ? `<video class="card-media card-video" src="${c.video}" autoplay muted loop playsinline aria-hidden="true" data-fallback></video>` : ''} </div> <div class="card-label"><h3>${esc(c.name)}${c.tag ? ` <span class="card-tag">${esc(c.tag)}</span>` : ''}</h3></div> @@ -209,16 +166,14 @@ function bentoSection(b) { </div>`).join('') : ` <div class="bento__grid"> ${(b.cards || []).map((c) => { - // renders sit on the page ground and are framed by transform; camera - // frames are framed by which part of the picture is kept instead - const fit = `--card-fit:${c.fit || 'scale(1)'}${c.pos ? `;--card-pos:${c.pos}` : ''}`; + // renders sit on the page ground and are framed by transform + const fit = `--card-fit:${c.fit || 'scale(1)'}`; // input → output pills over the footage's top edge, the output in the accent const flow = c.flow && c.flow.map((group, i) => `${i ? '<i aria-hidden="true">→</i>' : ''}${group.map((x) => `<span${i === c.flow.length - 1 ? ' class="is-out"' : ''}>${esc(x)}</span>`).join('')}`).join(''); return ` - <article class="${c.wide ? 'wide' : ''}${c.placeholder ? ' is-placeholder' : ''}"> + <article class="${c.wide ? 'wide' : ''}"> ${c.href ? `<a class="card-link" href="${c.href}" aria-label="${esc(c.name)}"></a>` : ''} - ${c.placeholder ? `<span class="card-placeholder">${esc(c.placeholder)}</span>` : ''} ${c.still ? `<img class="card-media card-still" src="${c.still}" alt="" style="${fit}" />` : ''} ${c.video ? `<video class="card-media card-video" src="${c.video}" autoplay muted loop playsinline aria-hidden="true" data-fallback style="${fit}"></video>` : ''} ${flow ? `<p class="card-flow">${flow}</p>` : ''} @@ -276,9 +231,8 @@ const stageSidebar = (st, variant) => ` // One clip per band, with optional input media and variants to swap in. function stageSection(st) { - // `picker: 'tabs'` swaps variants from a tab tray on a card, instead of the - // poster buttons under the frame; tags name the frame's equal columns. - const tabs = st.picker === 'tabs' && st.variants; + // Variants swap from a tab tray on a card around the frame. + const tabs = st.variants; const first = st.variants ? st.variants[0] : {}; const comparing = st.reveal && first.before; const frame = `<div class="stage__frame${comparing ? ' stage__comparison' : ''}" id="${esc(st.id)}-view"${st.ar ? ` style="aspect-ratio:${st.ar}"` : ''}>${clip({ src: st.src, poster: st.poster })} @@ -288,8 +242,6 @@ function stageSection(st) { <span class="stage__divider" aria-hidden="true"><span class="stage__handle"><svg viewBox="0 0 24 24"><path d="m9 7-5 5 5 5m6-10 5 5-5 5"/></svg></span></span>` : ''} ${comparing || st.inputs ? '<button type="button" class="stage__compare-play" aria-label="Pause playback">Pause</button>' : ''} ${st.sidebar ? stageSidebar(st, first) : ''} - ${st.tags ? `<div class="stage__tags" style="--tags:${st.tags.length}">${st.tags.map((t) => `<span><b>${esc(t)}</b></span>`).join('')}</div>` : ''} - ${st.variants && st.variants.some((v) => v.prompt) ? `<p class="stage__prompt" data-stage-prompt${first.prompt ? '' : ' hidden'}>${esc(first.prompt || '')}</p>` : ''} ${st.benchmark ? `<div class="scale__count scale__count--timed stage__benchmark" data-stage-benchmark data-static="${st.benchmark.static === true}" data-seconds="${st.benchmark.seconds}" data-rounds='${JSON.stringify(st.benchmark.rounds)}'><div><strong>${st.benchmark.batch.toLocaleString()}</strong><span>Parallel grasps</span></div><div class="scale__timing"><b data-stage-seconds>0.0000 s</b><span class="stage__status" data-stage-status role="status">Ready</span><small>${esc(st.benchmark.hardware)}</small></div></div>` : ''} </div>`; const view = st.inputs ? `<div class="stage__scene"> @@ -304,15 +256,12 @@ function stageSection(st) { <h2>${esc(st.h)}</h2> ${st.note ? `<p class="stage__note">${esc(st.note)}</p>` : ''} </div> - ${tabs ? `<div class="stage__card${st.narrow ? ' stage__card--narrow' : ''}"> + ${tabs ? `<div class="stage__card"> <div class="scale__tasks" style="--scale-tasks:${st.variants.length}" role="group" aria-label="${esc(st.variantsLabel || 'Choose a version')}"> ${st.variants.map((v, i) => `<button type="button" class="${i === 0 ? 'is-active' : ''}" data-stage-variant="${i}" aria-pressed="${i === 0}" aria-controls="${esc(st.id)}-view${st.inputs ? ` ${esc(st.id)}-input` : ''}">${esc(v.label)}</button>`).join('')} </div> ${view} </div>` : view} - ${st.variants && !tabs ? `<div class="stage__variants" role="group" aria-label="${esc(st.variantsLabel || 'Choose a grasp optimization version')}"> - ${st.variants.map((variant, i) => `<button type="button" class="stage__variant${i === 0 ? ' is-active' : ''}" data-stage-variant="${i}" aria-pressed="${i === 0}" aria-controls="${esc(st.id)}-view"><img src="${variant.poster}" alt="" loading="lazy" width="320" height="180" /><span>${esc(variant.label)}<small>${esc(variant.note)}</small></span></button>`).join('')} - </div><p class="stage__selection"><span data-stage-selection aria-live="polite">${esc(st.variants[0].label)} · ${esc(st.variants[0].note)}</span>${st.comparison ? `<a href="${st.comparison}" target="_blank" rel="noopener">Compare both ↗</a>` : ''}</p>` : ''} </div> </section>`; } @@ -411,20 +360,6 @@ const BANDS = { </div> </div> </section>`, - // a code card beside its footage, or a stand-in for footage to come - code: (b) => ` - <section class="band codeband" id="${esc(b.id)}"> - <div class="band__in">${bandHead(b)} - <div class="codeband__grid"> - <div class="api__demo codeband__code" data-copy-scope> - <div class="api__bar"><span class="file">${esc(b.file)}</span>${b.side ? `<span class="codeband__side">${esc(b.side)}</span>` : ''}<button type="button" class="api__copy copy--swap" data-copy-from=".api__body"><span class="t">copy</span><span class="o">✓ copied</span></button></div> - <pre class="api__body">${rkHighlight(b.lines.join('\n'))}</pre> - ${b.facts ? `<div class="codeband__facts">${b.facts.map((f) => `<div><span class="codeband__k">${esc(f.k)}</span>${esc(f.v)}</div>`).join('')}</div>` : ''} - </div> - <div class="codeband__media${b.media.placeholder ? ' is-placeholder' : ''}">${b.media.placeholder ? `<span>${esc(b.media.placeholder)}</span>` : clip(b.media)}</div> - </div> - </div> - </section>`, }; // The teaser: one clip at a time, as large as the hero allows, and the agent's side in a small card of the Agent @@ -456,22 +391,20 @@ const heroConsole = (c) => ` <div class="hero-console__foot"><span class="hero-console__playlist" role="group" aria-label="Teaser clips">${c.tasks.map((t, i) => `<button type="button" aria-label="${esc(t.label)}"${i ? '' : ' class="is-on" aria-current="true"'}></button>`).join('')}</span></div> </div>`; -// A project may opt into a standalone image, one looping clip, or a reel that -// plays each clip once. Reel clips are stacked in the same stage so changing -// scenes never moves the surrounding layout. +// A project shows one looping clip, or a reel that plays each clip once. Reel +// clips are stacked in the same stage so changing scenes never moves the +// surrounding layout. const heroReel = (window.RK_HERO_REELS || {})[key]; // Choose before creating the video so phones only fetch the smaller clip. const heroVideo = kit.heroVideoMobile && window.matchMedia('(max-width: 760px)').matches ? kit.heroVideoMobile : window.RK_VIDEOS[key]; -const heroMedia = kit.heroImage - ? `<img class="hero-figure" src="${kit.heroImage}" alt="" />` - : heroReel - ? `<img class="hero-media hero-reel-still" src="${heroReel[0].poster}" alt="" style="--clip-fit:${heroReel[0].fit};--clip-portrait-pos:${heroReel[0].portraitPosition}" />` + - heroReel.map((clip, i) => - `<video class="hero-media hero-clip${i === 0 ? ' is-active' : ''}" src="${clip.src}" poster="${clip.poster}" ${i === 0 ? 'autoplay ' : ''}muted playsinline preload="${i < 2 ? 'auto' : 'metadata'}" data-rate="${clip.rate || 1}" data-hero-clip style="--clip-fit:${clip.fit};--clip-portrait-pos:${clip.portraitPosition}"></video>` - ).join('') - : `${window.RK_STILLS[key] ? `<img class="hero-media" src="${window.RK_STILLS[key]}" alt="" />` : ''} - <video class="hero-media" src="${heroVideo}" ${window.RK_STILLS[key] ? `poster="${window.RK_STILLS[key]}" data-fallback` : ''} autoplay muted loop playsinline preload="auto"></video>`; +const heroMedia = heroReel + ? `<img class="hero-media hero-reel-still" src="${heroReel[0].poster}" alt="" style="--clip-fit:${heroReel[0].fit};--clip-portrait-pos:${heroReel[0].portraitPosition}" />` + + heroReel.map((clip, i) => + `<video class="hero-media hero-clip${i === 0 ? ' is-active' : ''}" src="${clip.src}" poster="${clip.poster}" ${i === 0 ? 'autoplay ' : ''}muted playsinline preload="${i < 2 ? 'auto' : 'metadata'}" data-rate="${clip.rate || 1}" data-hero-clip style="--clip-fit:${clip.fit};--clip-portrait-pos:${clip.portraitPosition}"></video>` + ).join('') + : `${window.RK_STILLS[key] ? `<img class="hero-media" src="${window.RK_STILLS[key]}" alt="" />` : ''} + <video class="hero-media" src="${heroVideo}" ${window.RK_STILLS[key] ? `poster="${window.RK_STILLS[key]}" data-fallback` : ''} autoplay muted loop playsinline preload="auto"></video>`; document.getElementById('page').innerHTML = ` <section class="hero${kit.heroConsole ? ' hero--console' : ''}"> @@ -483,13 +416,12 @@ document.getElementById('page').innerHTML = ` <p class="lede">${esc(kit.lede)}</p> <div class="btns"> <a href="${kit.cta ? kit.cta.href : `/docs/${key}/`}" class="cta">${esc(kit.cta ? kit.cta.label : 'Get started')}</a> - ${kit.status ? `<span class="ghost ghost--status"><span class="p">●</span> ${esc(kit.status)}</span>` : ''} ${kit.install ? `<button class="ghost" type="button" data-copy="${esc(kit.install)}" title="Click to copy"><span class="p">$</span><span class="t">${esc(kit.install)}</span><span class="o">✓ copied</span></button>` : ''} </div> </div> </div> ${kit.heroConsole ? `${heroConsole(kit.heroConsole)}</div>` : ''} - ${kit.bento || kit.showcase || kit.stages || kit.bands ? `<button class="scrollcue" id="scrollcue" aria-label="Skip the hero"><span class="t">Scroll</span><span class="c" aria-hidden="true">▼</span></button>` : ''} + <button class="scrollcue" id="scrollcue" aria-label="Skip the hero"><span class="t">Scroll</span><span class="c" aria-hidden="true">▼</span></button> </section> ${kit.bands ? kit.bands.map((b) => BANDS[b.type](b)).join('') : ''} @@ -554,38 +486,6 @@ document.getElementById('page').innerHTML = ` </div> </section>` : ''} - ${kit.layers ? ` - <section class="band layers"> - <div class="band__in"> - ${eyebrow('Method')} - ${kit.layers.h || kit.layers.lead ? ` - <div class="layers__head"> - ${kit.layers.h ? `<h2>${esc(kit.layers.h)}</h2>` : ''} - ${kit.layers.lead ? `<p class="layers__lead">${esc(kit.layers.lead)}</p>` : ''} - </div>` : ''} - <div class="layers__grid"> - ${kit.layers.cards.map((c) => ` - <article class="layers__card"> - <div class="layers__head-row"><span class="n">${esc(c.n)}</span><span class="kicker">${esc(c.kicker)}</span></div> - <h3>${esc(c.name)}</h3> - ${c.desc ? `<p>${esc(c.desc)}</p>` : ''} - </article>`).join('')} - </div> - </div> - </section>` : ''} - - ${kit.reel ? ` - <section class="band reel"> - <div class="band__in"> - ${eyebrow('Humanoid')} - <div class="reel__head"> - <h2>${esc(kit.reel.h)}</h2> - <p class="reel__lead">${esc(kit.reel.lead)}</p> - </div> - <div class="reel__grid" style="--tile-ar:${kit.reel.ar}">${kit.reel.cards.map(tile).join('')}</div> - </div> - </section>` : ''} - ${kit.bench ? benchSection(kit.bench) : ''} ${kit.scale && !['beforeMotionRange', 'afterPipeline'].includes(kit.scale.position) ? scaleSection(kit.scale) : ''} @@ -617,14 +517,13 @@ document.getElementById('page').innerHTML = ` </section>` : ''} ${api ? ` - <section class="band api" id="${api.id || 'api'}"> + <section class="band api" id="api"> <div class="band__in"> ${eyebrow(api.label || 'API')} <div class="api__head"> <h2>${esc(api.h)}</h2> ${api.install ? `<button type="button" class="api__copy-cmd" data-copy="${esc(api.install)}" title="Click to copy"><span class="p">$</span><span class="t">${esc(api.install)}</span><span class="o">✓ copied</span></button>` : ''} </div> - ${api.note ? `<p class="api__note">${esc(api.note)}</p>` : ''} <div class="api__demo"> <div class="api__tabs" role="tablist" aria-label="${esc(api.label || 'Example task')}" style="grid-template-columns:repeat(${api.tabs.length},minmax(0,1fr))"> ${api.tabs.map((t, i) => `<button type="button" role="tab" data-api="${i}" aria-selected="${i === 0}" class="${i === 0 ? 'is-active' : ''}">${esc(t.label)}</button>`).join('')} @@ -634,52 +533,15 @@ document.getElementById('page').innerHTML = ` <div class="api__bar"> <span class="file">${esc(t.file)}</span> ${t.source || t.doc ? `<a href="${t.source ? esc(t.source) : `/docs/${key}/${t.doc}/`}">${t.source ? 'source' : 'docs'} →</a>` : ''} - ${t.fullCode ? '<button type="button" class="api__copy" data-code-toggle aria-expanded="false" aria-label="Show full code">Full</button>' : ''} - <button type="button" class="api__copy copy--swap" data-copy-from="${t.fullCode ? '[data-code-full]' : '.api__body'}"><span class="t">copy</span><span class="o">✓ copied</span></button> + <button type="button" class="api__copy" data-code-toggle aria-expanded="false" aria-label="Show full code">Full</button> + <button type="button" class="api__copy copy--swap" data-copy-from="[data-code-full]"><span class="t">copy</span><span class="o">✓ copied</span></button> </div> - ${t.fullCode ? `<pre class="api__body" style="--api-lines:${Math.max(...api.tabs.map((x) => x.lines.length))}">${rkHighlight(t.lines.map((l) => l.text).join('\n'))}</pre><pre class="api__body" data-code-full hidden>${rkHighlight(t.fullCode)}</pre>` : `<div class="api__body" style="--api-lines:${Math.max(...api.tabs.map((x) => x.lines.length))}">${t.lines.map((l) => `<div>${rkHighlight(l.text) || ' '}</div>`).join('')}</div>`} - ${t.command ? `<div class="api__launch" data-copy-scope> - <div class="api__bar"><span>Interactive demo · run in the GraspKit checkout</span><button type="button" class="api__copy copy--swap" data-copy-from="pre"><span class="t">copy command</span><span class="o">✓ copied</span></button></div> - <pre>${esc(t.command)}</pre> - </div>` : ''} + <pre class="api__body">${rkHighlight(t.lines.map((l) => l.text).join('\n'))}</pre><pre class="api__body" data-code-full hidden>${rkHighlight(t.fullCode)}</pre> </div>`).join('')} </div> </div> </section>` : ''} - ${kit.showDetails === false ? '' : ` - <div class="wrap"> - ${kit.details ? ` - <div class="details__head"> - ${eyebrow(kit.details.label)} - <div class="details__intro"> - <h2>${esc(kit.details.h)}</h2> - ${kit.details.lead ? `<p>${esc(kit.details.lead)}</p>` : ''} - </div> - </div>` : ''} - <div class="hl"> - ${kit.highlights.map((h) => `<div><span class="k">${esc(h.k)}</span><span class="v">${esc(h.v)}</span></div>`).join('')} - </div> - - <div class="meta"> - ${kit.meta.map((m) => `<span class="row"><span class="k">${esc(m.k)}</span><span class="v">${esc(m.v)}</span></span>`).join('')} - <span class="row status"><span class="k">status</span><span class="v">● research preview</span></span> - </div> - - ${kit.sections.map(section).join('')} - - <section class="end"> - <div class="end__label"><span class="n">05</span>Get started</div> - <div style="min-width:0"> - <h2>${esc(kit.endH)}</h2> - <div class="btns"> - <a href="/docs/${key}/" class="cta">Open docs</a> - <a href="${kit.alt.href}" class="ghost">${esc(kit.alt.label)}</a> - </div> - </div> - </section> - </div>`} - ${kit.close ? ` <section class="band close"> <div class="band__in"> @@ -687,13 +549,13 @@ document.getElementById('page').innerHTML = ` <h2>${esc(kit.close.h)}</h2> <div class="btns"> <a href="${kit.close.cta ? kit.close.cta.href : `/docs/${key}/`}" class="cta">${esc(kit.close.cta ? kit.close.cta.label : 'Open docs')}</a> - <a href="${(kit.close.alt || kit.alt).href}" class="ghost">${esc((kit.close.alt || kit.alt).label)}</a> + <a href="${kit.close.alt.href}" class="ghost">${esc(kit.close.alt.label)}</a> </div> </div> </section>` : ''}`; rkVideoFallback(); -// ---------- imported footage: hydration, tabs, and row sync ---------- +// ---------- lazy clips ---------- // A clip is fetched and started when it comes within a screen of the viewport // and paused when it leaves, so scrolling the page costs one screenful of // video rather than forty. A pane that is display:none never intersects, so a @@ -1003,13 +865,6 @@ if (teaser) { video.src = variant.src; video.load(); if (!stillPage) playClip(video); - const selection = section.querySelector('[data-stage-selection]'); - if (selection) selection.textContent = `${variant.label} · ${variant.note}`; - const prompt = section.querySelector('[data-stage-prompt]'); - if (prompt) { - prompt.hidden = !variant.prompt; - prompt.textContent = variant.prompt || ''; - } if (stage.sidebar) { section.querySelector('[data-stage-status]').textContent = stageStatus(stage, variant); section.querySelector('[data-stage-record]').innerHTML = stageRecord(stage, variant); @@ -1310,19 +1165,13 @@ document.querySelectorAll('[data-stage-benchmark]').forEach((badge) => { ['timeupdate', 'seeking', 'loadedmetadata', 'emptied'].forEach((event) => video.addEventListener(event, update)); update(); }); -if (lazyClips.length) { - if ('IntersectionObserver' in window) { - const io = new IntersectionObserver((entries) => { - entries.forEach((e) => { - if (e.isIntersecting) { hydrateClip(e.target); if (!stillPage && !e.target.dataset.inspection) playClip(e.target); } - else e.target.pause(); - }); - }, { rootMargin: '320px 0px', threshold: 0.01 }); - lazyClips.forEach((v) => io.observe(v)); - } else { - lazyClips.forEach(hydrateClip); - } -} +const lazyObserver = new IntersectionObserver((entries) => { + entries.forEach((e) => { + if (e.isIntersecting) { hydrateClip(e.target); if (!stillPage && !e.target.dataset.inspection) playClip(e.target); } + else e.target.pause(); + }); +}, { rootMargin: '320px 0px', threshold: 0.01 }); +lazyClips.forEach((v) => lazyObserver.observe(v)); // Match the scale demo's transition: hold the outgoing last frame underneath // until the incoming clip is actually playing, then fade it in and warm the @@ -1371,9 +1220,6 @@ if (heroClips.length > 1) { warmHeroClip(1); } -// The gallery's tab strip only decides which pane is shown; a hidden pane -// never intersects, so its clips stay cold until it is opened and the observer -// above starts them on its own. // ---------- bento: the cursor lights every border, not just one ---------- // Each card's border gradient is centred on the pointer in that card's own // coordinates. The values are deliberately unclamped: a distant card gets a @@ -1407,54 +1253,6 @@ document.querySelectorAll('.bento__grid, .bento__row').forEach((grid) => { }); }); -// ---------- a bento card that rolls through its family ---------- -// The in-hand card has four objects to show and one frame to show them in, so -// it plays each in turn. Same three-class crossfade as the hero above — the -// outgoing clip stays opaque underneath while the incoming one fades in, so the -// poster behind them never flashes through — but paced by a timer rather than -// by the clip ending, because these run from five to twenty seconds. -document.querySelectorAll('[data-bento-reel]').forEach((frame) => { - const clips = [...frame.querySelectorAll('.card-clip')]; - if (clips.length < 2) return; - const dwell = Number(frame.dataset.bentoReel) || 6000; - let at = 0; - let timer = 0; - const warm = (i) => hydrateClip(clips[i % clips.length]); - const advance = () => { - const previous = clips[at]; - at = (at + 1) % clips.length; - const next = clips[at]; - warm(at); - warm(at + 1); - next.classList.add('is-active', 'is-entering'); - previous.classList.remove('is-active'); - previous.classList.add('is-under'); - try { next.currentTime = 0; } catch (e) {} - playClip(next); - requestAnimationFrame(() => next.classList.remove('is-entering')); - setTimeout(() => { previous.classList.remove('is-under'); previous.pause(); }, 420); - }; - const start = () => { - if (stillPage || timer) return; - warm(at); - warm(at + 1); - playClip(clips[at]); - timer = setInterval(advance, dwell); - }; - const stop = () => { - clearInterval(timer); - timer = 0; - clips.forEach((v) => v.pause()); - }; - if ('IntersectionObserver' in window) { - new IntersectionObserver((entries) => { - entries.forEach((e) => (e.isIntersecting ? start() : stop())); - }, { rootMargin: '200px 0px', threshold: 0.01 }).observe(frame); - } else { - start(); - } -}); - // ---------- RetargetingKit capability reels ---------- // A reel only hydrates its active clip and the next one. Videos pause offscreen; // autoplay pauses (without freezing the active clip) while a person is hovering @@ -1555,17 +1353,12 @@ document.querySelectorAll('[data-motion-reel]').forEach((card) => { }); document.addEventListener('visibilitychange', refreshPlayback); - if ('IntersectionObserver' in window) { - new IntersectionObserver((entries) => { - entries.forEach((entry) => { - inView = entry.isIntersecting; - refreshPlayback(); - }); - }, { rootMargin: '180px 0px', threshold: 0.08 }).observe(card); - } else { - inView = true; - refreshPlayback(); - } + new IntersectionObserver((entries) => { + entries.forEach((entry) => { + inView = entry.isIntersecting; + refreshPlayback(); + }); + }, { rootMargin: '180px 0px', threshold: 0.08 }).observe(card); }); // ---------- RetargetingKit motion range ---------- @@ -1721,7 +1514,6 @@ if (scaleRange) { stepIndex = Math.min(nextStep, task.steps.length - 1); selectedSteps[taskIndex] = stepIndex; scale.classList.toggle('scale--responsive', Boolean(step.mobileVideo)); - scale.classList.toggle('scale--neutral-stage', Boolean(task.neutralStage)); if (step.mobileAspect) scale.style.setProperty('--scale-mobile-aspect', step.mobileAspect); else scale.style.removeProperty('--scale-mobile-aspect'); if (playbackFooter) { @@ -1809,7 +1601,7 @@ if (scaleRange) { mobileScale.addEventListener('change', updateScaleMedia); updateScaleMedia(); document.addEventListener('visibilitychange', refreshPlayback); - if (kit.scale.lazy && 'IntersectionObserver' in window) { + if (kit.scale.lazy) { new IntersectionObserver((entries) => { entries.forEach((entry) => { inView = entry.isIntersecting; @@ -1861,7 +1653,7 @@ document.querySelectorAll('.bench__table').forEach((benchTable) => { benchTable.classList.add('is-in'); countUp(); }; - if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) benchTable.classList.add('is-in'); + if (stillPage) benchTable.classList.add('is-in'); else { const io = new IntersectionObserver((entries) => { entries.forEach((e) => { if (e.isIntersecting) { reveal(); io.disconnect(); } }); @@ -1903,8 +1695,7 @@ const cue = document.getElementById('scrollcue'); if (cue) cue.addEventListener('click', () => { const el = document.querySelector('#page .band'); if (!el) return; - const behavior = window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'auto' : 'smooth'; - el.scrollIntoView({ behavior, block: 'start' }); + el.scrollIntoView({ behavior: stillPage ? 'auto' : 'smooth', block: 'start' }); }); // The API examples are one card with a tab strip: every pane is rendered and diff --git a/data/docs/retargetingkit.js b/data/docs/retargetingkit.js index fc73e6b..421c8d4 100644 --- a/data/docs/retargetingkit.js +++ b/data/docs/retargetingkit.js @@ -1,4 +1,4 @@ -// retargetingkit documentation. Written by scripts/import_retargetingkit_docs.py; the +// retargetingkit documentation. Written by scripts/import_docs.py; the // hand-written groups outside the GENERATED markers are edited here. // Loaded only by scripts/build_docs.py -- the browser reads the static // pages it emits, never this file. @@ -7,7 +7,7 @@ window.RK_DOCS.retargetingkit = { title: 'retargetingkit', lede: "Real-time human-to-robot motion retargeting, built on robokit.", groups: [ - // BEGIN GENERATED retargetingkit DOCS (scripts/import_retargetingkit_docs.py) + // BEGIN GENERATED retargetingkit DOCS (scripts/import_docs.py) { "name": "User Guide", "items": [ diff --git a/data/docs/robokit.js b/data/docs/robokit.js index 2a20f1a..fd2e8c8 100644 --- a/data/docs/robokit.js +++ b/data/docs/robokit.js @@ -7,7 +7,7 @@ window.RK_DOCS.robokit = { title: 'robokit', lede: "GPU-native, differentiable robotics tooling: IK, trajectory optimization, retargeting, grasping, calibration.", groups: [ - // BEGIN GENERATED DOCS (tools/import_docs.py) + // BEGIN GENERATED robokit DOCS (scripts/import_docs.py) { "name": "User Guide", "items": [ @@ -35716,6 +35716,6 @@ window.RK_DOCS.robokit = { } ] }, -// END GENERATED DOCS +// END GENERATED robokit DOCS ] }; diff --git a/data/projects.js b/data/projects.js index 731a5d0..1a6adbc 100644 --- a/data/projects.js +++ b/data/projects.js @@ -70,9 +70,6 @@ window.RK_HERO_REELS = { ], }; -const C = (text) => ({ text, comment: true }); -const L = (text) => ({ text }); - // The original footage shares one cache version. Independently rendered // embodiment cuts below carry their own version stamps. const RKV = '?v=1788938453028'; @@ -89,12 +86,12 @@ const rangeClip = (p, label, version = '20260908-range2') => ({ // RoboSkills media helpers, carried over from the standalone RoboSkills site. const SKV = '?v=20261030-r2s-bars'; -const sk = (p, label, note) => ({ - label, note, src: `/assets/videos/roboskills/${p}.mp4${SKV}`, poster: `/assets/images/roboskills/${p}.webp${SKV}`, +const sk = (p, label) => ({ + label, src: `/assets/videos/roboskills/${p}.mp4${SKV}`, poster: `/assets/images/roboskills/${p}.webp${SKV}`, }); const SHV = '?v=20261030-g1-grey'; -const sh = (p, label, note) => ({ - label, note, run: p, src: `/assets/videos/showcase/${p}.mp4${SHV}`, poster: `/assets/images/showcase/${p}.webp${SHV}`, +const sh = (p, label) => ({ + label, run: p, src: `/assets/videos/showcase/${p}.mp4${SHV}`, poster: `/assets/images/showcase/${p}.webp${SHV}`, }); const SKT = '?v=20261029-cover'; const skTeaser = (p, still) => ({ @@ -110,22 +107,14 @@ const arStage = (p, label, result, note) => ({ label, result, note, src: `/assets/videos/showcase/auto-research/${p}.mp4?v=20261029-stages-2`, poster: `/assets/images/showcase/auto-research/${p}.webp?v=20261029-stages-2`, }); const arStages = (o) => Object.assign({ src: o.stages[0].src, poster: o.stages[0].poster }, o); -const skStage = (o) => Object.assign({ type: 'stage', picker: 'tabs', src: o.variants[0].src, poster: o.variants[0].poster }, o); +const skStage = (o) => Object.assign({ type: 'stage', src: o.variants[0].src, poster: o.variants[0].poster }, o); window.RK_PROJECTS = { robokit: { - crumb: 'robokit', titleA: 'robo', titleB: 'kit', + titleA: 'robo', titleB: 'kit', heroVideoMobile: '/assets/videos/robokit/hero-composite-mobile.mp4?v=20261015-plan4s-1x', lede: "It's just fast, and batched.", chip: 'Core library', install: 'uv add robokit', - showDetails: false, - highlights: [ - { k: 'Batched', v: 'Thousands of seeds solved in one call.' }, - { k: 'Differentiable', v: 'Gradients flow through kinematics.' }, - { k: 'One runtime', v: 'Warp kernels, PyTorch tensors, CUDA.' }, - ], - meta: [{ k: 'version', v: '0.1.0' }, { k: 'license', v: 'MIT' }, { k: 'python', v: '3.8+' }, { k: 'backend', v: 'warp · pytorch' }], - endH: 'Read the docs, then build on it.', // The six tasks and their order follow robokit 1.0.0's docs overview grid // (docs/guide/overview.md): two RL policies, then four MPC motions. mpc: { @@ -238,7 +227,7 @@ window.RK_PROJECTS = { {"label": "Calibration", "file": "hand_eye_calibration.py", "doc": "hand_eye_calibration", "lines": [{"text": "from robokit.helpers.hand_eye_calibration import HandEyeCalibrator, presets"}, {"text": ""}, {"text": "hec = HandEyeCalibrator(presets.rgb, robot, camera_intrinsic=intrinsic, height=H, width=W)"}, {"text": "predicted = hec.solve(initial, target_masks=masks, q=q)"}], "fullCode": "import torch\nfrom robokit.helpers.hand_eye_calibration import compute_robot_masks\nfrom robokit.robo import Robot\n\n# A one-joint box robot needs no external assets.\nrobot = Robot.load(\n \"\"\"<robot name=\"demo\">\n <link name=\"base\"><visual><geometry><box size=\".3 .2 .1\"/></geometry></visual></link>\n <link name=\"arm\"><visual><origin xyz=\".2 0 0\"/><geometry><box size=\".4 .1 .1\"/></geometry></visual></link>\n <joint name=\"joint\" type=\"revolute\">\n <parent link=\"base\"/><child link=\"arm\"/><axis xyz=\"0 0 1\"/>\n <limit lower=\"-3.14\" upper=\"3.14\" effort=\"1\" velocity=\"1\"/>\n </joint>\n</robot>\"\"\",\n load_meshes=True,\n)\nH = W = 64\nq = torch.tensor([[-0.6], [-0.2], [0.2], [0.6]], device=\"cuda\")\nintrinsic = torch.tensor([[80.0, 0, W / 2], [0, 80.0, H / 2], [0, 0, 1]], device=\"cuda\")\ninitial = torch.eye(4, device=\"cuda\")\ninitial[2, 3] = 1.5\nmasks = compute_robot_masks(robot, q, intrinsic, initial, H, W)\nfrom robokit.helpers.hand_eye_calibration import HandEyeCalibrator, presets\n\nhec = HandEyeCalibrator(presets.rgb, robot, camera_intrinsic=intrinsic, height=H, width=W)\npredicted = hec.solve(initial, target_masks=masks, q=q)\nassert predicted.shape == (4, 4)\nassert torch.isfinite(predicted).all()"}, ], }, - close: { h: 'Read the docs, then build on it.' }, + close: { h: 'Read the docs, then build on it.', alt: { label: 'View on GitHub', href: 'https://github.com/openrobokit/robokit' } }, bench: { h: "It's just fast.", rows: [ @@ -254,71 +243,13 @@ window.RK_PROJECTS = { ], note: 'Bars are wall-clock time on the same task, baseline normalized to full width. Check the paper for benchmark details.', }, - alt: { label: 'View on GitHub', href: 'https://github.com/openrobokit/robokit' }, - sections: [ - { - n: '01', label: 'Overview', h: 'The layer between a controller and a policy.', - paras: ["robokit is a single GPU-native library for the geometric work in robot learning: forward / inverse kinematics, collision-aware trajectory optimization, human-to-robot motion retargeting, grasp optimization, and rendering-based calibration. Every operation is batched along the leading dimension and differentiable through PyTorch, dispatched to CUDA through NVIDIA Warp."], - linkLead: 'It is the foundation the rest of the stack builds on:', - links: [ - { label: 'retargetingkit', href: '/retargetingkit/', sep: ' and ' }, - { label: 'graspkit', href: '/graspkit/', sep: " both call into robokit's chains, solvers, and SDF colliders." }, - ], - codeFile: 'shell', - codeLines: [L('uv add robokit'), L('uv add torch --index-url https://download.pytorch.org/whl/cu126'), C('# optional; pick your CUDA build')], - }, - { - n: '02', label: 'Modules', h: 'Six modules. One runtime.', - cardCols: 'repeat(2,1fr)', - cards: [ - { kicker: '→ ROBO', name: 'robo', desc: 'Robot, RobotSpec, RobotState. URDF / MJCF parsing, batched forward kinematics & collision on Warp.' }, - { kicker: '→ OPT', name: 'opt', desc: 'Sparse least-squares solvers (GD / Levenberg–Marquardt / L-BFGS) behind every helper.' }, - { kicker: '→ TERMS', name: 'terms', desc: 'Composable cost terms: position, rotation, frame, collision, self-collision, smoothness, limits.' }, - { kicker: '→ LIE', name: 'lie', desc: 'SE(3) / SO(3) Lie-group ops with the T_dst_src transform convention.' }, - { kicker: '→ GEOM', name: 'geom', desc: 'Meshes, primitives, signed-distance fields, and Warp collision scenes.' }, - { kicker: '→ HELPERS', name: 'helpers', desc: 'The applications: IK, trajectory optimization, humanoid & hand retargeting, calibration.' }, - ], - codeFile: 'examples/ik/basic.py', - codeLines: [{"text": "from robokit.helpers.ik import IKSolver, presets"}, {"text": ""}, {"text": "ik = IKSolver(presets.smooth, robot=robot, target_links=\"panda_hand\", device=device)"}, {"text": "state = ik.solve_numpy(T_world_target_batch)"}, {"text": "q_batch = state.q.numpy()"}], - }, - { - n: '03', label: 'Built for the loop', h: 'Shaped for the training loop.', - paras: ['Robot learning runs geometry inside a tight loop with a neural network: generate data, retarget onto new embodiments, roll out optimizers across thousands of seeds, repeat. robokit is built for that loop: tensors stay on device, gradients flow through, and a single batch drives thousands of parallel solves.'], - bullets: [ - 'Batched IK across many seeds with a multi-stage Levenberg–Marquardt solver.', - 'Collision-aware trajectory optimization over a time horizon.', - 'SMPL-X / MANO retargeting onto humanoids and dexterous hands.', - 'Grasp optimization with force-closure and contact terms.', - 'Hand-eye calibration from images.', - ], - callout: 'If you can write it as a (batch, time, joints) tensor, robokit will run it across thousands of seeds at training speed.', - }, - { - n: '04', label: 'The stack', h: 'The base of the stack.', - cardCols: 'repeat(3,1fr)', - cards: [ - { kicker: '↑ BUILT ON IT', name: 'retargetingkit', desc: 'Real-time teleop & mocap retargeting using robokit IK and body models.' }, - { kicker: '↑ BUILT ON IT', name: 'graspkit', desc: 'Grasp synthesis, policy learning, and deployment on robokit + retargetingkit.' }, - { kicker: '↗ EXTERNAL', name: 'MuJoCo · Isaac · viser', desc: 'Load URDF / MJCF, play trajectories as PD targets, visualize live.' }, - ], - }, - ], }, retargetingkit: { - crumb: 'retargetingkit', titleA: 'retargeting', titleB: 'kit', + titleA: 'retargeting', titleB: 'kit', lede: 'Real-time human-to-robot motion retargeting, built on robokit.', chip: 'Teleoperation', install: 'uv add retargetingkit', - highlights: [ - { k: 'Live sources', v: 'VR headsets, gloves, mocap suits, cameras.' }, - { k: 'Any target', v: 'Dexterous hands, arms, full humanoids.' }, - { k: 'Sim or real', v: 'MuJoCo playback or ZMQ to hardware.' }, - ], - meta: [{ k: 'version', v: '0.1.0' }, { k: 'built on', v: 'robokit' }, { k: 'python', v: '3.10+' }, { k: 'backend', v: 'warp · pytorch' }], - showDetails: false, - endH: 'Read the docs, then retarget it.', - alt: { label: 'Back to robokit', href: '/robokit/' }, - close: { h: 'Read the docs, then retarget it.' }, + close: { h: 'Read the docs, then retarget it.', alt: { label: 'Back to robokit', href: '/robokit/' } }, // Each group is its own full-width band: one 16:9 stage per screen, with the // scene picker and the counter laid over the footage rather than beside it. @@ -440,75 +371,21 @@ window.RK_PROJECTS = { h: 'Simple API and framework.', install: 'uv add retargetingkit', tabs: [ - // Generated from RetargetingKit guide examples by scripts/import_retargetingkit_docs.py. + // Generated from RetargetingKit guide examples by scripts/import_docs.py. {"label": "Hand", "file": "hand.py", "doc": "hand-optimization", "lines": [{"text": "from retargetingkit.configs.teleop.hand.manus_sharpa import RIGHT_MANUS_SHARPA_CONFIG"}, {"text": ""}, {"text": "retargeter = RIGHT_MANUS_SHARPA_CONFIG.retargeter.build(device)"}, {"text": ""}, {"text": "for frame in stream: # HandFrame: right-hand MANO-21 keypoints"}, {"text": " command = retargeter.solve(frame)"}, {"text": " qpos = command.qpos # (22,), Sharpa joints in URDF order"}], "fullCode": "import pickle\n\nimport numpy as np\nimport warp as wp\n\nfrom retargetingkit.assets.example_data import MANUS_DATA_RIGHT_PKL\nfrom retargetingkit.sources.frames import HandFrame, HandPose\n\ndevice = \"cuda:0\" if wp.is_cuda_available() else \"cpu\"\n# Three recorded wrist-local MANO-21 frames from a right Manus glove.\nkeypoints = pickle.load(open(MANUS_DATA_RIGHT_PKL, \"rb\"))[\"keypoints\"][:3]\nstream = [HandFrame({\"right\": HandPose(points)}) for points in keypoints]\nfrom retargetingkit.configs.teleop.hand.manus_sharpa import RIGHT_MANUS_SHARPA_CONFIG\n\nretargeter = RIGHT_MANUS_SHARPA_CONFIG.retargeter.build(device)\n\nfor frame in stream: # HandFrame: right-hand MANO-21 keypoints\n command = retargeter.solve(frame)\n qpos = command.qpos # (22,), Sharpa joints in URDF order\nassert qpos.shape == (22,)\nassert np.isfinite(qpos).all()"}, {"label": "Arm and hand", "file": "arm_hand.py", "doc": "arm-retargeting", "lines": [{"text": "from retargetingkit.configs.teleop.arm_hand.visionpro_xarm7_xhand import RIGHT_VISIONPRO_XARM7_XHAND_CONFIG"}, {"text": ""}, {"text": "config = RIGHT_VISIONPRO_XARM7_XHAND_CONFIG"}, {"text": "arm = config.arm_retargeters[\"right\"].build(device)"}, {"text": "hand = config.hand_retargeters[\"right\"].build(device)"}, {"text": ""}, {"text": "for frame in stream: # ArmHandFrame: synchronized wrist and finger poses"}, {"text": " arm_qpos = arm.solve(frame.arm).qpos # (7,), xArm7 joints"}, {"text": " hand_qpos = hand.solve(frame.hand).qpos # (12,), XHand joints"}], "fullCode": "import pickle\n\nimport numpy as np\nimport warp as wp\n\nfrom retargetingkit.assets.example_data import MANUS_DATA_RIGHT_PKL\nfrom retargetingkit.sources.frames import ArmFrame, ArmHandFrame, HandFrame, HandPose\n\ndevice = \"cuda:0\" if wp.is_cuda_available() else \"cpu\"\nkeypoints = pickle.load(open(MANUS_DATA_RIGHT_PKL, \"rb\"))[\"keypoints\"][:3]\n# Recorded finger poses paired with a wrist moving 10 cm forward.\nstream = [\n ArmHandFrame(\n ArmFrame({\"right\": np.array([0.05 * i, -0.2, 1.1, 1, 0, 0, 0], dtype=np.float32)}),\n HandFrame({\"right\": HandPose(points)}),\n )\n for i, points in enumerate(keypoints)\n]\nfrom retargetingkit.configs.teleop.arm_hand.visionpro_xarm7_xhand import RIGHT_VISIONPRO_XARM7_XHAND_CONFIG\n\nconfig = RIGHT_VISIONPRO_XARM7_XHAND_CONFIG\narm = config.arm_retargeters[\"right\"].build(device)\nhand = config.hand_retargeters[\"right\"].build(device)\n\nfor frame in stream: # ArmHandFrame: synchronized wrist and finger poses\n arm_qpos = arm.solve(frame.arm).qpos # (7,), xArm7 joints\n hand_qpos = hand.solve(frame.hand).qpos # (12,), XHand joints\nassert arm_qpos.shape == (7,)\nassert hand_qpos.shape == (12,)\nassert np.isfinite(arm_qpos).all()\nassert np.isfinite(hand_qpos).all()"}, {"label": "Humanoid", "file": "humanoid.py", "doc": "humanoid-retargeting", "lines": [{"text": "from retargetingkit.retargeting.humanoid.online import HumanoidRetargeterConfig"}, {"text": "from retargetingkit.retargeting.humanoid.presets.g1 import g1_aligned"}, {"text": ""}, {"text": "retargeter = HumanoidRetargeterConfig(g1_aligned).build(device)"}, {"text": ""}, {"text": "command = retargeter.solve(frame) # BodyFrame: named world-frame joint poses"}, {"text": "base_pose = command.base_pose # (7,), [x, y, z, qw, qx, qy, qz]"}, {"text": "qpos = command.qpos # (29,), G1 joints in URDF order"}], "fullCode": "import numpy as np\nimport warp as wp\n\nfrom retargetingkit.assets.sample_bvh import EXAMPLE_BVH\nfrom retargetingkit.sources.misc.human_frame_file import BodyFileSourceConfig\n\ndevice = \"cuda:0\" if wp.is_cuda_available() else \"cpu\"\nsource = BodyFileSourceConfig(EXAMPLE_BVH, use_ankle_as_foot_target=True).build()\nframe = source.get_frame()\nfrom retargetingkit.retargeting.humanoid.online import HumanoidRetargeterConfig\nfrom retargetingkit.retargeting.humanoid.presets.g1 import g1_aligned\n\nretargeter = HumanoidRetargeterConfig(g1_aligned).build(device)\n\ncommand = retargeter.solve(frame) # BodyFrame: named world-frame joint poses\nbase_pose = command.base_pose # (7,), [x, y, z, qw, qx, qy, qz]\nqpos = command.qpos # (29,), G1 joints in URDF order\nassert base_pose.shape == (7,)\nassert qpos.shape == (29,)\nassert np.isfinite(qpos).all()\nsource.close()"}, ], }, - details: { - label: 'System', - h: 'One pipeline, multiple bodies.', - }, - - sections: [ - { - n: '01', label: 'Overview', h: 'Human motion in. Robot motion out.', - paras: ['retargetingkit is a real-time pipeline that turns human motion into robot commands: Sources → Retargeting → Targets. Sources produce skeletal frames (VR, gloves, mocap, cameras, or recorded BVH); the retargeting stage maps them to robot joint angles with robokit IK; targets execute on hardware or in sim.'], - linkLead: 'It is built on', - links: [ - { label: 'robokit', href: '/robokit/', sep: " (hand and humanoid mapping use robokit's chains, solvers, and SMPL-X / MANO models) and provides the teleop and deployment layer for " }, - { label: 'graspkit', href: '/graspkit/', sep: '.' }, - ], - codeFile: 'shell', - codeLines: [ - L('uv add retargetingkit'), C('# core'), - L('uv add "retargetingkit[pico]"'), C('# + a device, e.g. PICO VR'), - ], - }, - { - n: '02', label: 'Pipeline', h: 'Sources → Retargeting → Targets.', - cardCols: 'repeat(3,1fr)', - cards: [ - { kicker: 'A · SOURCES', name: 'VR · gloves · mocap · cameras', desc: 'PICO, Quest 3, Vision Pro, Manus, Axis Studio, RealSense / ZED, or BVH playback, unified as hand & body frames.' }, - { kicker: 'B · RETARGETING', name: 'optimization · neural · IK', desc: 'Map frames to joint angles with robokit: hand optimization with pinch & self-collision terms, neural hand models, arm IK, and humanoid retargeting.' }, - { kicker: 'C · TARGETS', name: 'hands · arms · humanoids', desc: 'Inspire, Ability, SHARPA, xHand; xArm, RBY1; G1 / SONIC humanoid, over ZMQ, serial, or simulation.' }, - ], - codeFile: 'scripts/teleop/humanoid.py', - codeLines: [ - C('# replay the sample BVH on G1, with the live viewer'), - L('uv run --extra vis scripts/teleop/humanoid.py bvh_g1_sonic_viser'), - ], - }, - { - n: '03', label: 'Hardware', h: 'Plug in your hardware.', - paras: ['Sources and targets are protocols, so any device that produces a hand or body frame can drive any robot that accepts joint commands.'], - cardCols: 'repeat(2,1fr)', - cards: [ - { kicker: 'SOURCES', name: 'in', desc: 'PICO 4 · Vision Pro · Quest 3 (VR) · Manus gloves · Axis Studio mocap · RealSense / ZED cameras · BVH files.' }, - { kicker: 'TARGETS', name: 'out', desc: 'Inspire (6-DoF serial) · Ability Hand · SHARPA · xHand; xArm · RBY1 · DexMate arms; G1 / SONIC humanoid (ZMQ).' }, - ], - }, - { - n: '04', label: 'The stack', h: 'Part of the stack.', - cardCols: 'repeat(3,1fr)', - cards: [ - { kicker: '↓ BUILT ON', name: 'robokit', desc: 'IK, kinematic chains, and SMPL-X / MANO body models.' }, - { kicker: '↑ FEEDS', name: 'graspkit', desc: 'Teleop bridges and real-robot deployment for grasp learning.' }, - { kicker: '↗ EXTERNAL', name: 'MuJoCo · ZMQ · viser', desc: 'Simulation playback, streaming to deploy systems, live visualization.' }, - ], - }, - ], }, graspkit: { - crumb: 'graspkit', titleA: 'grasp', titleB: 'kit', + titleA: 'grasp', titleB: 'kit', heroVideoMobile: '/assets/videos/graspkit/hero-scissors-mobile.mp4?v=20261017-restored-blue', lede: 'End-to-end grasp pipeline, built on robokit and retargetingkit.', chip: 'Grasp pipeline', install: 'uv add graspkit', // the body is the media run below, so the prose column is dropped - showDetails: false, // One clip per row, full measure. Both carry their own telemetry -- a // running clock, a batch count -- which is the claim, so they are not // shrunk into a two-up grid where that type stops resolving. @@ -585,70 +462,16 @@ window.RK_PROJECTS = { {"label":"Real deploy","file":"deploy_real.py","source":"https://github.com/openrobokit/graspkit/blob/main/scripts/deploy/deploy.py","lines":[{"text":"import torch"},{"text":"from graspkit.configs.real_env_config import REAL_ENV_CONFIGS"},{"text":"from graspkit.envs import RealEnv"},{"text":""},{"text":"env = RealEnv("},{"text":" REAL_ENV_CONFIGS[\"xarm7_xhand_right\"], torch.device(\"cuda:0\"), t_robot_cam"},{"text":")"},{"text":""},{"text":"env.reset(init_qpos=phases[0][0])"},{"text":"for phase in phases:"},{"text":" info = env.set_qpos_traj(phase)"},{"text":"env.close()"}],"fullCode":"import graspkit\nimport json\nimport torch\nfrom graspkit.configs.real_env_config import REAL_ENV_CONFIGS\nfrom graspkit.envs import RealEnv\n\n# Configure your arm, hand, and camera in xarm7_xhand_right.\n# camera_pose.json: your measured camera extrinsic in the robot-base frame\nwith open(\"camera_pose.json\") as f:\n t_robot_cam = json.load(f)[\"T_base_camera\"]\nenv = RealEnv(\n REAL_ENV_CONFIGS[\"xarm7_xhand_right\"], torch.device(\"cuda:0\"), t_robot_cam\n)\n\n# phases: approach / close / hold / lift tensors (T, D), after fixed-base IK\n# Executes on hardware; the interactive demo below lets you inspect the plan.\nenv.reset(init_qpos=phases[0][0])\nfor phase in phases:\n info = env.set_qpos_traj(phase)\nenv.close()"}, ], }, - close: { h: 'Read the docs, then grasp it.' }, - highlights: [ - { k: 'Force closure', v: 'Contact-aware grasps with friction cones.' }, - { k: '258k scenes', v: 'dev / mini / small / full size tiers.' }, - { k: 'Train → deploy', v: 'Policies that run on real robots.' }, - ], - meta: [{ k: 'version', v: '0.1.0' }, { k: 'built on', v: 'robokit' }, { k: 'python', v: '3.10' }, { k: 'backend', v: 'torch · maniskill · warp' }], - endH: 'Read the docs, then grasp it.', - alt: { label: 'Back to robokit', href: '/robokit/' }, - sections: [ - { - n: '01', label: 'Overview', h: 'From an object to a grasp that runs on hardware.', - paras: ['graspkit is a full research pipeline for grasping: process object assets, build scenes, render point-cloud observations, optimize stable force-closure grasps, train neural policies from the results, and deploy them on real robots. One unified launcher drives every stage on the GPU.'], - linkLead: 'It is built on', - links: [ - { label: 'robokit', href: '/robokit/', sep: ' (kinematics, contact, optimization) and ' }, - { label: 'retargetingkit', href: '/retargetingkit/', sep: ' (deployment), so optimized grasps flow straight into whole-body control on real hardware.' }, - ], - codeFile: 'shell', - codeLines: [ - L('uv add graspkit'), - ], - }, - { - n: '02', label: 'Pipeline', h: 'Assets → Optimize → Learn → Deploy.', - cardCols: 'repeat(3,1fr)', - cards: [ - { kicker: 'A · GENERATE', name: 'scenes & observations', desc: 'Randomized tabletop scenes; point-cloud rendering with configurable camera pose and intrinsics.' }, - { kicker: 'B · OPTIMIZE', name: 'force-closure grasps', desc: 'Floating- and fixed-base grasp optimization with friction cones, penetration and self-penetration limits.' }, - { kicker: 'C · LEARN & DEPLOY', name: 'policy → robot', desc: 'Train an open-loop policy from optimized grasps; deploy on xArm, RBY1, or G1 with whole-body control.' }, - ], - codeFile: 'scripts/launch.py', - codeLines: [C('# end-to-end mini pipeline on GPU 0'), L('uv run scripts/launch.py g1_inspire_dex1b_tabletop_mini --gpus 0')], - }, - { - n: '03', label: "What's inside", h: 'A whole pipeline, one launcher.', - paras: ['The unified launcher orchestrates every stage and can restart from any step with --restart-from, so you can iterate on optimization or training without rerunning the whole pipeline.'], - bullets: [ - 'Scene descriptions (v0.3–v0.5) from DexGraspNet, DexDiffuser, Objaverse, and RoboCasa.', - 'Size tiers: dev / mini / small / full (up to ~258k floating-base scenes).', - 'HDF5 grasp data: grasp, pre-grasp, and post-grasp qpos per scene.', - 'Open-loop policy (transformer / ViT backbone) over point-cloud observations.', - 'Sim-to-real evaluator networks and multi-GPU training.', - ], - }, - { - n: '04', label: 'The stack', h: 'Part of the stack.', - cardCols: 'repeat(3,1fr)', - cards: [ - { kicker: '↓ BUILT ON', name: 'robokit', desc: 'Kinematics, contact, and grasp-optimization terms.' }, - { kicker: '↓ BUILT ON', name: 'retargetingkit', desc: 'Real-robot deployment and teleop bridges.' }, - { kicker: '↗ EXTERNAL', name: 'ManiSkill · Warp · wandb', desc: 'Simulation environments, CUDA kernels, and experiment tracking.' }, - ], - }, - ], + close: { h: 'Read the docs, then grasp it.', alt: { label: 'Back to robokit', href: '/robokit/' } }, }, roboskills: { - crumb: 'roboskills', titleA: 'robo', titleB: 'skills', + titleA: 'robo', titleB: 'skills', lede: 'A low-cost, minimal skillset for agentic robotics.', chip: 'Agent Skills', cta: { label: 'View showcase →', href: '/roboskills/showcase/' }, install: 'uv add roboskills', heroConsole: { - label: 'Real2Sim · Cat’s cradle', state: 'agent replay', placeholder: 'Ask RoboSkills', + state: 'agent replay', placeholder: 'Ask RoboSkills', tasks: [ { label: 'Real2Sim · Cat’s cradle', state: 'wikiHow video, CC BY-NC-SA', prompt: 'Learn cat’s cradle from this human video.', steps: [[1.4, 'Thinking'], [1.7, 'Tracking both hands and the string'], [2.1, 'Rebuilding it with robot hands'], [2.6, 'Rebuilt in simulation']], ...skTeaser('cats-cradle') }, { label: 'Agentic Simulation · Paper folding', state: 'built task', prompt: 'Build a paper folding task.', steps: [[1, 'Thinking'], [1.6, 'Building paper and two hands'], [2.8, 'Solving the folds'], [5, 'Solution verified']], ...skTeaser('paper-folding', true) }, @@ -657,7 +480,6 @@ window.RK_PROJECTS = { skRun('dexjoco/hammer_nail-s20001', 'Hammer a nail', 321 / 501), ], }, - showDetails: false, bands: [ { type: 'bento', id: 'harnesses', label: 'Workflows', h: 'Built-in five workflows.', pills: true, cards: [ { name: 'Auto Research', wide: true, href: '#auto-research', flow: [['Task'], ['Trials'], ['Policy']], video: sh('auto-research/bimanual-lifting').src, still: sh('auto-research/bimanual-lifting').poster }, @@ -768,6 +590,5 @@ window.RK_PROJECTS = { ] }, ], close: { h: 'Try the code.', cta: { label: 'View on GitHub', href: 'https://github.com/openrobokit/roboskills' }, alt: { label: 'View showcase →', href: '/roboskills/showcase/' } }, - alt: { label: 'View on GitHub', href: 'https://github.com/openrobokit/roboskills' }, }, }; diff --git a/scripts/import_docs.py b/scripts/import_docs.py index 4907917..834aeb0 100644 --- a/scripts/import_docs.py +++ b/scripts/import_docs.py @@ -1,73 +1,65 @@ # /// script # requires-python = ">=3.10" -# dependencies = ["griffe>=2,<3", "pyyaml>=6,<7", "xdoctest>=1.3,<2"] +# dependencies = ["griffe>=2,<3", "pillow>=11,<12", "pyyaml>=6,<7", "xdoctest>=1.3,<2"] # /// -"""Import RoboKit docs (md) into data/docs/robokit.js, verbatim. +"""Import one kit's Markdown docs into data/docs/<kit>.js, verbatim. -Splices generated groups between the BEGIN/END markers in data/docs/robokit.js. Prose -is copied word-for-word; only markup is translated to the site's .doc classes -(see md2doc.py). + uv run scripts/import_docs.py <robokit|retargetingkit|graspkit> path/to/repo The sidebar comes from `docs/nav.yml` in the source repo, so which pages are -published and in what order travels with the docs rather than living here. +published and in what order travels with the docs. Prose is copied +word-for-word; only markup is translated to the site's .doc classes (see +md2doc.py). A `::: robokit.opt.GDOptimizer` line selects an API reference +block, read out of the source with griffe (see apimodel.py). -A page selects API reference blocks the way mkdocstrings does -- a line of -`::: robokit.opt.GDOptimizer` -- so what gets published, and in what order, -is decided in Markdown next to the prose. Those names are read out of the -source with griffe (see apimodel.py). - - uv run scripts/import_docs.py [--project robokit|graspkit] [path/to/repo] +Only the kit's GENERATED block in its corpus file is replaced, plus the +landing page's API tabs for kits that list `tabs`. """ -import json -import re +import shutil import sys from pathlib import Path +import apimodel import yaml +from md2doc import Converter, assemble, splice, splice_api_tabs +from PIL import Image -sys.path.insert(0, str(Path(__file__).resolve().parent)) - -import apimodel # noqa: E402 -from md2doc import Converter, assemble, splice, splice_api_tabs # noqa: E402 +ROOT = Path(__file__).resolve().parent.parent +# `tabs` lists (guide page, heading, tab label, tab file name) for the landing +# page's API card. `crops` frame screenshots without changing their pixels; a +# kit that has them gets its docs images copied to assets/docs/<kit>/. PROJECTS = { "robokit": { - "repo": "~/code/library/robokit", - "github": "https://github.com/openrobokit/robokit/", - "package": "robokit", - "begin": "// BEGIN GENERATED DOCS (tools/import_docs.py)", - "end": "// END GENERATED DOCS", + "name": "RoboKit", + "tabs": ( + ("guide/ik.md", "Batch IK", "Inverse kinematics", "ik.py"), + ("guide/motion_planning.md", "Basic Example", "Motion planning", "motion_planning.py"), + ("guide/hand_retargeting.md", "Online Retargeting", "Hand retargeting", "hand_retargeting.py"), + ("guide/humanoid_retargeting.md", "Online Retargeting", "Humanoid retargeting", "humanoid_retargeting.py"), + ("guide/hand_eye_calibration.md", "Quick start", "Calibration", "hand_eye_calibration.py"), + ), }, - "graspkit": { - "repo": "~/code/manip/graspkit", - "github": "https://github.com/openrobokit/graspkit/", - "package": "graspkit", - "begin": "// BEGIN GENERATED graspkit DOCS (scripts/import_docs.py)", - "end": "// END GENERATED graspkit DOCS", + "retargetingkit": { + "name": "RetargetingKit", + "tabs": ( + ("guide/hand_retargeting.md", "Use the Python API", "Hand", "hand.py"), + ("guide/arm_retargeting.md", "Retarget an arm and hand", "Arm and hand", "arm_hand.py"), + ("guide/humanoid_retargeting.md", "Use the Python API", "Humanoid", "humanoid.py"), + ), + "crops": { + "xrobotoolkit-pico-fullbody-settings.jpeg": [640, 280, 790, 715], + "vision-pro-tracking-streamer-start.jpg": [310, 270, 1060, 560], + }, }, + "graspkit": {"name": "GraspKit"}, } -def main(): - args = sys.argv[1:] - kit = "robokit" - if args and args[0] == "--project": - kit, args = args[1], args[2:] - if kit not in PROJECTS: - sys.exit(f"unknown project: {kit}\nusage: {sys.argv[0]} [--project {'|'.join(PROJECTS)}] [path/to/repo]") - project = PROJECTS[kit] - repo = Path(args[0] if args else project["repo"]).expanduser().resolve() - src, source = repo / "docs", repo / "src" - if not src.is_dir(): - sys.exit(f"docs not found: {src}\nusage: {sys.argv[0]} [--project {kit}] [path/to/repo]") - if not (source / project["package"]).is_dir(): - sys.exit(f"source not found: {source / project['package']}") - nav_path = src / "nav.yml" - if not nav_path.is_file(): - sys.exit(f"nav not found: {nav_path}") +def nav_files(docs: Path) -> list[dict]: files = [] - for group in yaml.safe_load(nav_path.read_text()): + for group in yaml.safe_load((docs / "nav.yml").read_text()): runs = [(None, group.get("pages") or [])] runs += [(f["fold"], f["pages"]) for f in group.get("folds") or []] for fold, pages in runs: @@ -75,31 +67,46 @@ def main(): files.append( {"group": group["group"], "src": page["file"], "id": page["id"], "sub": fold, "nav": page.get("nav")} ) - conv = Converter(kit, project["github"], {f["src"]: f["id"] for f in files}) - conv.docs_dir = src - repo_src = apimodel.Repo(src=source, github=project["github"]) - package = apimodel.load_package(project["package"], source) - splice( - Path(__file__).resolve().parent.parent / "data" / "docs" / f"{kit}.js", - project["begin"], - project["end"], - assemble(files, src, conv, lambda name: apimodel.resolve(package, name, repo_src, conv)), - ) - if kit == "robokit": - tabs = splice_api_tabs(kit, "RoboKit", "scripts/import_docs.py", src, conv, files, ( - ("guide/ik.md", "Batch IK", "Inverse kinematics", "ik.py"), - ("guide/motion_planning.md", "Basic Example", "Motion planning", "motion_planning.py"), - ("guide/hand_retargeting.md", "Online Retargeting", "Hand retargeting", "hand_retargeting.py"), - ("guide/humanoid_retargeting.md", "Online Retargeting", "Humanoid retargeting", "humanoid_retargeting.py"), - ("guide/hand_eye_calibration.md", "Quick start", "Calibration", "hand_eye_calibration.py"), - )) - projects = Path(__file__).resolve().parent.parent / "data" / "projects.js" - text = projects.read_text() - # The hidden legacy modules section shares the same IK example. - text = re.sub(r"( codeFile: 'examples/ik/basic.py',\n codeLines: )\[.*?\],(?=\n \},)", - lambda match: match[1] + json.dumps(tabs[0]["lines"], ensure_ascii=False) + ",", - text, count=1, flags=re.DOTALL) - projects.write_text(text) + return files + + +def copy_images(kit: str, docs: Path, crops: dict) -> dict: + images = {} + for source in sorted((docs / "assets").rglob("*")): + if not source.is_file() or source.suffix.lower() not in {".png", ".jpg", ".jpeg", ".webp"}: + continue + public = f"/assets/docs/{kit}/{source.relative_to(docs)}" + dest = ROOT / public.lstrip("/") + dest.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(source, dest) + with Image.open(dest) as img: + images[public] = {"size": img.size} + if source.name in crops: + images[public]["crop"] = crops[source.name] + return images + + +def main() -> None: + if len(sys.argv) != 3 or sys.argv[1] not in PROJECTS: + sys.exit(f"usage: {sys.argv[0]} <{'|'.join(PROJECTS)}> path/to/repo") + kit, project = sys.argv[1], PROJECTS[sys.argv[1]] + repo = Path(sys.argv[2]).expanduser().resolve() + docs, src = repo / "docs", repo / "src" + for path in (docs / "nav.yml", src / kit): + if not path.exists(): + sys.exit(f"not found: {path}") + github = f"https://github.com/openrobokit/{kit}/" + files = nav_files(docs) + images = copy_images(kit, docs, project["crops"]) if "crops" in project else None + conv = Converter(kit, github, {f["src"]: f["id"] for f in files}, images) + conv.docs_dir = docs + package = apimodel.load_package(kit, src) + source = apimodel.Repo(src=src, github=github) + groups = assemble(files, docs, conv, lambda name: apimodel.resolve(package, name, source, conv)) + splice(ROOT / "data" / "docs" / f"{kit}.js", + f"// BEGIN GENERATED {kit} DOCS (scripts/import_docs.py)", f"// END GENERATED {kit} DOCS", groups) + if "tabs" in project: + splice_api_tabs(kit, project["name"], "scripts/import_docs.py", docs, conv, files, project["tabs"]) if __name__ == "__main__": diff --git a/scripts/import_retargetingkit_docs.py b/scripts/import_retargetingkit_docs.py deleted file mode 100644 index f5b021d..0000000 --- a/scripts/import_retargetingkit_docs.py +++ /dev/null @@ -1,74 +0,0 @@ -# /// script -# requires-python = ">=3.10" -# dependencies = ["griffe>=2,<3", "pillow>=11,<12", "pyyaml>=6,<7", "xdoctest>=1.3,<2"] -# /// -"""Import the public retargetingkit docs (md) into data/docs/retargetingkit.js. - - uv run scripts/import_retargetingkit_docs.py /path/to/retargetingkit - -As for RoboKit, pages, sidebar order (`docs/nav.yml`), and API definitions -come from the supplied checkout. Source images are copied to -assets/docs/retargetingkit/; gallery recordings already live there. Only this -kit's marked block in data/docs/retargetingkit.js is replaced. -""" - -import shutil -import sys -from pathlib import Path - -import apimodel -import yaml -from md2doc import Converter, assemble, splice, splice_api_tabs -from PIL import Image - -ROOT = Path(__file__).resolve().parent.parent -GITHUB = "https://github.com/openrobokit/retargetingkit/" -BEGIN = "// BEGIN GENERATED retargetingkit DOCS (scripts/import_retargetingkit_docs.py)" -END = "// END GENERATED retargetingkit DOCS" -# Frame the original panel in the page; preserve all screenshot pixels. -CROPS = { - "xrobotoolkit-pico-fullbody-settings.jpeg": [640, 280, 790, 715], - "vision-pro-tracking-streamer-start.jpg": [310, 270, 1060, 560], -} - - -def main() -> None: - repo = Path(sys.argv[1]).expanduser().resolve() - docs = repo / "docs" - files = [] - for group in yaml.safe_load((docs / "nav.yml").read_text()): - runs = [(None, group.get("pages") or [])] - runs += [(f["fold"], f["pages"]) for f in group.get("folds") or []] - for fold, pages in runs: - for page in pages: - files.append( - {"group": group["group"], "src": page["file"], "id": page["id"], "sub": fold, "nav": page.get("nav")} - ) - images = {} - for source in sorted((docs / "assets").rglob("*")): - if not source.is_file() or source.suffix.lower() not in {".png", ".jpg", ".jpeg", ".webp"}: - continue - public = f"/assets/docs/retargetingkit/{source.relative_to(docs)}" - dest = ROOT / public.lstrip("/") - dest.parent.mkdir(parents=True, exist_ok=True) - shutil.copyfile(source, dest) - with Image.open(dest) as img: - images[public] = {"size": img.size} - if source.name in CROPS: - images[public]["crop"] = CROPS[source.name] - conv = Converter("retargetingkit", GITHUB, {f["src"]: f["id"] for f in files}, images) - conv.docs_dir = docs - package = apimodel.load_package("retargetingkit", repo / "src") - source = apimodel.Repo(src=repo / "src", github=GITHUB) - groups = assemble(files, docs, conv, lambda name: apimodel.resolve(package, name, source, conv)) - splice(ROOT / "data/docs/retargetingkit.js", BEGIN, END, groups) - splice_api_tabs("retargetingkit", "RetargetingKit", "scripts/import_retargetingkit_docs.py", docs, conv, files, ( - ("guide/hand_retargeting.md", "Use the Python API", "Hand", "hand.py"), - ("guide/arm_retargeting.md", "Retarget an arm and hand", "Arm and hand", "arm_hand.py"), - ("guide/humanoid_retargeting.md", "Use the Python API", "Humanoid", "humanoid.py"), - )) - print(f"Published {len(files)} pages and {len(images)} original images.") - - -if __name__ == "__main__": - main() diff --git a/scripts/preview.sh b/scripts/preview.sh deleted file mode 100755 index 3c237e9..0000000 --- a/scripts/preview.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -set -eu - -preview_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) -preview_port=${1:-8914} - -cd "$preview_root" -make site -printf '\nWebsite: http://localhost:%s/retargetingkit/\nDocs: http://localhost:%s/docs/retargetingkit/\n\n' "$preview_port" "$preview_port" -exec python3 -u scripts/serve.py "$preview_port" _page diff --git a/scripts/serve.py b/scripts/serve.py index 5f80817..cf257ce 100644 --- a/scripts/serve.py +++ b/scripts/serve.py @@ -88,7 +88,7 @@ def log_message(self, *args): def main(): - port = int(sys.argv[1]) if len(sys.argv) > 1 else 8734 + port = int(sys.argv[1]) if len(sys.argv) > 1 else 8914 root = sys.argv[2] if len(sys.argv) > 2 else "." socketserver.ThreadingTCPServer.allow_reuse_address = True handler = functools.partial(RangeHandler, directory=root)