Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomycesaille/interact-steve.js
3D WebGL stuff as html5 UI components
https://github.com/tomycesaille/interact-steve.js
threejs ui webgl
Last synced: about 2 months ago
JSON representation
3D WebGL stuff as html5 UI components
- Host: GitHub
- URL: https://github.com/tomycesaille/interact-steve.js
- Owner: TomyCesaille
- License: mit
- Created: 2020-04-11T22:45:51.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T17:59:26.000Z (about 2 years ago)
- Last Synced: 2024-11-02T07:27:00.894Z (2 months ago)
- Topics: threejs, ui, webgl
- Language: JavaScript
- Homepage: https://tomycesaille.github.io/interact-steve.js/index.html
- Size: 628 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# interact-steve.js
Various interactive components that we often miss (or not) in the greatest frameworks.
It's built on top of Three.js. Mainly a proof of concept about integrating animated 3D WebGL stuff as html5 components.## Demo
[interact-steve.js website](https://tomycesaille.github.io/interact-steve.js/index.html)
![gif](https://i.imgur.com/mZgLTsO.gif)
## Install
```html
```
## Usage
### Multi-state button
Toggle button that supports more than 2 state.
Geometry available:
- Box (6 faces)
- Tetrahedron (4 faces)
- Icosahedron (20 faces)```javascript
var canvas1 = document.getElementById("canvas1");
var state1 = document.getElementById("state1");var clickCallback1 = function (canvas, state) {
console.log(`state is ${state}`, canvas);
state1.textContent = state;
};var multiToggleButton1 = new interactsteve.multiToggleButton({
canvas: canvas1,
xSize: 50,
ySize: 50,
animationSpeed: 0.01,
geometry: "Box",
states: ["Online", "Offline"],
colors: ["#007bff", "#6c757d"],
defaultColor: theme.light,
clickCallback: clickCallback1,
});multiToggleButton1.click(); // To click using javascript.
multiToggleButton1.setState("Offline"); // To set state using javascript.
```## Dev
```bash
http-server . -p 8000 # to host the website for browsersnpm run build # to build interact-steve.js oneshot
npm run dev # to build interact-steve.js on the go
```## TODO
- [x] Host the demo website
- [ ] Add animation types with multi-toggle-button component (not only linear)
- [ ] `nextFace` setting for multi-toggle-button
- [x] default: The default order of planes in three.js meshes
- [ ] near: Next plane is the nearest one, to reduce rotations as much a possible
- [ ] random: randomly assigned for each instance
- [ ] Support more meshes with multi-toggle-button component
- [x] Box
- [x] Tetrahedron
- [x] Icosahedron <3
- [ ] Cylinder
- [ ] Dodecahedron
- [ ] Octahedron
- [ ] More components !
- [ ] User feedback (mouse hover, mouse click animation...)
- [ ] Other styling customization (texturing, shader...)
- [ ] Improve support of not-squared size
- [x] Eat more vegetables