Skip to content
Edit this page

Working on the page

The code is in neoneye/sew-fantasy; this documentation is in neoneye/sew-fantasy-docs.

The page is too large to keep in one file. index.html starts with Jekyll front matter and consists of include_relative lines, one for each file under parts/. They are joined into one self-contained page when the site is built. It cannot be opened straight from disk. three.js is loaded from a CDN.

Seeing the page

.venv/bin/python server/app.py

Joins the parts anew at every reload. See the local server for how to install it. Open http://127.0.0.1:5050.

node assemble.mjs out.html

Writes the finished page to out.html, which opens straight from disk. Write it somewhere outside the repository, or delete it afterwards.

bundle install
bundle exec jekyll serve

As GitHub Pages builds it; open http://localhost:4000. It needs Ruby 3.3 (the github-pages gem does not install on Ruby 4; with Homebrew, brew install ruby@3.3 and put /opt/homebrew/opt/ruby@3.3/bin first on your PATH). If the build stops with Invalid US-ASCII character, run export LC_ALL=en_US.UTF-8 first.

Warning

No part may contain two opening braces in a row, or an opening brace and a percent sign: Jekyll reads them as Liquid and the site stops building. assemble.mjs and the tests refuse such a part.

The parts

In the order they are joined:

File What is in it
parts/style.css the page's styles
parts/body.html the page's markup: header, side panels, canvas
parts/shared-01-body.js test harness, small helpers, measurements, figures and the body model
parts/shared-01b-shoulder.js the rounded join of arm and torso
parts/shared-02-shell-pieces.js the garment shell, charts, and how one pattern piece is built and unrolled
parts/shared-03-drafting-trousers.js shared drafting blocks; trousers, jeans, shorts
parts/shared-04-shirt-dress.js hosiery, shirt, dress, slip dress, skirt, tops, halter dress
parts/shared-05-swim.js swimwear: monokini, panel suit, wrap, swimsuit, rash suit, cut-out suit
parts/shared-06-suits.js catsuit, hazmat suit, plunge dress, halter top
parts/shared-07-qipao-uniforms.js the qipao block that jackets, coats and uniforms are cut from; crew suit, striped suit, patrol uniform, long dress
parts/shared-08-more-suits.js halter bodysuit, sequin and tailored jumpsuits, sequin scrolls, bikini
parts/shared-08b-bodysuits.js open-back bodysuit, mesh zip bodysuit, fly-back, pearl racer and racer-back swimsuits, tank suits (python, gold and silver zip), lace-up swimsuit, swimsuit with mesh insets
parts/shared-08c-tops.js halter ties, folds, and six tops: V-neck halters, crossed halter, wrap-front tee, wide-band halter, lace-back bralette
parts/shared-08d-shorts.js suede shorts with zip pockets, high-waisted faux-leather shorts, mesh-panel brief
parts/shared-08e-ladder.js folds at ankles and wrists, two ladder-back catsuits, silver leggings
parts/shared-08f-sets.js lace edging, white rib set, silver high-neck set, knit dress
parts/shared-08s-leathers.js two biker jackets, red zip jacket, leather rider trousers
parts/shared-09a-garments.js the garment catalogue: every garment, with its fit sliders
parts/shared-09b-cloths.js cloths and the list of prints
parts/shared-09c-categories.js product and texture groups, and the cloths of each garment; after a change of cloths the test says what the table should hold
parts/shared-09d-lab.js the Lab's Randomize: how badly a cloth suits a garment, and a random look within the limits
parts/shared-10-prints-cloth.js how prints, weaves and embossed leathers are drawn
parts/shared-11-machines.js sewing machines, stitch geometry, seam types
parts/shared-12-tests.js the tests node test.mjs runs
parts/ui-01-machine.js the 3D close-up of a sewing machine
parts/ui-02-scene.js page state, renderer, scene, studio backdrop
parts/ui-03-figure.js mesh helpers, mannequin finishes, head, hair, hands
parts/ui-04-shoes.js shoes and feet
parts/ui-05-materials-skeleton.js reflections and relief maps, the dress-form stand, the figure, the x-ray skeleton
parts/ui-06-pieces.js cloth textures, pieces as meshes, stitching, cutting table, cameras, labels
parts/ui-07-controls.js every panel and control
parts/ui-08-loop.js resizing, pose animation, the frame loop
parts/ui-09a-export-image.js picture export
parts/ui-09b-document.js the making-up document (HTML, Markdown, JSON)
parts/ui-09c-picture.js generated pictures, with the local server
parts/ui-10-start.js start-up and URL parameters

The shared-* files together are one <script>, and the ui-* files together are one <script type="module">. A part is a slice of that script, not a module of its own: it cannot be loaded or syntax-checked alone, and the order matters.

Google Analytics

The published site counts visits with Google Analytics (G-2F6NE7JWTR): the page loads it from a short script at the top of index.html, the documentation from docs/javascripts/analytics.js. Both load it only when the address is neoneye.github.io and the browser is not driven by a test or a script, so it stays off on localhost, with the local server, in a page opened from disk, and in a copy published under another account. A custom domain would have to be added to both checks.

Without stage= in the address the page opens on Home, whose text is part of parts/body.html, so search engines and link previews read it without running the page. The head of index.html has the description, the canonical address and the tags for a link preview (og: and twitter:). Beside it are favicon.svg (a dress form), apple-touch-icon.png (the same at 180 px on a square background, made with rsvg-convert) and og-image.jpg, the picture in a link preview: Home at 1200 × 630, rendered in headless Chrome from ?still&g=bardotdress&hair=waves&backdrop=teal. The documentation uses the same icons (docs/images/) and picture; overrides/main.html adds the preview tags to its pages, and each page's description: comes from its front matter.

sitemap.xml beside index.html is the sitemap submitted to Google Search Console. It lists two others: sitemap-page.xml, with the page's one address, and the documentation's own, which its build writes. BingSiteAuth.xml shows Bing Webmaster Tools that the site is ours; it has to stay.