Skip to the content

Uchusen Rockets宇宙船

Rockets drawn from sourced sizes: line drawings and painted 3D views you drop into a page, take apart and turn round, and a typed model that checks whether a rocket really goes together.

Uchusen is the Japanese word 宇宙船 for spaceship. About the name

Contents

Reference · Rockets, variants, parts and the fit check

EmbedSettingstype

Where the embed code points: the address of the demo that holds embed.html, and the CDN folder the element loads from. Both default to this package's own.

Import it

import type { EmbedSettings } from "@johnmorrisdotca/uchusen-rockets";

Definition

interface EmbedSettings {
    site?: string;
    cdn?: string;
    size?: number;
}

Members

NameTypeDescription
site (optional)string | undefined

The address of the published demo, where embed.html is.

cdn (optional)string | undefined

The CDN or package path the element is loaded from.

size (optional)number | undefined

Pixels across for the iframe (its largest width) and the link picture (its width; the height follows). 480 when left out.

Examples

import { embedCode, type EmbedSettings } from "@johnmorrisdotca/uchusen-rockets";

const settings: EmbedSettings = { site: "https://example.test/rockets/" };
console.log(embedCode({ rocket: "starship" }, "iframe", settings));
<iframe
  src="https://example.test/rockets/embed.html?rocket=starship"
  title="Rocket"
  loading="lazy"
  style="width:100%;max-width:480px;aspect-ratio:3 / 4;border:0"
></iframe>

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/uchusen-rockets 0.14.0.