mirror of
https://github.com/AtHeartEngineer/Animated_Background.git
synced 2026-01-09 00:17:54 -05:00
Updated transparency and did minor fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Learning Rust Wasm
|
||||
|
||||
Converting some of my [javascript code](bg.js) that makes an animated background on a canvas to Rust Wasm, mainly for learning purposes.
|
||||
[](https://github.com/AtHeartEngineer/Animated_Background/actions/workflows/pages/pages-build-deployment)
|
||||
Converting some of my [javascript code](./bg.js) that makes an animated background on a canvas to Rust Wasm, mainly for learning purposes.
|
||||
|
||||
## Install Dependencies
|
||||
|
||||
@@ -8,7 +8,7 @@ Converting some of my [javascript code](bg.js) that makes an animated background
|
||||
`cargo install wasm-pack`
|
||||
|
||||
## Build
|
||||
|
||||
`wasm-pack build`
|
||||
`npm run build`
|
||||
|
||||
## Dev
|
||||
|
||||
2
bootstrap.js
vendored
2
bootstrap.js
vendored
@@ -1,4 +1,4 @@
|
||||
import * as wasm from "./pkg/index_bg.wasm";
|
||||
import * as wasm from "./docs/index_bg.wasm";
|
||||
const DRAW_FPS = false;
|
||||
|
||||
wasm.init_panic_hook();
|
||||
|
||||
2
docs/.gitignore
vendored
2
docs/.gitignore
vendored
@@ -1 +1 @@
|
||||
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
# Learning Rust Wasm
|
||||
|
||||
Converting some of my [javascript code](bg.js) that makes an animated background on a canvas to Rust Wasm, mainly for learning purposes.
|
||||
[](https://github.com/AtHeartEngineer/Animated_Background/actions/workflows/pages/pages-build-deployment)
|
||||
Converting some of my [javascript code](./bg.js) that makes an animated background on a canvas to Rust Wasm, mainly for learning purposes.
|
||||
|
||||
## Install Dependencies
|
||||
|
||||
@@ -8,7 +8,7 @@ Converting some of my [javascript code](bg.js) that makes an animated background
|
||||
`cargo install wasm-pack`
|
||||
|
||||
## Build
|
||||
|
||||
`wasm-pack build`
|
||||
`npm run build`
|
||||
|
||||
## Dev
|
||||
|
||||
284
docs/bundle.js
284
docs/bundle.js
File diff suppressed because one or more lines are too long
@@ -419,8 +419,6 @@ export function __wbg_global_ba75c50d1cf384f4() { return handleError(function ()
|
||||
return addHeapObject(ret);
|
||||
}, arguments) };
|
||||
|
||||
export const __wbg_random_656f2ae924b2540e = typeof Math.random == 'function' ? Math.random : notDefined('Math.random');
|
||||
|
||||
export function __wbindgen_is_undefined(arg0) {
|
||||
const ret = getObject(arg0) === undefined;
|
||||
_assertBoolean(ret);
|
||||
@@ -436,6 +434,8 @@ export function __wbindgen_object_drop_ref(arg0) {
|
||||
takeObject(arg0);
|
||||
};
|
||||
|
||||
export const __wbg_random_656f2ae924b2540e = typeof Math.random == 'function' ? Math.random : notDefined('Math.random');
|
||||
|
||||
export function __wbg_error_f851667af71bcfc6() { return logError(function (arg0, arg1) {
|
||||
try {
|
||||
console.error(getStringFromWasm0(arg0, arg1));
|
||||
|
||||
Binary file not shown.
@@ -18,5 +18,8 @@
|
||||
],
|
||||
"module": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"sideEffects": false
|
||||
"sideEffects": [
|
||||
"./index.js",
|
||||
"./snippets/*"
|
||||
]
|
||||
}
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "animated-background",
|
||||
"name": "Animated_Background",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
||||
@@ -5,8 +5,8 @@ extern crate console_error_panic_hook;
|
||||
|
||||
const DENSITY: usize = 100; // lower = more dense
|
||||
const MAX_SIZE: usize = 2;
|
||||
const MIN_TRANSPARENCY: usize = 10;
|
||||
const MAX_TRANSPARENCY: usize = 60;
|
||||
const MIN_TRANSPARENCY: usize = 50;
|
||||
const MAX_TRANSPARENCY: usize = 95;
|
||||
const START_ANGLE: f64 = 4.18; // 240 degrees
|
||||
const END_ANGLE: f64 = 5.24; // 300 degrees
|
||||
const MAX_SPEED: usize = 2;
|
||||
|
||||
Reference in New Issue
Block a user