roamwright 0.61.16 → 0.61.17

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/README.md CHANGED
@@ -30,30 +30,31 @@ npm resolves the Three.js peer in a new project. Roamwright targets Three.js **0
30
30
 
31
31
  ## Examples
32
32
 
33
- Browse all twenty examples on the [live showcase](https://enestaylan.github.io/roamwright/).
34
-
35
- | Live example | What the example shows | Source |
36
- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
37
- | [A small world](https://enestaylan.github.io/roamwright/examples/small-world.html?seed=42) | A coastal valley with a walled harbour town, lamps, market crowd, pasture herds, ships and a passing day/night sky. | [small-world.js](examples/small-world.js) |
38
- | [Towns](https://enestaylan.github.io/roamwright/examples/towns.html?seed=7) | A village streaming in block by block along a winding valley road, with street lamps and windows lit after dark. | [towns.js](examples/towns.js) |
39
- | [Town fittings](https://enestaylan.github.io/roamwright/examples/town-fittings.html?seed=42) | Walled courtyard gardens with instanced shrubs, harbour works and breakwater moles, street lamps and a desert storm wall. | [town-fittings.js](examples/town-fittings.js) |
40
- | [Fortification](https://enestaylan.github.io/roamwright/examples/fortification.html?seed=11) | Walled coastal or inland town with towers, battlements, vaulted gatehouses, wall-walk and portal in three styles. | [fortification.js](examples/fortification.js) |
41
- | [Harbour of ships](https://enestaylan.github.io/roamwright/examples/ships.html?seed=42) | Every preset of the ship kit moored stern-on to a stone harbour quay while a cog and rowing boat tack offshore. | [ships.js](examples/ships.js) |
42
- | [Alpine viaduct](https://enestaylan.github.io/roamwright/examples/viaduct.html?seed=42) | Watch an electric train cross eight stone arches above a forested alpine river from valley, trackside or riverbank. | [viaduct.js](examples/viaduct.js) |
43
- | [Crowds and herds](https://enestaylan.github.io/roamwright/examples/crowds.html?seed=17) | Instanced market crowd, patrolling camp walkers, street dogs, grazing cattle and poultry with crowd alarms. | [crowds.js](examples/crowds.js) |
44
- | [Animal kit](https://enestaylan.github.io/roamwright/examples/animals.html?seed=42) | Horses, cattle, sheep, a pack camel, dogs and a cat animated on procedural quadruped skeletons in a fenced paddock. | [animals.js](examples/animals.js) |
45
- | [Figure motion](https://enestaylan.github.io/roamwright/examples/figure-motion.html?seed=11) | Full-body procedural locomotion on uneven ground: walk, run, sit, bow, draw and sheathe a blade, and mount a horse. | [figure-motion.js](examples/figure-motion.js) |
46
- | [Fliers](https://enestaylan.github.io/roamwright/examples/fliers.html?seed=7) | Moths around a lantern, animated and perched corvids on a crag, wheeling bird flocks and four-winged gliders aloft. | [fliers.js](examples/fliers.js) |
47
- | [Rooms](https://enestaylan.github.io/roamwright/examples/rooms.html?seed=42) | A furnished beamed room and a domed arcaded hall with baked window, lamp and hearth light by day or night. | [rooms.js](examples/rooms.js) |
48
- | [House kit](https://enestaylan.github.io/roamwright/examples/house-kit.html?seed=42) | Every built-in architectural form — gable, hip, flat, tower, round, dome and courtyard — arranged round a town square. | [house-kit.js](examples/house-kit.js) |
49
- | [Props and plants](https://enestaylan.github.io/roamwright/examples/props-and-plants.html?seed=42) | Camp, market, farm and road props beside every tree, shrub, grass tussock and waterside reed in the plant kit. | [props-and-plants.js](examples/props-and-plants.js) |
50
- | [Effects by day and night](https://enestaylan.github.io/roamwright/examples/effects.html?seed=3) | Budgeted campfires and light pools, drifting smoke shadows, hollow mist and particle bursts that scorch the ground. | [effects.js](examples/effects.js) |
51
- | [Soundscape](https://enestaylan.github.io/roamwright/examples/soundscape.html?seed=42) | Synthesised spatial audio and surface-aware stride foley across a lakeside shore of water, mud, sand, stone and earth. | [soundscape.js](examples/soundscape.js) |
52
- | [Figures](https://enestaylan.github.io/roamwright/examples/figure.html?seed=7) | Sculpted procedural characters from plain look specs — faces, hair, clothing, cloaks and custom weapons, near and far. | [figure.js](examples/figure.js) |
53
- | [A baked land](https://enestaylan.github.io/roamwright/examples/land.html?seed=7) | One height sheet baked row by row with erosion, coast, river ford, banked road, cliff-faced tel, quarry and upland mere. | [land.js](examples/land.js) |
54
- | [Island](https://enestaylan.github.io/roamwright/examples/island.html?seed=42) | Fractal terrain shapes a coastline, sandy coves, weathered boulders and coastal pines in turquoise shallows. | [island.js](examples/island.js) |
55
- | [Pacing and measuring](https://enestaylan.github.io/roamwright/examples/pacing.html?seed=42) | Device-aware presets, ground render order, frame-pacing watch and a live performance box over a coastal valley. | [pacing.js](examples/pacing.js) |
56
- | [Ruins, rocks & paved roads](https://enestaylan.github.io/roamwright/examples/ruins.html?seed=42) | Hilltop ruins, buried-town mounds, bedded outcrops, a paved arch highway with cedar avenue and a flagstone plaza. | [ruins.js](examples/ruins.js) |
33
+ Browse all twenty-one examples on the [live showcase](https://enestaylan.github.io/roamwright/).
34
+
35
+ | Live example | What the example shows | Source |
36
+ | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
37
+ | [A small world](https://enestaylan.github.io/roamwright/examples/small-world.html?seed=42) | A coastal valley with a walled harbour town, lamps, market crowd, pasture herds, ships and a passing day/night sky. | [small-world.js](examples/small-world.js) |
38
+ | [Towns](https://enestaylan.github.io/roamwright/examples/towns.html?seed=7) | A village streaming in block by block along a winding valley road, with street lamps and windows lit after dark. | [towns.js](examples/towns.js) |
39
+ | [Town fittings](https://enestaylan.github.io/roamwright/examples/town-fittings.html?seed=42) | Walled courtyard gardens with instanced shrubs, harbour works and breakwater moles, street lamps and a desert storm wall. | [town-fittings.js](examples/town-fittings.js) |
40
+ | [Fortification](https://enestaylan.github.io/roamwright/examples/fortification.html?seed=11) | Walled coastal or inland town with towers, battlements, vaulted gatehouses, wall-walk and portal in three styles. | [fortification.js](examples/fortification.js) |
41
+ | [Harbour of ships](https://enestaylan.github.io/roamwright/examples/ships.html?seed=42) | Every preset of the ship kit moored stern-on to a stone harbour quay while a cog and rowing boat tack offshore. | [ships.js](examples/ships.js) |
42
+ | [Alpine viaduct](https://enestaylan.github.io/roamwright/examples/viaduct.html?seed=42) | Watch an electric train cross eight stone arches above a forested alpine river from valley, trackside or riverbank. | [viaduct.js](examples/viaduct.js) |
43
+ | [Crowds and herds](https://enestaylan.github.io/roamwright/examples/crowds.html?seed=17) | Instanced market crowd, patrolling camp walkers, street dogs, grazing cattle and poultry with crowd alarms. | [crowds.js](examples/crowds.js) |
44
+ | [Animal kit](https://enestaylan.github.io/roamwright/examples/animals.html?seed=42) | Horses, cattle, sheep, a pack camel, dogs and a cat animated on procedural quadruped skeletons in a fenced paddock. | [animals.js](examples/animals.js) |
45
+ | [Figure motion](https://enestaylan.github.io/roamwright/examples/figure-motion.html?seed=11) | Full-body procedural locomotion on uneven ground: walk, run, sit, bow, draw and sheathe a blade, and mount a horse. | [figure-motion.js](examples/figure-motion.js) |
46
+ | [Fliers](https://enestaylan.github.io/roamwright/examples/fliers.html?seed=7) | Moths around a lantern, animated and perched corvids on a crag, wheeling bird flocks and four-winged gliders aloft. | [fliers.js](examples/fliers.js) |
47
+ | [Rooms](https://enestaylan.github.io/roamwright/examples/rooms.html?seed=42) | A furnished beamed room and a domed arcaded hall with baked window, lamp and hearth light by day or night. | [rooms.js](examples/rooms.js) |
48
+ | [House kit](https://enestaylan.github.io/roamwright/examples/house-kit.html?seed=42) | Every built-in architectural form — gable, hip, flat, tower, round, dome and courtyard — arranged round a town square. | [house-kit.js](examples/house-kit.js) |
49
+ | [Props and plants](https://enestaylan.github.io/roamwright/examples/props-and-plants.html?seed=42) | Camp, market, farm and road props beside every tree, shrub, grass tussock and waterside reed in the plant kit. | [props-and-plants.js](examples/props-and-plants.js) |
50
+ | [Effects by day and night](https://enestaylan.github.io/roamwright/examples/effects.html?seed=3) | Budgeted campfires and light pools, drifting smoke shadows, hollow mist and particle bursts that scorch the ground. | [effects.js](examples/effects.js) |
51
+ | [Soundscape](https://enestaylan.github.io/roamwright/examples/soundscape.html?seed=42) | Synthesised spatial audio and surface-aware stride foley across a lakeside shore of water, mud, sand, stone and earth. | [soundscape.js](examples/soundscape.js) |
52
+ | [Figures](https://enestaylan.github.io/roamwright/examples/figure.html?seed=7) | Sculpted procedural characters from plain look specs — faces, hair, clothing, cloaks and custom weapons, near and far. | [figure.js](examples/figure.js) |
53
+ | [A baked land](https://enestaylan.github.io/roamwright/examples/land.html?seed=7) | One height sheet baked row by row with erosion, coast, river ford, banked road, cliff-faced tel, quarry and upland mere. | [land.js](examples/land.js) |
54
+ | [Island](https://enestaylan.github.io/roamwright/examples/island.html?seed=42) | Fractal terrain shapes a coastline, sandy coves, weathered boulders and coastal pines in turquoise shallows. | [island.js](examples/island.js) |
55
+ | [Pacing and measuring](https://enestaylan.github.io/roamwright/examples/pacing.html?seed=42) | Device-aware presets, ground render order, frame-pacing watch and a live performance box over a coastal valley. | [pacing.js](examples/pacing.js) |
56
+ | [Ruins, rocks & paved roads](https://enestaylan.github.io/roamwright/examples/ruins.html?seed=42) | Hilltop ruins, buried-town mounds, bedded outcrops, a paved arch highway with cedar avenue and a flagstone plaza. | [ruins.js](examples/ruins.js) |
57
+ | [World map and wayfinding](https://enestaylan.github.io/roamwright/examples/world-map.html?seed=42) | Shaded atlas relief, baked terrain sheets, collision-free lettering, interactive pan/zoom/tap and a live compass strip. | [world-map.js](examples/world-map.js) |
57
58
 
58
59
  ### Run locally
59
60
 
@@ -0,0 +1,162 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta name="theme-color" content="#152c2c" />
7
+ <title>World map and wayfinding · Roamwright</title>
8
+ <link rel="stylesheet" href="./showcase.css" />
9
+ <style>
10
+ aside#wayfinding {
11
+ position: absolute;
12
+ top: 56px;
13
+ left: 50%;
14
+ transform: translateX(-50%);
15
+ z-index: 2;
16
+ display: flex;
17
+ flex-direction: column;
18
+ align-items: center;
19
+ gap: 4px;
20
+ pointer-events: none;
21
+ }
22
+ #compass {
23
+ position: relative;
24
+ width: min(360px, 76vw);
25
+ height: 28px;
26
+ overflow: hidden;
27
+ border: 1px solid #f7edcf48;
28
+ border-radius: 0.45rem;
29
+ background: #0f2324d8;
30
+ }
31
+ #compass-strip {
32
+ position: absolute;
33
+ top: 0;
34
+ left: 0;
35
+ height: 100%;
36
+ will-change: transform;
37
+ }
38
+ #compass-strip span,
39
+ #compass-strip i {
40
+ position: absolute;
41
+ top: 4px;
42
+ transform: translateX(-50%);
43
+ font-size: 11px;
44
+ color: #d9e8e3;
45
+ }
46
+ #compass-strip span.c {
47
+ font-weight: 700;
48
+ color: #fff6df;
49
+ }
50
+ #compass-strip span.n {
51
+ color: #ffb25a;
52
+ }
53
+ #compass-strip i {
54
+ top: 10px;
55
+ width: 1px;
56
+ height: 6px;
57
+ background: #f7edcf55;
58
+ }
59
+ #compass-strip .mk {
60
+ position: absolute;
61
+ bottom: 2px;
62
+ width: 5px;
63
+ height: 5px;
64
+ border-radius: 50%;
65
+ background: #62e6cb;
66
+ transform: translateX(-50%);
67
+ }
68
+ #compass-strip .mk.wp {
69
+ background: #ffb25a;
70
+ }
71
+ #compass-strip .mk b {
72
+ display: none;
73
+ }
74
+ #where-line {
75
+ padding: 3px 10px;
76
+ border-radius: 0.35rem;
77
+ background: #0f2324cc;
78
+ font-size: 12px;
79
+ color: #f3ecd9;
80
+ white-space: nowrap;
81
+ }
82
+ #pick-card {
83
+ position: absolute;
84
+ right: clamp(10px, 1.8vw, 22px);
85
+ top: 62px;
86
+ z-index: 2;
87
+ max-width: 240px;
88
+ padding: 8px 11px;
89
+ border: 1px solid #f7edcf48;
90
+ border-radius: 0.45rem;
91
+ background: #0f2324e4;
92
+ color: #f3ecd9;
93
+ font-size: 12px;
94
+ pointer-events: auto;
95
+ }
96
+ #pick-card b {
97
+ display: block;
98
+ font-size: 13px;
99
+ color: #fff6df;
100
+ }
101
+ #pick-card small {
102
+ display: block;
103
+ color: #8ff0dc;
104
+ margin: 2px 0 4px;
105
+ }
106
+ #pick-card p {
107
+ margin: 0;
108
+ color: #d9e8e3;
109
+ }
110
+ </style>
111
+ <script type="importmap">
112
+ {
113
+ "imports": {
114
+ "three": "../node_modules/three/build/three.module.js",
115
+ "three/addons/": "../node_modules/three/examples/jsm/",
116
+ "roamwright": "../index.js",
117
+ "roamwright/": "../"
118
+ }
119
+ }
120
+ </script>
121
+ </head>
122
+ <body>
123
+ <canvas
124
+ tabindex="0"
125
+ aria-label="Interactive cartographic atlas and shaded terrain map with collision-free labels, signs and relief"
126
+ ></canvas>
127
+ <header>
128
+ <a class="back" href="../index.html"><span aria-hidden="true">←</span> Roamwright</a>
129
+ <div class="meta">
130
+ <a class="source" href="https://github.com/enestaylan/roamwright/blob/main/examples/world-map.js">Source</a>
131
+ <form method="get">
132
+ <label for="seed">Seed</label>
133
+ <input id="seed" name="seed" type="number" step="1" min="-2147483648" max="2147483647" value="42" required />
134
+ <button type="submit" title="Generate another archipelago" aria-label="Generate another archipelago">→</button>
135
+ </form>
136
+ </div>
137
+ </header>
138
+ <aside id="wayfinding" aria-label="Compass and whereabouts">
139
+ <div id="compass"><div id="compass-strip"></div></div>
140
+ <div id="where-line"></div>
141
+ </aside>
142
+ <aside id="pick-card" hidden aria-label="Selected place">
143
+ <b id="pick-name"></b>
144
+ <small id="pick-kind"></small>
145
+ <p id="pick-desc"></p>
146
+ </aside>
147
+ <footer>
148
+ <div class="caption">
149
+ <h1>World map and wayfinding</h1>
150
+ <p>Shaded atlas relief, baked terrain sheets, collision-free lettering, interactive pan/zoom/tap, and a live compass strip.</p>
151
+ </div>
152
+ <div class="tools">
153
+ <div class="views" role="group" aria-label="Map view">
154
+ <button type="button" data-view="atlas" aria-pressed="true">Atlas</button>
155
+ <button type="button" data-view="terrain" aria-pressed="false">Terrain sheet</button>
156
+ <button type="button" data-view="parchment" aria-pressed="false">Parchment</button>
157
+ </div>
158
+ </div>
159
+ </footer>
160
+ <script type="module" src="./world-map.js"></script>
161
+ </body>
162
+ </html>