perfect-gui 3.4.3 → 3.4.5
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/README.md +4 -2
- package/package.json +1 -1
- package/src/styles.js +5 -4
- package/test/src/img/DALL/302/267E-2022-11-13-20.11.16---portrait-of-a-squirrel-in-an-officier-suit,-style-of-a-Rembrandt-painting.jpg +0 -0
- package/test/src/img/DALL/302/267E-2022-11-13-20.11.52---a-blonde-girl-riding-a-whale-in-the-style-of-hopper.jpg +0 -0
- package/test/src/img/DALL/302/267E-2022-11-13-20.13.55---1-blonde-haired-girl-with-her-orange-cat,-watching-the-whales-in-Tadoussac,-Canada.-In-the-style-of-an-oil-painting..jpg +0 -0
- package/test/src/index.js +3 -2
- package/test/src/js/basics.js +1 -0
- package/test/src/js/full_featured.js +56 -74
- package/test/src/img/metal.jpg +0 -0
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Features:
|
|
|
7
7
|
- easy positioning
|
|
8
8
|
- draggable panels
|
|
9
9
|
|
|
10
|
-
<img src="https://raw.githubusercontent.com/thibka/thibka.github.io/master/perfect-gui/_data/capture.png" width="
|
|
10
|
+
<img src="https://raw.githubusercontent.com/thibka/thibka.github.io/master/perfect-gui/_data/capture.png" width="580"/>
|
|
11
11
|
|
|
12
12
|
## Demo
|
|
13
13
|
https://thibka.github.io/perfect-gui/public/
|
|
@@ -166,4 +166,6 @@ gui.toggleClose();
|
|
|
166
166
|
|
|
167
167
|
|
|
168
168
|
## To do
|
|
169
|
-
-
|
|
169
|
+
- Color palette component
|
|
170
|
+
- Vector2 drag & drop
|
|
171
|
+
|
package/package.json
CHANGED
package/src/styles.js
CHANGED
|
@@ -18,7 +18,7 @@ return /* css */`
|
|
|
18
18
|
font-family: Verdana, Arial, sans-serif;
|
|
19
19
|
width: 290px;
|
|
20
20
|
overflow: auto;
|
|
21
|
-
box-shadow: 0 0
|
|
21
|
+
box-shadow: 0 0 5px black;
|
|
22
22
|
box-sizing: border-box;
|
|
23
23
|
z-index: 99999;
|
|
24
24
|
user-select: none;
|
|
@@ -75,7 +75,7 @@ return /* css */`
|
|
|
75
75
|
width: calc(33.33% - 10px);
|
|
76
76
|
aspect-ratio: 1 / 1;
|
|
77
77
|
background-size: cover;
|
|
78
|
-
margin:
|
|
78
|
+
margin: 1px 5px 19px 5px;
|
|
79
79
|
cursor: pointer;
|
|
80
80
|
position: relative;
|
|
81
81
|
}
|
|
@@ -184,7 +184,7 @@ return /* css */`
|
|
|
184
184
|
.p-gui__switch-checkbox {
|
|
185
185
|
width: 5px;
|
|
186
186
|
height: 5px;
|
|
187
|
-
background-color:
|
|
187
|
+
background-color: rgba(0, 0, 0, .5);
|
|
188
188
|
position: absolute;
|
|
189
189
|
top: 0;
|
|
190
190
|
right: 8px;
|
|
@@ -229,7 +229,7 @@ return /* css */`
|
|
|
229
229
|
box-sizing: border-box;
|
|
230
230
|
cursor: pointer;
|
|
231
231
|
position: absolute;
|
|
232
|
-
bottom: -5px
|
|
232
|
+
bottom: -4px; /* 5px height -1px de dépassement du curseur */
|
|
233
233
|
right: 0;
|
|
234
234
|
height: 5px;
|
|
235
235
|
width: 100%;
|
|
@@ -244,6 +244,7 @@ return /* css */`
|
|
|
244
244
|
background-color: transparent; /* supprimé définie sur l'input */
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
+
/* Curseur */
|
|
247
248
|
.p-gui__slider-ctrl::-webkit-slider-thumb {
|
|
248
249
|
-webkit-appearance: none; /* également nécessaire sur le curseur */
|
|
249
250
|
width: 15px;
|
|
Binary file
|
|
Binary file
|
package/test/src/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import './styles/main.scss';
|
|
2
|
-
import
|
|
3
|
-
//import full_featured_gui from './js/full_featured';
|
|
2
|
+
import full_featured from './js/full_featured';
|
|
4
3
|
import basics from './js/basics';
|
|
5
4
|
import vectors from './js/vectors';
|
|
6
5
|
import multiple from './js/multiple';
|
|
@@ -8,6 +7,8 @@ import folders from './js/folders';
|
|
|
8
7
|
import other from './js/other';
|
|
9
8
|
import kill_create from './js/kill_create';
|
|
10
9
|
|
|
10
|
+
//full_featured();
|
|
11
|
+
|
|
11
12
|
basics();
|
|
12
13
|
|
|
13
14
|
vectors();
|
package/test/src/js/basics.js
CHANGED
|
@@ -1,84 +1,66 @@
|
|
|
1
|
+
// <div id="container-0" class="container" style="height: 800px; border-radius: 0;"></div>
|
|
1
2
|
|
|
3
|
+
import GUI from '../../../src/index';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
5
|
+
export default function()
|
|
6
|
+
{
|
|
7
|
+
const element = document.querySelector('#container-0 .element');
|
|
8
|
+
const note = document.querySelector('#container-0 .note');
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
full_featured_gui.container.style.backgroundColor = `none`;
|
|
15
|
-
document.getElementById('note').textContent = "Photo by Joel Filipe on Unsplash";
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
full_featured_gui.image(
|
|
19
|
-
'Background 2',
|
|
20
|
-
'https://images.unsplash.com/photo-1535370976884-f4376736ab06?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=768&q=80',
|
|
21
|
-
() => {
|
|
22
|
-
full_featured_gui.container.style.backgroundImage = `url(https://images.unsplash.com/photo-1535370976884-f4376736ab06?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=564&q=80)`;
|
|
23
|
-
full_featured_gui.container.style.backgroundColor = `none`;
|
|
24
|
-
document.getElementById('note').textContent = "Photo by Richard M. on Unsplash";
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
full_featured_gui.image(
|
|
28
|
-
'Background 3',
|
|
29
|
-
'https://images.unsplash.com/photo-1524721696987-b9527df9e512?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=768&q=80',
|
|
30
|
-
() => {
|
|
31
|
-
full_featured_gui.container.style.backgroundImage = `url(https://images.unsplash.com/photo-1524721696987-b9527df9e512?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1490&q=80)`;
|
|
32
|
-
full_featured_gui.container.style.backgroundColor = `none`;
|
|
33
|
-
document.getElementById('note').textContent = "Photo by Cassi Josh on Unsplash";
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
full_featured_gui.image(
|
|
37
|
-
'Background 4',
|
|
38
|
-
'https://images.unsplash.com/photo-1574169208507-84376144848b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=768&q=80',
|
|
39
|
-
() => {
|
|
40
|
-
full_featured_gui.container.style.backgroundImage = `url(https://images.unsplash.com/photo-1574169208507-84376144848b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=768&q=80)`;
|
|
41
|
-
full_featured_gui.container.style.backgroundColor = `none`;
|
|
42
|
-
document.getElementById('note').textContent = "Photo by United States Geological Survey on Unsplash";
|
|
43
|
-
}
|
|
44
|
-
);
|
|
10
|
+
const gui = new GUI({
|
|
11
|
+
draggable: true,
|
|
12
|
+
container: '#container-0',
|
|
13
|
+
name: 'Control panel'
|
|
14
|
+
});
|
|
45
15
|
|
|
46
|
-
let folder = full_featured_gui.folder('Some folder');
|
|
47
16
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
});
|
|
17
|
+
gui.button("Randomize color", () => {
|
|
18
|
+
element.style.backgroundColor = get_random_color();
|
|
19
|
+
});
|
|
20
|
+
gui.slider({name: 'Intensity', min: .1, max: 2, value: .75, step: .01 }, (value) => {
|
|
21
|
+
element.style.transform = `scale(${value})`;
|
|
22
|
+
});
|
|
23
|
+
gui.slider({name: 'Scale', min: 0, max: 50, value: 25, step: 25 }, (value) => {
|
|
24
|
+
element.style.borderRadius = `${value}%`;
|
|
25
|
+
});
|
|
51
26
|
|
|
52
|
-
folder
|
|
53
|
-
'Background 5',
|
|
54
|
-
'https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1024&q=80',
|
|
55
|
-
() => {
|
|
56
|
-
full_featured_gui.container.style.backgroundImage = `url(https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1024&q=80)`;
|
|
57
|
-
full_featured_gui.container.style.backgroundColor = `none`;
|
|
58
|
-
document.getElementById('note').textContent = "Photo by Milad Fakurian on Unsplash";
|
|
59
|
-
}
|
|
60
|
-
);
|
|
27
|
+
let folder1 = gui.folder({name: 'Texture'});
|
|
61
28
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
29
|
+
folder1.image(
|
|
30
|
+
'The officer',
|
|
31
|
+
require('../img/DALL·E 2022-11-13 20.11.16 - portrait of a squirrel in an officier suit, style of a Rembrandt painting.png'),
|
|
32
|
+
() => {}
|
|
33
|
+
);
|
|
34
|
+
folder1.image(
|
|
35
|
+
'Weird dream',
|
|
36
|
+
require('../img/DALL·E 2022-11-13 20.11.52 - a blonde girl riding a whale in the style of hopper.png'),
|
|
37
|
+
() => {}
|
|
38
|
+
);
|
|
39
|
+
folder1.image(
|
|
40
|
+
'Friends',
|
|
41
|
+
require('../img/DALL·E 2022-11-13 20.13.55 - 1 blonde haired girl with her orange cat, watching the whales in Tadoussac, Canada. In the style of an oil painting..png'),
|
|
42
|
+
() => {}
|
|
43
|
+
);
|
|
71
44
|
|
|
72
|
-
let folder2 =
|
|
73
|
-
folder2.button("Random element color", () => {
|
|
74
|
-
element.style.backgroundColor = get_random_color();
|
|
75
|
-
});
|
|
45
|
+
let folder2 = gui.folder({name: 'Normals', closed: true});
|
|
46
|
+
folder2.button("Random element color", () => {});
|
|
76
47
|
|
|
77
|
-
|
|
78
|
-
if (!state) element.style.opacity = .5;
|
|
79
|
-
else element.style.opacity = 1;
|
|
80
|
-
});
|
|
48
|
+
gui.toggle("Rim light", true, (state) => {});
|
|
81
49
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
50
|
+
gui.toggle("Direct light", false, (state) => {});
|
|
51
|
+
|
|
52
|
+
gui.list('Preset', ['Atomic', 'pink', 'yellow', 'blue'], function(item) {});
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
let position = { x: 2, y: 1};
|
|
56
|
+
const gui2 = new GUI({
|
|
57
|
+
draggable: true,
|
|
58
|
+
container: '#container-0',
|
|
59
|
+
name: 'Position panel'
|
|
60
|
+
});
|
|
61
|
+
gui2.vector2('Position', {
|
|
62
|
+
x: {min: -10, max: 10, object: position, prop: 'x'},
|
|
63
|
+
y: {min: -10, max: 10, object: position, prop: 'y'},
|
|
64
|
+
}, () => {});
|
|
65
|
+
gui2.button('Randomize', () => {});
|
|
66
|
+
}
|
package/test/src/img/metal.jpg
DELETED
|
Binary file
|