x3d-tidy 2.2.13 → 2.2.15

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.
Files changed (2) hide show
  1. package/package.json +67 -63
  2. package/src/main.js +35 -8
package/package.json CHANGED
@@ -1,65 +1,69 @@
1
1
  {
2
- "name": "x3d-tidy",
3
- "version": "2.2.13",
4
- "description": "X3D Converter, Beautifier and Minimizer",
5
- "main": "src/main.js",
6
- "bin": {
7
- "x3d-tidy": "bin/x3d-tidy.js"
8
- },
9
- "files": [
10
- "bin/*",
11
- "src/*"
12
- ],
13
- "scripts": {
14
- "start": "node bin/x3d-tidy.js",
15
- "test": "node build/test.js",
16
- "release": "node build/release.js"
17
- },
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/create3000/x3d-tidy.git"
21
- },
22
- "keywords": [
23
- "beautifier",
24
- "Compressor",
25
- "converter",
26
- "GLB",
27
- "glTF2",
28
- "JSON",
29
- "Minimizer",
30
- "npx",
31
- "PLY",
32
- "STL",
33
- "SVG",
34
- "tidy",
35
- "VRML",
36
- "Wavefront-OBJ",
37
- "wrl",
38
- "x_ite",
39
- "X3D",
40
- "XML"
41
- ],
42
- "author": "Holger Seelig",
43
- "license": "MIT",
44
- "bugs": {
45
- "url": "https://github.com/create3000/x3d-tidy/issues"
46
- },
47
- "homepage": "https://www.npmjs.com/package/x3d-tidy",
48
- "contributors": [
49
- {
50
- "name": "Holger Seelig",
51
- "email": "holger.seelig@gmail.com",
52
- "url": "https://github.com/create3000"
53
- }
54
- ],
55
- "dependencies": {
56
- "colors": "^1.4.0",
57
- "x_ite": "^12.1.8",
58
- "x_ite-node": "^1.1.12",
59
- "x3d-traverse": "^1.0.22",
60
- "yargs": "^18.0.0"
61
- },
62
- "devDependencies": {
63
- "shell-tools": "^1.1.9"
64
- }
2
+ "name": "x3d-tidy",
3
+ "version": "2.2.15",
4
+ "description": "X3D Converter, Beautifier and Minimizer",
5
+ "main": "src/main.js",
6
+ "bin": {
7
+ "x3d-tidy": "bin/x3d-tidy.js"
8
+ },
9
+ "files": [
10
+ "bin/*",
11
+ "src/*"
12
+ ],
13
+ "scripts": {
14
+ "start": "node bin/x3d-tidy.js",
15
+ "test": "node build/test.js",
16
+ "release": "node build/release.js"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/create3000/x3d-tidy.git"
21
+ },
22
+ "keywords": [
23
+ "beautifier",
24
+ "Compressor",
25
+ "converter",
26
+ "GLB",
27
+ "glTF2",
28
+ "JSON",
29
+ "Minimizer",
30
+ "npx",
31
+ "PLY",
32
+ "STL",
33
+ "SVG",
34
+ "tidy",
35
+ "VRML",
36
+ "Wavefront-OBJ",
37
+ "wrl",
38
+ "x_ite",
39
+ "X3D",
40
+ "XML"
41
+ ],
42
+ "author": "Holger Seelig",
43
+ "license": "MIT",
44
+ "bugs": {
45
+ "url": "https://github.com/create3000/x3d-tidy/issues"
46
+ },
47
+ "homepage": "https://www.npmjs.com/package/x3d-tidy",
48
+ "contributors": [
49
+ {
50
+ "name": "Holger Seelig",
51
+ "email": "holger.seelig@gmail.com",
52
+ "url": "https://github.com/create3000"
53
+ }
54
+ ],
55
+ "funding": {
56
+ "type": "patreon",
57
+ "url": "https://patreon.com/X_ITE"
58
+ },
59
+ "dependencies": {
60
+ "colors": "^1.4.0",
61
+ "x_ite": "^12.1.9",
62
+ "x_ite-node": "^1.1.14",
63
+ "x3d-traverse": "^1.0.22",
64
+ "yargs": "^18.0.0"
65
+ },
66
+ "devDependencies": {
67
+ "shell-tools": "^1.1.9"
68
+ }
65
69
  }
package/src/main.js CHANGED
@@ -261,16 +261,38 @@ function getHTML (scene)
261
261
  <meta charset="utf-8">
262
262
  <script defer src="https://cdn.jsdelivr.net/npm/x_ite@latest/dist/x_ite.min.js"></script>
263
263
  <style>
264
+ @import url("https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400&family=Source+Sans+3:ital,wght@0,400&display=swap");
265
+
266
+ @media (prefers-color-scheme: light) {
267
+ :root {
268
+ --text-color: rgb(42, 42, 42);
269
+ --background-color: white;
270
+ --link-color: rgb(0, 86, 178);
271
+ --link-hover-color: rgb(210, 96, 58);
272
+ }
273
+ }
274
+
275
+ @media (prefers-color-scheme: dark) {
276
+ :root {
277
+ --text-color: rgb(175, 176, 177);
278
+ --background-color: rgb(27, 27, 30);
279
+ --link-color: rgb(82, 108, 150);
280
+ --link-hover-color: rgb(210, 96, 58);
281
+ }
282
+ }
283
+
264
284
  body {
265
285
  color-scheme: light dark;
286
+ box-sizing: border-box;
266
287
  display: flex;
267
288
  flex-direction: column;
268
289
  margin: 0px;
269
290
  padding: 0px;
270
291
  height: 100vh;
271
- background-color: light-dark(white, rgb(27, 27, 30));
272
- color: light-dark(rgb(42, 42, 42), rgb(175, 176, 177));
273
- font-family: sans-serif;
292
+ background-color: var(--background-color);
293
+ color: var(--text-color);
294
+ font-family: "Source Sans 3", sans-serif;
295
+ font-size: 1.08rem;
274
296
  }
275
297
 
276
298
  body > * {
@@ -278,21 +300,26 @@ body > * {
278
300
  padding: 0px 1rem;
279
301
  }
280
302
 
303
+ h1 {
304
+ font-family: Lato, sans-serif;
305
+ }
306
+
281
307
  x3d-canvas {
282
308
  flex: 1 1 auto;
283
- border-top: 2px solid light-dark(rgb(42, 42, 42), rgb(175, 176, 177));
284
- border-bottom: 2px solid light-dark(rgb(42, 42, 42), rgb(175, 176, 177));
309
+ box-sizing: border-box;
310
+ border-top: 1px solid color-mix(in srgb, var(--text-color), transparent 90%);
311
+ border-bottom: 1px solid color-mix(in srgb, var(--text-color), transparent 90%);
285
312
  padding: 0px;
286
313
  width: 100%;
287
314
  height: 100%;
288
315
  }
289
316
 
290
317
  a {
291
- color: light-dark(rgb(0, 86, 178), rgb(82, 108, 150));
318
+ color: var(--link-color);
292
319
  }
293
320
 
294
321
  a:hover {
295
- color: light-dark(rgb(210, 96, 58), rgb(210, 96, 58))
322
+ color: var(--link-hover-color);
296
323
  }
297
324
  </style>
298
325
  </head>
@@ -301,7 +328,7 @@ a:hover {
301
328
  <x3d-canvas>
302
329
  ${scene .toXMLString ({ html: true, indent: " " .repeat (6) }) .trimEnd ()}
303
330
  </x3d-canvas>
304
- <p>Made with <a href="https://www.npmjs.com/package/x3d-tidy" target="_blank">x3d-tidy.</a></p>
331
+ <p>Made with <a href="https://www.npmjs.com/package/x3d-tidy" target="_blank">x3d-tidy</a>. If local files are not loaded <a href="https://create3000.github.io/x_ite/setup-a-localhost-server">consider setup a localhost server</a> or use <a href="https://create3000.github.io/x_ite/dom-integration">DOM integration methods</a>.</p>
305
332
  </body>
306
333
  </html>`;
307
334
  }