wgsl-edit 0.0.4 → 0.0.7
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.
|
@@ -1 +0,0 @@
|
|
|
1
|
-
body{margin:0;padding:20px;font-family:system-ui,sans-serif;transition:background .2s,color .2s}body.dark{background:#1e1e1e;color:#ccc}body.light{background:#fff;color:#333}.titles{display:flex;gap:32px}.titles h1:first-child{flex:1;text-align:center}.titles h1:last-child{width:min(60vh,50%);text-align:center}h1,h2{margin-top:0;font-family:ui-monospace,Cascadia Code,Fira Code,Menlo,monospace;font-weight:600}#theme-toggle{position:fixed;top:16px;right:16px;background:none;border:none;cursor:pointer;padding:6px;border-radius:8px;color:inherit;opacity:.7;transition:opacity .2s}#theme-toggle:hover{opacity:1}#theme-toggle svg{display:block}#theme-toggle .sun,#theme-toggle .moon{display:none}body.light #theme-toggle .moon,body.dark #theme-toggle .sun{display:block}.editor-player{display:flex;gap:32px;height:60vh}wgsl-edit{flex:1}wgsl-play{aspect-ratio:1;width:min(60vh,50%);align-self:start}.usage{margin-top:48px}.usage pre{padding:16px 20px;border-radius:8px;overflow-x:auto;font-family:ui-monospace,Cascadia Code,Fira Code,Menlo,monospace;font-size:14px;line-height:1.5}body.light .usage pre{background:#f5f5f5;color:#333}body.dark .usage pre{background:#2a2a2a;color:#ccc}.docs-links{margin-top:24px;display:flex;align-items:baseline;font-size:18px}.docs-links h2{margin:0}.docs-links nav{display:flex;gap:40px;margin-left:100px}body.dark .docs-links a{color:#6cb6ff}
|
package/site/index.html
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
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.0">
|
|
6
|
-
<title>wgsl-edit test</title>
|
|
7
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism.min.css" id="prism-light">
|
|
8
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1/themes/prism-tomorrow.min.css" id="prism-dark" disabled>
|
|
9
|
-
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/prism.min.js" defer></script>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-1yVlrenS.js"></script>
|
|
11
|
-
<link rel="stylesheet" crossorigin href="/assets/index-oyrhrEUu.css">
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<button id="theme-toggle" aria-label="Toggle theme">
|
|
15
|
-
<svg class="sun" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
16
|
-
<circle cx="12" cy="12" r="5"/>
|
|
17
|
-
<line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/>
|
|
18
|
-
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>
|
|
19
|
-
<line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/>
|
|
20
|
-
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
|
|
21
|
-
</svg>
|
|
22
|
-
<svg class="moon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
23
|
-
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
|
|
24
|
-
</svg>
|
|
25
|
-
</button>
|
|
26
|
-
<div class="titles">
|
|
27
|
-
<h1>wgsl-edit</h1>
|
|
28
|
-
<h1>wgsl-play</h1>
|
|
29
|
-
</div>
|
|
30
|
-
<div class="editor-player">
|
|
31
|
-
<wgsl-edit id="editor" lint-from="player">
|
|
32
|
-
<script type="text/wesl" data-name="main.wesl">
|
|
33
|
-
import package::utils;
|
|
34
|
-
|
|
35
|
-
@group(0) @binding(0) var<uniform> u: test::Uniforms;
|
|
36
|
-
|
|
37
|
-
@fragment
|
|
38
|
-
fn main(@builtin(position) pos: vec4f) -> @location(0) vec4f {
|
|
39
|
-
let uv = pos.xy / u.resolution;
|
|
40
|
-
return vec4f(utils::gradient(uv, u.time), 1.0);
|
|
41
|
-
}
|
|
42
|
-
</script>
|
|
43
|
-
<script type="text/wesl" data-name="utils.wesl">
|
|
44
|
-
fn gradient(uv: vec2f, time: f32) -> vec3f {
|
|
45
|
-
return vec3f(uv, 0.5 + 0.5 * sin(time));
|
|
46
|
-
}
|
|
47
|
-
</script>
|
|
48
|
-
</wgsl-edit>
|
|
49
|
-
<wgsl-play id="player" source="editor"></wgsl-play>
|
|
50
|
-
</div>
|
|
51
|
-
<section class="usage">
|
|
52
|
-
<h2>Usage</h2>
|
|
53
|
-
<pre><code class="language-html"><script type="module" src="https://esm.sh/wgsl-edit"></script>
|
|
54
|
-
<script type="module" src="https://esm.sh/wgsl-play"></script>
|
|
55
|
-
|
|
56
|
-
<wgsl-edit id="editor" lint-from="player"></wgsl-edit>
|
|
57
|
-
<wgsl-play id="player" source="editor"></wgsl-play></code></pre>
|
|
58
|
-
|
|
59
|
-
<div class="docs-links">
|
|
60
|
-
<h2>Docs</h2>
|
|
61
|
-
<nav>
|
|
62
|
-
<a href="https://github.com/wgsl-tooling-wg/wesl-js/tree/main/tools/packages/wgsl-edit">wgsl-edit</a>
|
|
63
|
-
<a href="https://github.com/wgsl-tooling-wg/wesl-js/tree/main/tools/packages/wgsl-play">wgsl-play</a>
|
|
64
|
-
</nav>
|
|
65
|
-
</div>
|
|
66
|
-
</section>
|
|
67
|
-
</body>
|
|
68
|
-
</html>
|