Skip to content

Commit

Permalink
snap: cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Exr0n committed May 14, 2022
1 parent dc3fdb3 commit f6ecf13
Show file tree
Hide file tree
Showing 10 changed files with 1,173 additions and 672 deletions.
4 changes: 2 additions & 2 deletions old/meshwave-pack/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl Lines {
.dyn_into::<web_sys::CanvasRenderingContext2d>()
.unwrap();

ctx.set_fill_style( &JsValue::from_str(&format!("#326ccc")));
ctx.set_fill_style( &JsValue::from_str(&format!("#3d86ff")));

ctx.clear_rect(0., 0., size_w, size_h);

Expand All @@ -103,7 +103,7 @@ impl Lines {
let noise_y = self.noise.get([x/NOISE_SCALE, y/NOISE_SCALE, -pos*CHANGE_SPEED])
as f64 * NOISE_RANGE;

ctx.fill_rect(x + noise_x, y + noise_y, 1., 1.);
ctx.fill_rect(x + noise_x, y + noise_y, 3., 3.);
}
}
}
Expand Down
74 changes: 38 additions & 36 deletions old/meshwave-pack/www/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div align="center">

<h1><code>create-wasm-app</code></h1>
<h1><code>wasm-pack-template</code></h1>

<strong>An <code>npm init</code> template for kick starting a project that uses NPM packages containing Rust-generated WebAssembly and bundles them with Webpack.</strong>
<strong>A template for kick starting a Rust and WebAssembly project using <a href="https://github.com/rustwasm/wasm-pack">wasm-pack</a>.</strong>

<p>
<a href="https://travis-ci.org/rustwasm/create-wasm-app"><img src="https://img.shields.io/travis/rustwasm/create-wasm-app.svg?style=flat-square" alt="Build Status" /></a>
<a href="https://travis-ci.org/rustwasm/wasm-pack-template"><img src="https://img.shields.io/travis/rustwasm/wasm-pack-template.svg?style=flat-square" alt="Build Status" /></a>
</p>

<h3>
<a href="#usage">Usage</a>
<a href="https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html">Tutorial</a>
<span> | </span>
<a href="https://discordapp.com/channels/442252698964721669/443151097398296587">Chat</a>
</h3>
Expand All @@ -19,49 +19,51 @@

## About

This template is designed for depending on NPM packages that contain
Rust-generated WebAssembly and using them to create a Website.
[**📚 Read this template tutorial! 📚**][template-docs]

* Want to create an NPM package with Rust and WebAssembly? [Check out
`wasm-pack-template`.](https://github.com/rustwasm/wasm-pack-template)
* Want to make a monorepo-style Website without publishing to NPM? Check out
[`rust-webpack-template`](https://github.com/rustwasm/rust-webpack-template)
and/or
[`rust-parcel-template`](https://github.com/rustwasm/rust-parcel-template).
This template is designed for compiling Rust libraries into WebAssembly and
publishing the resulting package to NPM.

Be sure to check out [other `wasm-pack` tutorials online][tutorials] for other
templates and usages of `wasm-pack`.

[tutorials]: https://rustwasm.github.io/docs/wasm-pack/tutorials/index.html
[template-docs]: https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html

## 🚴 Usage

### 🐑 Use `cargo generate` to Clone this Template

[Learn more about `cargo generate` here.](https://github.com/ashleygwilliams/cargo-generate)

```
npm init wasm-app
cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project
cd my-project
```

## 🔋 Batteries Included
### 🛠️ Build with `wasm-pack build`

- `.gitignore`: ignores `node_modules`
- `LICENSE-APACHE` and `LICENSE-MIT`: most Rust projects are licensed this way, so these are included for you
- `README.md`: the file you are reading now!
- `index.html`: a bare bones html document that includes the webpack bundle
- `index.js`: example js file with a comment showing how to import and use a wasm pkg
- `package.json` and `package-lock.json`:
- pulls in devDependencies for using webpack:
- [`webpack`](https://www.npmjs.com/package/webpack)
- [`webpack-cli`](https://www.npmjs.com/package/webpack-cli)
- [`webpack-dev-server`](https://www.npmjs.com/package/webpack-dev-server)
- defines a `start` script to run `webpack-dev-server`
- `webpack.config.js`: configuration file for bundling your js with webpack
```
wasm-pack build
```

## License
### 🔬 Test in Headless Browsers with `wasm-pack test`

Licensed under either of
```
wasm-pack test --headless --firefox
```

* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
### 🎁 Publish to NPM with `wasm-pack publish`

at your option.
```
wasm-pack publish
```

### Contribution
## 🔋 Batteries Included

Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual licensed as above, without any additional terms or
conditions.
* [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) for communicating
between WebAssembly and JavaScript.
* [`console_error_panic_hook`](https://github.com/rustwasm/console_error_panic_hook)
for logging panic messages to the developer console.
* [`wee_alloc`](https://github.com/rustwasm/wee_alloc), an allocator optimized
for small code size.
6 changes: 6 additions & 0 deletions old/meshwave-pack/www/meshwave.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* tslint:disable */
/* eslint-disable */
/**
* @returns {number}
*/
export function greet(): number;
2 changes: 2 additions & 0 deletions old/meshwave-pack/www/meshwave.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import * as wasm from "./meshwave_bg.wasm";
export * from "./meshwave_bg.js";
Loading

0 comments on commit f6ecf13

Please sign in to comment.