@a2f0/skyline 0.1.6 → 0.2.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/README.md +3 -3
- package/docs/package.md +163 -25
- package/lib/skyline-package.d.ts +26 -18
- package/lib/skyline-package.js +10 -26
- package/lib/skyline-shell.d.ts +69 -0
- package/lib/skyline-shell.js +115 -0
- package/lib/skyline-three.d.ts +2 -0
- package/lib/skyline-three.js +7 -0
- package/lib/three-engine.d.ts +16 -0
- package/lib/three-engine.js +12 -0
- package/package.json +15 -4
- package/site/building-detail-page.js +16 -0
- package/site/building-detail.html +45 -38
- package/site/building-detail.js +25 -19
- package/site/index.html +21 -373
- package/site/markup.js +36 -0
- package/site/skyline-3d-page.js +12 -0
- package/site/skyline-3d.html +7 -11
- package/site/skyline-3d.js +396 -310
- package/site/skyline-shell.js +115 -0
- package/site/skyline-viewer.js +321 -0
- package/site/stars.svg +8 -6
- package/site/study-loader.js +0 -2
- package/site/study-viewer.js +94 -36
- package/site/study.css +57 -30
- package/site/three-engine.js +12 -0
- package/site/vendor/three-r186.bundle.js +4228 -0
- package/site/vendor/three-r186.js +11 -4228
- package/site/viewer-page.js +15 -0
- package/site/viewer.css +147 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { mountViewer } from "./skyline-shell.js";
|
|
2
|
+
// index.html: the site's own viewer, mounted the way a host mounts the package, through the
|
|
3
|
+
// same shell and viewer module, from the assets beside this script, with the site's toolbar
|
|
4
|
+
// along its top. Its address takes the package's options: `?embed=1` shows the viewer as a
|
|
5
|
+
// host does, without the toolbar; `?controls=open` starts the scene's bar open; and
|
|
6
|
+
// `?attribution=hidden` leaves out the OpenStreetMap credit.
|
|
7
|
+
const settings = new URLSearchParams(location.search);
|
|
8
|
+
mountViewer(document.querySelector("#viewer"), {
|
|
9
|
+
assetsUrl: new URL("./", import.meta.url),
|
|
10
|
+
title: "Chicago skyline",
|
|
11
|
+
controls: settings.get("controls") === "open" ? "open" : "closed",
|
|
12
|
+
attribution: settings.get("attribution") !== "hidden",
|
|
13
|
+
navigation: settings.get("embed") !== "1",
|
|
14
|
+
page: true,
|
|
15
|
+
});
|
package/site/viewer.css
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/* The viewer (skyline-viewer.ts), in its shadow root beside study.css: the stars, the 3D
|
|
2
|
+
skyline's place, the original drawing, the buttons between them and, on the site's own
|
|
3
|
+
index.html, its toolbar. These rules apply only inside that root. The host element sets
|
|
4
|
+
`all: initial`, so nothing the host page sets is inherited here: the viewer sets its own
|
|
5
|
+
type and colours, and lays itself out by its own size, through container queries, rather
|
|
6
|
+
than the window's. Greys only, as everywhere (tests/grayscale.test.ts). */
|
|
7
|
+
.skyline-viewer {
|
|
8
|
+
position: absolute;
|
|
9
|
+
inset: 0;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
container: viewer / size;
|
|
12
|
+
color-scheme: dark;
|
|
13
|
+
background: #000;
|
|
14
|
+
color: #fff;
|
|
15
|
+
font: 16px Georgia, "Times New Roman", serif;
|
|
16
|
+
-webkit-text-size-adjust: 100%;
|
|
17
|
+
text-size-adjust: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.stars,
|
|
21
|
+
.scene,
|
|
22
|
+
.skyline-viewer > .skyline-3d {
|
|
23
|
+
position: absolute;
|
|
24
|
+
inset: 0;
|
|
25
|
+
display: block;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
margin: 0;
|
|
29
|
+
border: 0;
|
|
30
|
+
background: transparent;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.stars {
|
|
34
|
+
z-index: 0;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.stars svg {
|
|
39
|
+
display: block;
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* The debug preview's stronger pulses, which override reduced motion (stars.svg). */
|
|
45
|
+
.stars.debug-motion .twinkle {
|
|
46
|
+
animation: star-debug var(--twinkle-duration, 53.333s) ease-in-out var(--twinkle-delay, 0s) infinite;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.scene,
|
|
50
|
+
.skyline-viewer > .skyline-3d {
|
|
51
|
+
z-index: 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.skyline-viewer > .skyline-3d {
|
|
55
|
+
display: flex;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.drawing {
|
|
59
|
+
object-fit: contain;
|
|
60
|
+
object-position: bottom;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.controls {
|
|
64
|
+
position: absolute;
|
|
65
|
+
z-index: 2;
|
|
66
|
+
top: max(12px, env(safe-area-inset-top));
|
|
67
|
+
left: 50%;
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-wrap: wrap;
|
|
70
|
+
align-items: baseline;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
gap: 10px clamp(18px, 2cqw, 28px);
|
|
73
|
+
width: max-content;
|
|
74
|
+
max-width: calc(100% - 24px);
|
|
75
|
+
transform: translateX(-50%);
|
|
76
|
+
color: #fff;
|
|
77
|
+
font-size: clamp(18px, 1.85cqw, 26px);
|
|
78
|
+
line-height: 1;
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.controls button,
|
|
83
|
+
.controls a {
|
|
84
|
+
appearance: none;
|
|
85
|
+
margin: 0;
|
|
86
|
+
border: 0;
|
|
87
|
+
border-radius: 0;
|
|
88
|
+
padding: 0;
|
|
89
|
+
background: transparent;
|
|
90
|
+
color: inherit;
|
|
91
|
+
font: inherit;
|
|
92
|
+
line-height: inherit;
|
|
93
|
+
text-decoration: underline;
|
|
94
|
+
text-decoration-thickness: 1px;
|
|
95
|
+
text-underline-offset: 3px;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
opacity: 0.88;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.controls button:hover,
|
|
101
|
+
.controls a:hover,
|
|
102
|
+
.controls button:focus-visible,
|
|
103
|
+
.controls a:focus-visible,
|
|
104
|
+
.controls button[aria-pressed="true"] {
|
|
105
|
+
color: #fff;
|
|
106
|
+
opacity: 1;
|
|
107
|
+
text-decoration-thickness: 2px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.controls button:focus-visible,
|
|
111
|
+
.controls a:focus-visible {
|
|
112
|
+
outline: 1px solid #fff;
|
|
113
|
+
outline-offset: 6px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.original-return {
|
|
117
|
+
position: absolute;
|
|
118
|
+
z-index: 2;
|
|
119
|
+
right: max(12px, env(safe-area-inset-right));
|
|
120
|
+
bottom: max(5px, env(safe-area-inset-bottom));
|
|
121
|
+
border: 1px solid #393939;
|
|
122
|
+
border-radius: 2px;
|
|
123
|
+
padding: 5px 8px;
|
|
124
|
+
background: #101010;
|
|
125
|
+
color: #aaa;
|
|
126
|
+
font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.original-return:hover { color: #fff; border-color: #999; background: #202020; }
|
|
131
|
+
.original-return:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }
|
|
132
|
+
|
|
133
|
+
.motion-status {
|
|
134
|
+
flex-basis: 100%;
|
|
135
|
+
margin: 0;
|
|
136
|
+
color: #999;
|
|
137
|
+
font: 12px/1.5 system-ui, sans-serif;
|
|
138
|
+
text-align: center;
|
|
139
|
+
white-space: normal;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@container viewer (max-width: 520px) {
|
|
143
|
+
.controls {
|
|
144
|
+
top: max(16px, env(safe-area-inset-top));
|
|
145
|
+
gap: 10px 18px;
|
|
146
|
+
}
|
|
147
|
+
}
|