-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
look I'm a web developer now
- Loading branch information
Showing
11 changed files
with
8,124 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: wasm-demo build | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./wasm-demo | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Install wasm target | ||
run: rustup target add wasm32-unknown-unknown | ||
- name: Install npm dependencies | ||
run: npm install | ||
- name: Check Prettier | ||
run: npx prettier . --check | ||
- name: Build wasm-demo | ||
run: npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ members = [ | |
"viewer", | ||
"workspace-hack", | ||
] | ||
exclude = ["wasm-demo"] | ||
|
||
[profile.release] | ||
debug = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
pkg | ||
dist | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "fidget-wasm-demo" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
fidget = {path = "../fidget", default-features = false, features = ["rhai", "mesh", "render"]} | ||
wasm-bindgen = "0.2.92" | ||
|
||
# Take advantage of feature unification to turn on wasm-bindgen here | ||
rhai = { version = "*", features = ["wasm-bindgen"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<html> | ||
<head> | ||
<style> | ||
div#editor { | ||
height: 512; | ||
width: 100%; | ||
display: block; | ||
outline: 1px solid #bbb; | ||
} | ||
div#output-outer { | ||
width: 100%; | ||
display: block; | ||
margin-top: 10px; | ||
outline: 1px solid #bbb; | ||
} | ||
div#canvascol { | ||
width: 100%; | ||
padding-right: 10px; | ||
} | ||
canvas#glcanvas { | ||
display: block; | ||
margin-left: 10px; | ||
aspect-ratio: 1; | ||
max-height: 512px; | ||
width: calc(min(100%, 512px)); | ||
outline: 1px solid #bbb; | ||
} | ||
span#status { | ||
display: block; | ||
margin-left: 10px; | ||
margin-top: 15px; | ||
font-family: monospace; | ||
} | ||
.row { | ||
display: flex; | ||
} | ||
.column { | ||
flex: 50%; | ||
} | ||
</style> | ||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" /> | ||
</head> | ||
<body> | ||
<div class="row"> | ||
<div class="column"> | ||
<div id="editor-outer"></div> | ||
<div id="output-outer"></div> | ||
</div> | ||
<div class="column" id="canvascol"> | ||
<canvas id="glcanvas" width="512" height="512"></canvas> | ||
<span id="status">Loading...</span> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.