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
| Name | Type | Description |
|---|---|---|
site (optional) | string | undefined | The address of the published demo, where |
cdn (optional) | string | undefined | The CDN or package path the element is loaded from. |
size (optional) | number | undefined | Pixels across for the |
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)