Skip to content

Commit

Permalink
feat: add option SPLAT_COUNT, closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
cloydlau committed Sep 29, 2023
1 parent 44d34d6 commit 1e6f2e9
Show file tree
Hide file tree
Showing 5 changed files with 458 additions and 12 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 align="center">
<a href="https://npmjs.com/package/webgl-fluid" target="_blank" rel="noopener noreferrer">
WebGL Fluid <sup><img alt="version" src="https://versionbadg.es/cloydlau/webgl-fluid.svg"></sup>
WebGL Fluid <sup><img alt="version" src="https://img.shields.io/npm/v/webgl-fluid.svg?style=flat-square&color=white&label="></sup>
</a>
</h1>

Expand All @@ -24,6 +24,7 @@
- Hover to activate by default, can also be Click
- Background image
- Control whether to trigger multiple random splats initially
- Control initial splats count

<br>

Expand Down Expand Up @@ -109,6 +110,7 @@ WebGLFluid(document.querySelector('canvas'), {
CURL: 30,
SPLAT_RADIUS: 0.35,
SPLAT_FORCE: 6000,
SPLAT_COUNT: parseInt(Math.random() * 20) + 5, // Initial splats count (when IMMEDIATE is set to true)
SHADING: true,
COLORFUL: true,
COLOR_UPDATE_SPEED: 10,
Expand Down
21 changes: 14 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
],
"exports": {
".": {
"require": "./dist/webgl-fluid.umd.js",
"import": "./dist/webgl-fluid.mjs"
"import": "./dist/webgl-fluid.mjs",
"require": "./dist/webgl-fluid.umd.js"
},
"./*": "./*"
},
Expand All @@ -31,25 +31,32 @@
"docs"
],
"scripts": {
"dev": "vite --open",
"build": "vite build",
"serve": "vite preview",
"doc": "vitepress dev --open /README",
"release": "npx lint-staged && pnpm build && cl release"
"release": "esno ./scripts/release.mts",
"preinstall": "node -e \"if (process.env.INIT_CWD === process.cwd()) { process.exit(1) }\" || npx only-allow pnpm",
"postinstall": "node -e \"if (process.env.INIT_CWD === process.cwd()) { process.exit(1) }\" || npx simple-git-hooks"
},
"devDependencies": {
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"case-police": "latest",
"cross-spawn": "latest",
"del": "latest",
"husky": "latest",
"kolorist": "latest",
"lint-staged": "latest",
"prompts": "latest",
"semver": "latest",
"simple-git-hooks": "latest",
"vite": "latest",
"vitepress": "latest"
},
"simple-git-hooks": {
"commit-msg": "npx --no -- commitlint --edit ${1}"
},
"lint-staged": {
"*.md": "case-police --fix"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
}
}
Loading

0 comments on commit 1e6f2e9

Please sign in to comment.