perfect-gui 4.11.8 → 4.11.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perfect-gui",
3
- "version": "4.11.8",
3
+ "version": "4.11.9",
4
4
  "description": "GUI for JavaScript",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -0,0 +1,27 @@
1
+ import GUI from '../index.js';
2
+
3
+ /*
4
+ GUI.prototype.materialFolder = materialFolder;
5
+ gui.materialFolder({name: 'material', obj: material})
6
+ */
7
+ export function materialFolder(params = {}) {
8
+ const material = params.obj;
9
+
10
+ if (material.isMeshStandardMaterial) {
11
+ console.error('[GUI materialFolder]', 'materialFolder() only works with meshStandardMaterial');
12
+ }
13
+
14
+ const folder = this.folder({ name: params.name });
15
+
16
+ folder.slider({ obj: material, prop: 'roughness' });
17
+ folder.slider({ obj: material, prop: 'metalness' });
18
+ folder.color({ name: 'color', obj: material, value: '#'+material.color.getHexString() }, val => {
19
+ material.color.set(val)
20
+ });
21
+ folder.slider({ obj: material, prop: 'envMapIntensity' });
22
+ return folder;
23
+ }
24
+
25
+ export function threejsColor() {
26
+
27
+ }
package/src/index.js CHANGED
@@ -192,6 +192,7 @@ export default class GUI {
192
192
  this.wrapper = document.createElement('div');
193
193
  this.wrapper.id = 'p-gui-'+this.instanceId;
194
194
  this.wrapper.className = 'p-gui';
195
+ this.wrapper.setAttribute('data-lenis-prevent', '');
195
196
  this.container.append(this.wrapper);
196
197
 
197
198
  this.header = document.createElement('div');