termigan 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +304 -2
- package/assets/logo.svg +97 -0
- package/dist/termigan.wasm +0 -0
- package/docs/api.md +295 -0
- package/docs/architecture.md +102 -0
- package/package.json +62 -5
- package/types/index.d.ts +123 -0
- package/web/canvas-renderer.js +427 -0
- package/web/input-controller.js +181 -0
- package/web/pty-socket.js +125 -0
- package/web/termigan.js +870 -0
- package/web/viewport-controller.js +184 -0
- package/web/wasm-bridge.js +264 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Daniel Neighman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,305 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/logo.svg" alt="Termigan logo" width="128">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">Termigan</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>A standalone browser terminal viewer that scales, zooms, and obeys your app.</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
Pure Roc 0.1.0 compiled to a 117 KB zero-import WebAssembly binary · Zero runtime dependencies · 6 TLA+ verified gateways
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://github.com/hassox/termigan/actions/workflows/ci.yml"><img src="https://github.com/hassox/termigan/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="#quick-start">Quick Start</a> ·
|
|
21
|
+
<a href="#why-termigan">Why Termigan</a> ·
|
|
22
|
+
<a href="#step-by-step-guide">Step-by-Step Guide</a> ·
|
|
23
|
+
<a href="#display-a-rex-pane">Rex Pane</a> ·
|
|
24
|
+
<a href="#try-the-live-demo">Live Demo</a> ·
|
|
25
|
+
<a href="docs/api.md">API Reference</a> ·
|
|
26
|
+
<a href="docs/architecture.md">Architecture</a>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
<em>Left pane shows a 120x36 remote terminal in mirror mode scaled cleanly into a split pane with zero scrollbars. Top right runs Roc and WebAssembly tests in fit mode. Bottom right runs vim in fit mode using the alternate screen buffer.</em>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
Install the package:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npm install termigan
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Mount a terminal in four lines. You do not need to configure `cols`, `rows`, or a `wasmUrl` path.
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
import { createTermiganViewer } from "termigan";
|
|
49
|
+
|
|
50
|
+
const viewer = await createTermiganViewer(document.getElementById("terminal"));
|
|
51
|
+
viewer.write("Hello from \x1b[1;34mTermigan\x1b[0m\r\n");
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Prefer declarative HTML? Use the built-in `<termigan-viewer>` custom element.
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<termigan-viewer id="terminal" style="width: 640px; height: 360px"></termigan-viewer>
|
|
58
|
+
<script type="module">
|
|
59
|
+
import "termigan";
|
|
60
|
+
|
|
61
|
+
const viewer = await document.getElementById("terminal").ready();
|
|
62
|
+
viewer.write("Ready.\r\n");
|
|
63
|
+
</script>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The package bundles the browser ES modules, TypeScript declarations, and the prebuilt `dist/termigan.wasm` binary. `createTermiganViewer` resolves `dist/termigan.wasm` relative to `web/termigan.js` through `import.meta.url`, so Vite, esbuild, Rollup, Webpack 5, and direct browser imports work out of the box.
|
|
67
|
+
|
|
68
|
+
## Why Termigan
|
|
69
|
+
|
|
70
|
+
Most browser terminal widgets assume they own the window. Put one in a dashboard tile, a split workspace, or a shared session monitor and you end up fighting scrollbars, unwanted PTY resizes, dropped connections on fullscreen zoom, and stolen keyboard shortcuts.
|
|
71
|
+
|
|
72
|
+
Termigan separates the terminal engine from application policy. Your app owns WebSockets, tabs, splits, and shortcuts. Termigan handles VT parsing, screen state, reflow, and high-DPI canvas rendering.
|
|
73
|
+
|
|
74
|
+
| Problem | How Termigan handles it |
|
|
75
|
+
|---|---|
|
|
76
|
+
| Watching a 200x60 terminal in a 360px tile | Default `"mirror"` mode keeps the 200x60 grid intact, shrinks the font and canvas cleanly with zero scrollbars, and never resizes the remote PTY. |
|
|
77
|
+
| Resizing the browser window or dragging splits | `ResizeObserver` rescales `"mirror"` panes live without sending `SIGWINCH`, or reflows soft-wrapped lines and emits `onResize` in `"fit"` mode. |
|
|
78
|
+
| Zooming a terminal to full window | `setExpanded(true)` promotes the existing viewer root into the browser's CSS Top Layer using HTML Popover. Zero reconnects, zero dropped bytes, focus preserved. |
|
|
79
|
+
| Leader keys and browser-reserved chords | `shouldHandleKey` lets your app claim shortcuts before encoding. `sendKey` injects `Ctrl+W` or mode-aware VT keys from host chords or toolbar buttons. |
|
|
80
|
+
| Multiple terminals on one page | Every viewer owns its own 117 KB WebAssembly instance, `<canvas>`, and hidden `<textarea>`. Ten panes share zero parser, mode, or scrollback state. |
|
|
81
|
+
| Correctness and memory safety | Six component gateways (Roc VT core, WASM memory bridge, JS viewport and input controllers, and `attachPtySocket`) are model-checked in TLA+ with `everystate`, and `dispose()` releases every WebAssembly byte back to zero. |
|
|
82
|
+
|
|
83
|
+
## Step-by-Step Guide
|
|
84
|
+
|
|
85
|
+
Start with the four-line viewer above and layer in only what your app needs.
|
|
86
|
+
|
|
87
|
+
### Step 1. Attach a PTY WebSocket
|
|
88
|
+
|
|
89
|
+
Declare and own your `WebSocket` instance so your app keeps full control of `open`, `close`, `error`, and reconnect logic, then pass it to `attachPtySocket`.
|
|
90
|
+
|
|
91
|
+
```js
|
|
92
|
+
import { createTermiganViewer, attachPtySocket } from "termigan";
|
|
93
|
+
|
|
94
|
+
const viewer = await createTermiganViewer(document.getElementById("terminal"));
|
|
95
|
+
const socket = new WebSocket("ws://127.0.0.1:8080/ws/pty");
|
|
96
|
+
const detach = attachPtySocket(viewer, socket);
|
|
97
|
+
|
|
98
|
+
socket.addEventListener("open", () => setStatus("connected"));
|
|
99
|
+
socket.addEventListener("close", () => setStatus("disconnected"));
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`attachPtySocket` sets `socket.binaryType = "arraybuffer"`, attaches via `addEventListener("message", ...)` without overwriting your handlers, writes binary output frames into `viewer.write(...)`, applies JSON `{ type: "size", cols, rows }` frames via `viewer.setRemoteSize(...)`, forwards `viewer.onInput(...)` bytes when the socket is open, and sends JSON `{ type: "resize", cols, rows }` frames when `"fit"` mode resizes. Pass `decodeMessage` and `encodeResize` in options for custom protocols, pass `{ bidirectional: false }` for read-only log viewers, or wire `viewer.write` and `viewer.onInput` directly for non-WebSocket transports.
|
|
103
|
+
|
|
104
|
+
### Step 2. Follow a remote owner's dimensions without fighting them
|
|
105
|
+
|
|
106
|
+
When a remote PTY, CI job, or shared `tmux` session runs at a different size (for example 200x60), send `{ "type": "size", "cols": 200, "rows": 60 }` over the PTY socket or call `viewer.setRemoteSize(cols, rows)` directly.
|
|
107
|
+
|
|
108
|
+
```js
|
|
109
|
+
viewer.setRemoteSize(200, 60);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Because Termigan starts in `"mirror"` mode, it matches the remote 200x60 grid cell for cell so cursor positioning, `vim`, and tables line up accurately. It shrinks the font toward `minFontSize` (and scales the canvas CSS box down if the container gets even smaller) so the whole screen stays visible with zero scrollbars. Resizing the page or dragging a split rescales the view live and never sends a resize back to the remote owner.
|
|
113
|
+
|
|
114
|
+
### Step 3. Take over PTY sizing when you want `"fit"` mode
|
|
115
|
+
|
|
116
|
+
When the user switches from watching a session to driving it directly, hand resize control to the container with `setSizeMode("fit")`. Call `proposeFitSize()` first if you want to preview the resulting grid before switching.
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
const preview = viewer.proposeFitSize();
|
|
120
|
+
|
|
121
|
+
fitButton.addEventListener("click", () => {
|
|
122
|
+
viewer.setSizeMode("fit");
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
mirrorButton.addEventListener("click", () => {
|
|
126
|
+
viewer.setSizeMode("mirror");
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
In `"fit"` mode, container and window resizes compute how many columns and rows fit at `fontSize`, reflow soft-wrapped lines inside WebAssembly, and emit `onResize(cols, rows)` only when the grid dimensions change (which `attachPtySocket` forwards automatically as `{ type: "resize", cols, rows }`). Switching back to `"mirror"` immediately snaps back to the latest `setRemoteSize` dimensions.
|
|
131
|
+
|
|
132
|
+
### Step 4. Expand any pane full-window without reconnecting
|
|
133
|
+
|
|
134
|
+
Promote a small tile straight into a full-viewport overlay with `setExpanded(true)` and drop it back into its slot with `setExpanded(false)`.
|
|
135
|
+
|
|
136
|
+
```js
|
|
137
|
+
expandButton.addEventListener("click", () => {
|
|
138
|
+
viewer.setExpanded(!viewer.getState().expanded);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
viewer.onExpandedChange((expanded) => {
|
|
142
|
+
expandButton.textContent = expanded ? "Restore" : "Expand";
|
|
143
|
+
});
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Termigan opens the live viewer root in the browser's CSS Top Layer via `showPopover()`. The WebAssembly instance, WebSocket, scrollback history, and `<textarea>` focus remain untouched. A shrunk `"mirror"` tile expands straight back up to crisp full-size text, while a `"fit"` pane recalculates the larger full-window grid automatically.
|
|
147
|
+
|
|
148
|
+
### Step 5. Own keyboard routing and inject reserved chords
|
|
149
|
+
|
|
150
|
+
Intercept leader keys or app shortcuts before Termigan processes them, and send browser-reserved keys like `Ctrl+W` from your own UI or leader bindings.
|
|
151
|
+
|
|
152
|
+
```js
|
|
153
|
+
viewer.setKeyInterceptor((event) => {
|
|
154
|
+
if (event.ctrlKey && event.key === "`") {
|
|
155
|
+
return "host";
|
|
156
|
+
}
|
|
157
|
+
return "terminal";
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
ctrlWButton.addEventListener("click", () => {
|
|
161
|
+
viewer.sendKey({ key: "w", ctrl: true });
|
|
162
|
+
});
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Returning `"host"` leaves the key untouched for your page and suppresses any leaked printable input on the hidden `<textarea>`. `sendKey` encodes named keys and modifiers using the terminal's live DEC modes (such as application cursor keys in `vim` or `less`) even when the terminal does not have focus.
|
|
166
|
+
|
|
167
|
+
### Step 6. Clean up on unmount
|
|
168
|
+
|
|
169
|
+
```js
|
|
170
|
+
detach();
|
|
171
|
+
socket.close();
|
|
172
|
+
viewer.dispose();
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
`detach()` removes Termigan's `message`, `onInput`, and `onResize` listeners without closing your socket. `dispose()` cancels pending animation frames, disconnects `ResizeObserver`, removes DOM and window listeners, removes the viewer root, and frees the WebAssembly terminal handle down to 0 live bytes.
|
|
176
|
+
|
|
177
|
+
## Display a Rex Pane
|
|
178
|
+
|
|
179
|
+
[Rex](https://www.superlogical.com/rex/docs) runs terminal panes as `com.superlogical.terminal` blocks with an explicit client `owner` that controls the pane's dimensions. Termigan's `"mirror"` and `"fit"` modes match that ownership model directly. A browser tile can watch an ultrawide desktop Rex pane in `"mirror"` mode without resizing it, then claim ownership only when you expand the pane and switch to `"fit"`.
|
|
180
|
+
|
|
181
|
+
| Rex API or CLI | Termigan side | Purpose |
|
|
182
|
+
|---|---|---|
|
|
183
|
+
| `com.superlogical.terminal.size` (`rex block call -b BLOCK size`) | `viewer.setRemoteSize(columns, rows)` | Match the owner's active grid in `"mirror"` mode without resizing Rex. |
|
|
184
|
+
| `com.superlogical.terminal.format` (`format: "vt"`) or `rex capture -b BLOCK --format=vt` | `viewer.write(content)` | Load the current screen, scrollback, cursor position, and active modes as VT escape sequences. |
|
|
185
|
+
| `data.connect` (`data_ref_id: "terminal"`, `subprotocol: "rex.data.terminal.v1"`) | `viewer.write(chunk)` | Stream live terminal output bytes into the viewer as they arrive. |
|
|
186
|
+
| `block_event` with `name: "size_changed"` (`rex events -s SESSION --json`) | `viewer.setRemoteSize(payload.columns, payload.rows)` | Rescale the mirror tile live whenever the owning Rex client resizes. |
|
|
187
|
+
| `com.superlogical.terminal.write` (`rex send -b BLOCK`) | `viewer.onInput(bytes)` | Forward typed keys, pastes, and escape sequences back into the Rex block. |
|
|
188
|
+
| `session.own_block` (`mode: "take"`) and `com.superlogical.terminal.resize` | `viewer.setSizeMode("fit")` and `viewer.onResize(cols, rows)` | Take size ownership when zooming in the browser and drive the Rex PTY dimensions. |
|
|
189
|
+
| `session.disown_block` | `viewer.setSizeMode("mirror")` | Release size ownership so the previous Rex client regains its dimensions. |
|
|
190
|
+
|
|
191
|
+
Find a block ID and test reading its size and VT snapshot from the CLI:
|
|
192
|
+
|
|
193
|
+
```sh
|
|
194
|
+
rex block ls --json
|
|
195
|
+
rex block call -b "$BLOCK_ID" size
|
|
196
|
+
rex block call -b "$BLOCK_ID" format '{"format":"vt","extra_cursor":true,"extra_modes":true,"extra_style":true,"extra_scrolling_region":true}'
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
In your browser host, connect through a thin bridge attached to your Rex session (`session.attach`) and wire the viewer to the block's size, VT stream, events, input, and ownership transitions:
|
|
200
|
+
|
|
201
|
+
```js
|
|
202
|
+
import { createTermiganViewer } from "termigan";
|
|
203
|
+
|
|
204
|
+
const decoder = new TextDecoder();
|
|
205
|
+
const viewer = await createTermiganViewer(document.getElementById("rex-pane"));
|
|
206
|
+
|
|
207
|
+
const { columns, rows } = await rex.call("com.superlogical.terminal.size", {
|
|
208
|
+
session_id: sessionId,
|
|
209
|
+
block_id: blockId,
|
|
210
|
+
args: {},
|
|
211
|
+
});
|
|
212
|
+
viewer.setRemoteSize(columns, rows);
|
|
213
|
+
|
|
214
|
+
const snapshot = await rex.call("com.superlogical.terminal.format", {
|
|
215
|
+
session_id: sessionId,
|
|
216
|
+
block_id: blockId,
|
|
217
|
+
args: {
|
|
218
|
+
format: "vt",
|
|
219
|
+
extra_cursor: true,
|
|
220
|
+
extra_modes: true,
|
|
221
|
+
extra_style: true,
|
|
222
|
+
extra_scrolling_region: true,
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
viewer.write(snapshot.content);
|
|
226
|
+
|
|
227
|
+
rexDataStream.onBytes((chunk) => viewer.write(chunk));
|
|
228
|
+
|
|
229
|
+
rex.onEvent((event) => {
|
|
230
|
+
if (
|
|
231
|
+
event.type === "block_event" &&
|
|
232
|
+
event.block_id === blockId &&
|
|
233
|
+
event.name === "size_changed"
|
|
234
|
+
) {
|
|
235
|
+
viewer.setRemoteSize(event.payload.columns, event.payload.rows);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
viewer.onInput((bytes) => {
|
|
240
|
+
rex.call("com.superlogical.terminal.write", {
|
|
241
|
+
session_id: sessionId,
|
|
242
|
+
block_id: blockId,
|
|
243
|
+
args: { data: decoder.decode(bytes) },
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
viewer.onResize((cols, rows) => {
|
|
248
|
+
rex.call("com.superlogical.terminal.resize", {
|
|
249
|
+
session_id: sessionId,
|
|
250
|
+
block_id: blockId,
|
|
251
|
+
args: { columns: cols, rows },
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
async function takeControl() {
|
|
256
|
+
await rex.call("session.own_block", {
|
|
257
|
+
session_id: sessionId,
|
|
258
|
+
block_ids: [blockId],
|
|
259
|
+
mode: "take",
|
|
260
|
+
});
|
|
261
|
+
viewer.setExpanded(true);
|
|
262
|
+
viewer.setSizeMode("fit");
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
async function releaseControl() {
|
|
266
|
+
viewer.setSizeMode("mirror");
|
|
267
|
+
viewer.setExpanded(false);
|
|
268
|
+
await rex.call("session.disown_block", {
|
|
269
|
+
session_id: sessionId,
|
|
270
|
+
block_ids: [blockId],
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Because Rex listens on a local Unix socket (or authenticated remote endpoint), your backend bridge holds the attached Rex session, calls `data.connect` (`data_ref_id: "terminal"`, `subprotocol: "rex.data.terminal.v1"` on `/api/data`) for live output bytes, and proxies control calls to the browser. For snapshot views without a live data stream, `com.superlogical.terminal.format` with `format: "vt"` (or `rex capture -b "$BLOCK_ID" --format=vt`) feeds directly into `viewer.write(...)`.
|
|
276
|
+
|
|
277
|
+
## Try the Live Demo
|
|
278
|
+
|
|
279
|
+
This repository includes a full multi-tab, draggable split-pane reference host in [host/index.html](host/index.html) and [host/pty-server.py](host/pty-server.py) that combines all six steps above with a floating top-layer hover bar and tmux-style `Ctrl+\`` leader chords (`h`/`j`/`k`/`l`, `o`, `;`, `%`, `"`, `z`, `x`, `c`, `n`, `p`, `1`..`9`).
|
|
280
|
+
|
|
281
|
+
```sh
|
|
282
|
+
make install
|
|
283
|
+
make demo
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
Open `http://127.0.0.1:8080` in your browser. Run `make doctor` instead of `make install` to check your local toolchain (`roc`, `everystate`, `clang`, `node`, `python3`, and Chrome or Chromium) without modifying your system.
|
|
287
|
+
|
|
288
|
+
## Development
|
|
289
|
+
|
|
290
|
+
| Command | What it runs |
|
|
291
|
+
|---|---|
|
|
292
|
+
| `make install` | Installs Roc `0.1.0` and `everystate` if absent and checks system dependencies. |
|
|
293
|
+
| `make build` | Compiles `platform/host.c` and the Roc core to `dist/termigan.wasm`. |
|
|
294
|
+
| `make test` | Runs all 6 TLA+ models, Roc format and unit tests, Node WebAssembly and state tests, and headless Chrome suites. |
|
|
295
|
+
| `make test-pack` | Builds the npm tarball in a temp directory, validates packaged files, and executes a WASM roundtrip from the unpacked bundle. |
|
|
296
|
+
| `make demo` | Builds `dist/termigan.wasm` and serves the local PTY demo at `http://127.0.0.1:8080`. |
|
|
297
|
+
|
|
298
|
+
## Documentation
|
|
299
|
+
|
|
300
|
+
- [API Reference](docs/api.md) covers every factory option, theme field, control method, event callback, `attachPtySocket`, state snapshot field, and `<termigan-viewer>` attribute.
|
|
301
|
+
- [Architecture Guide](docs/architecture.md) covers the four-layer boundary, `Box(Terminal)` ownership transfer, binary dirty-row frames, and all six TLA+ gateway models.
|
|
302
|
+
|
|
303
|
+
## License
|
|
304
|
+
|
|
305
|
+
MIT. See [LICENSE](LICENSE).
|
package/assets/logo.svg
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" id="termigan-logo" aria-labelledby="logo-svg-title logo-svg-desc" width="240" height="240" viewBox="0 0 56 51" fill="none">
|
|
2
|
+
<title id="logo-svg-title">The Termigan logo</title>
|
|
3
|
+
<desc id="logo-svg-desc">An origami winter rock ptarmigan made of faceted polygons</desc>
|
|
4
|
+
<style>
|
|
5
|
+
#termigan-logo { overflow: visible; }
|
|
6
|
+
.logo-light { fill: #e7edf5; }
|
|
7
|
+
.logo-dark { fill: #c0cde0; }
|
|
8
|
+
.logo-shadow { fill: #93a4bd; }
|
|
9
|
+
.logo-ink { fill: #1e2533; }
|
|
10
|
+
.logo-beak { fill: #354259; }
|
|
11
|
+
.logo-comb { fill: #dc2626; }
|
|
12
|
+
.logo-star { opacity: 0; }
|
|
13
|
+
#logo-star-glow stop { stop-color: #8b5cf6; }
|
|
14
|
+
.logo-flare {
|
|
15
|
+
stroke: #8b5cf6;
|
|
16
|
+
stroke-opacity: .4;
|
|
17
|
+
vector-effect: non-scaling-stroke;
|
|
18
|
+
}
|
|
19
|
+
.logo-core { fill: #6d28d9; }
|
|
20
|
+
@media (prefers-color-scheme: light) {
|
|
21
|
+
.logo-glow { display: none; }
|
|
22
|
+
}
|
|
23
|
+
@media (prefers-color-scheme: dark) {
|
|
24
|
+
.logo-light { fill: #f1f5f9; }
|
|
25
|
+
.logo-dark { fill: #c8d4e4; }
|
|
26
|
+
.logo-shadow { fill: #9aaac0; }
|
|
27
|
+
.logo-ink { fill: #2c3547; }
|
|
28
|
+
.logo-beak { fill: #445169; }
|
|
29
|
+
.logo-comb { fill: #ef4444; }
|
|
30
|
+
#logo-star-glow stop { stop-color: #9650ff; }
|
|
31
|
+
.logo-flare { stroke: #9650ff; }
|
|
32
|
+
.logo-core { fill: #d6b4ff; }
|
|
33
|
+
}
|
|
34
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
35
|
+
#termigan-logo > path,
|
|
36
|
+
#termigan-logo .logo-star {
|
|
37
|
+
animation: logo-face .45s ease-out backwards;
|
|
38
|
+
animation-delay: calc(.4s + var(--i) * .18s);
|
|
39
|
+
}
|
|
40
|
+
#termigan-logo > path {
|
|
41
|
+
stroke: #8088e2;
|
|
42
|
+
stroke-opacity: 0;
|
|
43
|
+
stroke-linejoin: round;
|
|
44
|
+
vector-effect: non-scaling-stroke;
|
|
45
|
+
}
|
|
46
|
+
#termigan-logo .logo-star { animation-name: logo-star; }
|
|
47
|
+
@keyframes logo-face {
|
|
48
|
+
from { fill-opacity: 0; stroke-opacity: 1; }
|
|
49
|
+
}
|
|
50
|
+
@keyframes logo-star {
|
|
51
|
+
from { opacity: 1; }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
@media (prefers-reduced-motion: no-preference) and (prefers-color-scheme: dark) {
|
|
55
|
+
#termigan-logo > path { stroke: #4860ff; }
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
58
|
+
<path style="--i:0" d="M1.5 41.4 10.4 36.2 12.4 40.2Z" class="logo-ink"/>
|
|
59
|
+
<path style="--i:1" d="M10.4 36.2 16.4 30 15 39.1 12.4 40.2Z" class="logo-dark"/>
|
|
60
|
+
<path style="--i:2" d="M16.4 30 24 18.6 35.8 24.8 14.4 43 15 39.1Z" class="logo-light"/>
|
|
61
|
+
<path style="--i:3" d="M24 18.6 37.4 12.6 46.2 11.4 35.8 24.8Z" class="logo-dark"/>
|
|
62
|
+
<path style="--i:4" d="M46.2 11.4 50.8 22 48.8 32 41.8 39.4 35.8 24.8Z" class="logo-light"/>
|
|
63
|
+
<path style="--i:5" d="M14.4 43 35.8 24.8 41.8 39.4 37 41 32 41.6 27 42.2 19.6 42Z" class="logo-dark"/>
|
|
64
|
+
<path style="--i:6" d="M27 42.2 32 41.6 32.4 46.8 37.2 48.6 30.2 48.6Z" class="logo-shadow"/>
|
|
65
|
+
<path style="--i:6" d="M37 41 41.8 39.4 43.4 47 49.4 49.2 41.4 49.2Z" class="logo-light"/>
|
|
66
|
+
<path style="--i:7" d="M37.4 12.6 39.8 5.2 45.6 1.8 49.6 3.6 51.1 5.5 49.1 4.9 46.8 2.9 44 4.4 43.3 5.3 48 7.5 50.2 7.9 46.2 11.4Z" class="logo-light"/>
|
|
67
|
+
<path style="--i:8" d="M44 4.4 46.8 2.9 49.1 4.9 43.3 5.3Z" class="logo-comb"/>
|
|
68
|
+
<path style="--i:8" d="M43.3 5.3 49.1 4.9 51.1 5.5 50.2 7.9 48 7.5Z" class="logo-ink"/>
|
|
69
|
+
<path style="--i:9" d="M51.1 5.5 54.6 8.1 50.2 7.9Z" class="logo-beak"/>
|
|
70
|
+
<defs>
|
|
71
|
+
<radialGradient id="logo-star-glow">
|
|
72
|
+
<stop offset="0" stop-opacity=".5"/>
|
|
73
|
+
<stop offset=".3" stop-opacity=".2"/>
|
|
74
|
+
<stop offset="1" stop-opacity="0"/>
|
|
75
|
+
</radialGradient>
|
|
76
|
+
<g id="logo-star">
|
|
77
|
+
<circle class="logo-glow" r="4.5" fill="url(#logo-star-glow)"/>
|
|
78
|
+
<path class="logo-flare" d="M-2 0H2M0-2V2"/>
|
|
79
|
+
<circle class="logo-core" r=".5"/>
|
|
80
|
+
</g>
|
|
81
|
+
</defs>
|
|
82
|
+
<use class="logo-star" style="--i:0" href="#logo-star" x="1.5" y="41.4"/>
|
|
83
|
+
<use class="logo-star" style="--i:1" href="#logo-star" x="10.4" y="36.2"/>
|
|
84
|
+
<use class="logo-star" style="--i:2" href="#logo-star" x="16.4" y="30"/>
|
|
85
|
+
<use class="logo-star" style="--i:2" href="#logo-star" x="24" y="18.6"/>
|
|
86
|
+
<use class="logo-star" style="--i:2" href="#logo-star" x="14.4" y="43"/>
|
|
87
|
+
<use class="logo-star" style="--i:3" href="#logo-star" x="37.4" y="12.6"/>
|
|
88
|
+
<use class="logo-star" style="--i:3" href="#logo-star" x="35.8" y="24.8"/>
|
|
89
|
+
<use class="logo-star" style="--i:4" href="#logo-star" x="50.8" y="22"/>
|
|
90
|
+
<use class="logo-star" style="--i:4" href="#logo-star" x="48.8" y="32"/>
|
|
91
|
+
<use class="logo-star" style="--i:5" href="#logo-star" x="41.8" y="39.4"/>
|
|
92
|
+
<use class="logo-star" style="--i:6" href="#logo-star" x="30.2" y="48.6"/>
|
|
93
|
+
<use class="logo-star" style="--i:6" href="#logo-star" x="49.4" y="49.2"/>
|
|
94
|
+
<use class="logo-star" style="--i:7" href="#logo-star" x="45.6" y="1.8"/>
|
|
95
|
+
<use class="logo-star" style="--i:9" href="#logo-star" x="51.1" y="5.5"/>
|
|
96
|
+
<use class="logo-star" style="--i:9" href="#logo-star" x="54.6" y="8.1"/>
|
|
97
|
+
</svg>
|
|
Binary file
|