perfect-gui 4.9.8 → 4.10.0

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.
@@ -0,0 +1,63 @@
1
+ export default /* css */ `
2
+ .p-gui__vector2 {
3
+ background: transparent;
4
+ aspect-ratio: 1;
5
+ padding-bottom: 0;
6
+ color: var(--color-text-dark);
7
+ }
8
+
9
+ .p-gui__vector2:hover {
10
+ color: var(--color-text-light);
11
+ }
12
+
13
+ .p-gui__vector2-area {
14
+ position: relative;
15
+ background: rgba(0, 0, 0, .3);
16
+ margin-top: 8px;
17
+ width: 100%;
18
+ height: calc(100% - 28px);
19
+ touch-action: none;
20
+ }
21
+
22
+ .p-gui__vector2-line {
23
+ position: absolute;
24
+ background: white;
25
+ opacity: .3;
26
+ pointer-events: none;
27
+ }
28
+
29
+ .p-gui__vector2-line-x {
30
+ width: 100%;
31
+ height: 1px;
32
+ left: 0;
33
+ top: 50%;
34
+ transform: translateY(-50%);
35
+ }
36
+
37
+ .p-gui__vector2-line-y {
38
+ width: 1px;
39
+ height: 100%;
40
+ top: 0;
41
+ left: 50%;
42
+ transform: translateX(-50%);
43
+ }
44
+
45
+ .p-gui__vector2-dot {
46
+ position: absolute;
47
+ top: 0;
48
+ left: 0;
49
+ width: 8px;
50
+ height: 8px;
51
+ border-radius: 50%;
52
+ background: #d5d5d5;
53
+ border: 2px solid #ff9999;
54
+ transform: translate(-50%, -50%);
55
+ pointer-events: none;
56
+ }
57
+
58
+ .p-gui__vector-value {
59
+ display: inline-block;
60
+ right: 7px;
61
+ position: absolute;
62
+ }
63
+ `;
@@ -0,0 +1,156 @@
1
+ import _button from "./_button"
2
+ import _slider from "./_slider"
3
+ import _list from "./_list"
4
+ import _switch from "./_switch"
5
+ import _color from "./_color"
6
+ import _vector2 from "./_vector2"
7
+ import _image from "./_image"
8
+ import _folder from "./_folder"
9
+
10
+ /**
11
+ * JS instead of CSS to avoid
12
+ * depending on a css loader
13
+ */
14
+
15
+ export default function( position_type ) {
16
+ return /* css */`
17
+ .p-gui {
18
+ --main-border-radius: 5px;
19
+ --color-bg: #121212;
20
+ --color-border: #484848;
21
+ --color-border-2: rgba(255,255,255,.1);
22
+ --color-text-light: #ffffff;
23
+ --color-text-dark: #bbbbbb;
24
+ --color-accent: #1681ca;
25
+ --color-accent-hover: #218fda;
26
+ --transition: .1s linear;
27
+
28
+ position: ${ position_type };
29
+ top: 0;
30
+ left: 0;
31
+ transform: translate3d(0,0,0);
32
+ padding-top: 21px;
33
+ padding-inline: 3px;
34
+ background: var(--color-bg);
35
+ display: block;
36
+ justify-content: center;
37
+ flex-wrap: wrap;
38
+ font-family: "Arial Rounded MT Bold", Arial, sans-serif;
39
+ width: 290px;
40
+ overflow: auto;
41
+ box-shadow: 0 0 2px black;
42
+ box-sizing: border-box;
43
+ z-index: 99999;
44
+ user-select: none;
45
+ border-bottom-right-radius: 3px;
46
+ border-bottom-left-radius: 3px;
47
+ cursor: auto;
48
+ border-radius: var(--main-border-radius);
49
+ border: 1px solid var(--color-border);
50
+ line-height: normal;
51
+ }
52
+
53
+ .p-gui * {
54
+ font-size: 11px;
55
+ }
56
+
57
+ .p-gui::-webkit-scrollbar,
58
+ .p-gui *::-webkit-scrollbar {
59
+ width: 10px;
60
+ }
61
+
62
+ .p-gui::-webkit-scrollbar-track,
63
+ .p-gui *::-webkit-scrollbar-track {
64
+ background: #2f2f2f;
65
+ border-radius: 3px;
66
+ }
67
+
68
+ .p-gui::-webkit-scrollbar-thumb,
69
+ .p-gui *::-webkit-scrollbar-thumb {
70
+ background: #757576;
71
+ border-radius: 10px;
72
+ box-sizing: border-box;
73
+ border: 1px solid #2f2f2f;
74
+ }
75
+
76
+ .p-gui--collapsed {
77
+ height: 0;
78
+ padding: 21px 10px 0 10px;
79
+ overflow: hidden;
80
+ }
81
+
82
+ .p-gui__header {
83
+ position: absolute;
84
+ top: 0;
85
+ left: 0;
86
+ width: 100%;
87
+ height: 20px;
88
+ background-color: rgba(0, 0, 0, .8);
89
+ cursor: grab;
90
+ color: grey;
91
+ font-size: 10px;
92
+ line-height: 20px;
93
+ padding-left: 12px;
94
+ box-sizing: border-box;
95
+ touch-action: none;
96
+ }
97
+
98
+ .p-gui__header-close {
99
+ width: 20px;
100
+ height: 20px;
101
+ position: absolute;
102
+ top: 0;
103
+ right: 5px;
104
+ cursor: pointer;
105
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUAQMAAAC3R49OAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAABFJREFUCNdjIAb8//8BjIkAAOrOBd3TR0jRAAAAAElFTkSuQmCC);
106
+ background-size: 50% 50%;
107
+ background-position: center;
108
+ background-repeat: no-repeat;
109
+ }
110
+
111
+ .p-gui--collapsed .p-gui__header-close {
112
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUAQMAAAC3R49OAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAABVJREFUCNdjYEhgIIj///8AwsSoBQD43QydY5mb0QAAAABJRU5ErkJggg==);
113
+ }
114
+
115
+ .p-gui__slider,
116
+ .p-gui__button,
117
+ .p-gui__switch,
118
+ .p-gui__list,
119
+ .p-gui__vector2,
120
+ .p-gui__color {
121
+ width: 100%;
122
+ padding: 7px;
123
+ cursor: pointer;
124
+ position: relative;
125
+ box-sizing: border-box;
126
+ margin-block: 3px;
127
+ border: 1px solid var(--color-border-2);
128
+ border-radius: var(--main-border-radius);
129
+ transition: var(--transition) border-color;
130
+ }
131
+
132
+ .p-gui__slider:hover,
133
+ .p-gui__button:hover,
134
+ .p-gui__switch:hover,
135
+ .p-gui__list:hover,
136
+ .p-gui__vector2:hover,
137
+ .p-gui__color:hover {
138
+ border-color: rgba(255,255,255,.2);
139
+ }
140
+
141
+ ${ _button }
142
+
143
+ ${ _image }
144
+
145
+ ${ _list }
146
+
147
+ ${ _switch }
148
+
149
+ ${ _slider }
150
+
151
+ ${ _color }
152
+
153
+ ${ _vector2 }
154
+
155
+ ${ _folder }
156
+ `};
package/src/styles.js DELETED
@@ -1,421 +0,0 @@
1
- /**
2
- * JS instead of CSS to avoid
3
- * depending on a css loader
4
- */
5
-
6
- export default function( position_type ) {
7
- return /* css */`
8
- .p-gui {
9
- --main-border-radius: 5px;
10
- --color-bg: #121212;
11
- --color-border: #484848;
12
- --color-border-2: rgba(255,255,255,.1);
13
- --color-accent: #1681ca;
14
- --color-accent-hover: #218fda;
15
-
16
- position: ${ position_type };
17
- top: 0;
18
- left: 0;
19
- transform: translate3d(0,0,0);
20
- padding-top: 21px;
21
- background: var(--color-bg);
22
- display: flex;
23
- justify-content: center;
24
- flex-wrap: wrap;
25
- font-family: Verdana, Arial, sans-serif;
26
- width: 290px;
27
- overflow: auto;
28
- box-shadow: 0 0 2px black;
29
- box-sizing: border-box;
30
- z-index: 99999;
31
- user-select: none;
32
- border-bottom-right-radius: 3px;
33
- border-bottom-left-radius: 3px;
34
- cursor: auto;
35
- border-radius: var(--main-border-radius);
36
- border: 1px solid var(--color-border);
37
- line-height: normal;
38
- }
39
-
40
- .p-gui * {
41
- font-size: 11px;
42
- }
43
-
44
- .p-gui::-webkit-scrollbar,
45
- .p-gui *::-webkit-scrollbar {
46
- width: 10px;
47
- }
48
-
49
- .p-gui::-webkit-scrollbar-track,
50
- .p-gui *::-webkit-scrollbar-track {
51
- background: #2f2f2f;
52
- border-radius: 3px;
53
- }
54
-
55
- .p-gui::-webkit-scrollbar-thumb,
56
- .p-gui *::-webkit-scrollbar-thumb {
57
- background: #757576;
58
- border-radius: 10px;
59
- box-sizing: border-box;
60
- border: 1px solid #2f2f2f;
61
- }
62
-
63
- .p-gui--collapsed {
64
- height: 0;
65
- padding: 21px 10px 0 10px;
66
- overflow: hidden;
67
- }
68
-
69
- .p-gui__header {
70
- position: absolute;
71
- top: 0;
72
- left: 0;
73
- width: 100%;
74
- height: 20px;
75
- background-color: rgba(0, 0, 0, .8);
76
- cursor: grab;
77
- color: grey;
78
- font-size: 10px;
79
- line-height: 20px;
80
- padding-left: 12px;
81
- box-sizing: border-box;
82
- touch-action: none;
83
- }
84
-
85
- .p-gui__header-close {
86
- width: 20px;
87
- height: 20px;
88
- position: absolute;
89
- top: 0;
90
- right: 5px;
91
- cursor: pointer;
92
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUAQMAAAC3R49OAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAABFJREFUCNdjIAb8//8BjIkAAOrOBd3TR0jRAAAAAElFTkSuQmCC);
93
- background-size: 50% 50%;
94
- background-position: center;
95
- background-repeat: no-repeat;
96
- }
97
-
98
- .p-gui--collapsed .p-gui__header-close {
99
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUAQMAAAC3R49OAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAABVJREFUCNdjYEhgIIj///8AwsSoBQD43QydY5mb0QAAAABJRU5ErkJggg==);
100
- }
101
-
102
- .p-gui__image-container {
103
- width: 100%;
104
- padding: 3px;
105
- display: flex;
106
- justify-content: flex-start;
107
- flex-wrap: wrap;
108
- }
109
-
110
- .p-gui__image {
111
- background-size: cover;
112
- cursor: pointer;
113
- position: relative;
114
- margin: 1px 2.5px 19px 2.5px;
115
- border-radius: var(--main-border-radius);
116
- flex: 0 0 calc(33.333% - 5px);
117
- height: 90px;
118
- background-position: center;
119
- }
120
-
121
- .p-gui__image--selected::after {
122
- position: absolute;
123
- top: 0;
124
- left: 0;
125
- width: 100%;
126
- height: 100%;
127
- content: '';
128
- border: 1px solid #06FF89;
129
- box-sizing: border-box;
130
- border-radius: var(--main-border-radius);
131
- }
132
-
133
- .p-gui__image-text {
134
- position: absolute;
135
- bottom: -15px;
136
- color: #eee;
137
- text-shadow: 0 -1px 0 #111;
138
- white-space: nowrap;
139
- width: 100%;
140
- overflow: hidden;
141
- text-overflow: ellipsis;
142
- }
143
-
144
- .p-gui__button,
145
- .p-gui__switch,
146
- .p-gui__list,
147
- .p-gui__vector2,
148
- .p-gui__color {
149
- width: 100%;
150
- padding: 7px 13px;
151
- color: white;
152
- cursor: pointer;
153
- position: relative;
154
- box-sizing: border-box;
155
- margin-bottom: 3px;
156
- margin: 3px;
157
-
158
- border: 1px solid var(--color-border-2);
159
- border-radius: var(--main-border-radius);
160
- }
161
-
162
- .p-gui__vector2 {
163
- padding: 7px;
164
- }
165
-
166
- .p-gui__button,
167
- .p-gui__switch {
168
- margin-right: 4px;
169
- margin-left: 4px;
170
- }
171
-
172
- .p-gui__button {
173
- background: var(--color-accent);
174
- text-align: center;
175
- color: white;
176
- border: none;
177
- }
178
-
179
- .p-gui__button:hover {
180
- background: var(--color-accent-hover);
181
- }
182
-
183
- .p-gui__switch {
184
- background: rgba(255, 255, 255, .05);
185
- }
186
-
187
- .p-gui__switch:hover {
188
- background: rgba(255, 255, 255, .1);
189
- }
190
-
191
- .p-gui__folder .p-gui__button,
192
- .p-gui__folder .p-gui__switch {
193
- margin-right: 0;
194
- margin-left: 0;
195
- }
196
-
197
- .p-gui__vector2 {
198
- background: transparent;
199
- aspect-ratio: 1;
200
- padding-bottom: 0;
201
- }
202
-
203
- .p-gui__vector2-area {
204
- position: relative;
205
- background: rgba(0, 0, 0, .3);
206
- margin-top: 8px;
207
- width: 100%;
208
- height: calc(100% - 28px);
209
- touch-action: none;
210
- }
211
-
212
- .p-gui__vector2-line {
213
- position: absolute;
214
- background: white;
215
- opacity: .3;
216
- pointer-events: none;
217
- }
218
-
219
- .p-gui__vector2-line-x {
220
- width: 100%;
221
- height: 1px;
222
- left: 0;
223
- top: 50%;
224
- transform: translateY(-50%);
225
- }
226
-
227
- .p-gui__vector2-line-y {
228
- width: 1px;
229
- height: 100%;
230
- top: 0;
231
- left: 50%;
232
- transform: translateX(-50%);
233
- }
234
-
235
- .p-gui__vector2-dot {
236
- position: absolute;
237
- top: 0;
238
- left: 0;
239
- width: 8px;
240
- height: 8px;
241
- border-radius: 50%;
242
- background: #d5d5d5;
243
- border: 2px solid #ff9999;
244
- transform: translate(-50%, -50%);
245
- pointer-events: none;
246
- }
247
-
248
- .p-gui__switch-checkbox {
249
- width: 5px;
250
- height: 5px;
251
- background-color: rgba(0, 0, 0, .5);
252
- border: 1px solid grey;
253
- position: absolute;
254
- top: 0;
255
- right: 10px;
256
- bottom: 0;
257
- margin: auto;
258
- border-radius: 50%;
259
- pointer-events: none;
260
- }
261
-
262
- .p-gui__switch-checkbox--active {
263
- background-color: #00ff89;
264
- box-shadow: 0 0 7px #00ff89;
265
- }
266
-
267
- .p-gui__list,
268
- .p-gui__color {
269
- cursor: default;
270
- }
271
-
272
- .p-gui__list-dropdown,
273
- .p-gui__color-picker {
274
- position: absolute;
275
- right: 5px;
276
- top: 0;
277
- bottom: 0;
278
- margin: auto;
279
- height: 21px;
280
- cursor: pointer;
281
- border-radius: 3px;
282
- border: 1px solid var(--color-border-2);
283
- outline: none;
284
- }
285
-
286
- .p-gui__list-dropdown {
287
- background: rgba(255, 255, 255,.05);
288
- color: white;
289
- padding: 0 12px;
290
- top: 0px;
291
- }
292
-
293
- .p-gui__list-dropdown:hover {
294
- background: rgba(255, 255, 255, .1);
295
- }
296
-
297
- .p-gui__color-picker {
298
- -webkit-appearance: none;
299
- padding: 0;
300
- background-color: transparent;
301
- border: 1px solid #222222;
302
- overflow: hidden;
303
- }
304
-
305
- .p-gui__color-picker::-webkit-color-swatch-wrapper {
306
- padding: 0;
307
- }
308
- .p-gui__color-picker::-webkit-color-swatch {
309
- border: none;
310
- }
311
-
312
- .p-gui__slider {
313
- box-sizing: border-box;
314
- width: calc(100% - 10px);
315
- margin: 0 auto 10px auto;
316
- padding: 7px 0;
317
- color: white;
318
- position: relative;
319
- min-height: 14px;
320
- }
321
-
322
- .p-gui__slider-ctrl {
323
- -webkit-appearance: none;
324
- padding: 0;
325
- font: inherit;
326
- outline: none;
327
- opacity: .8;
328
- background: var(--color-accent);
329
- box-sizing: border-box;
330
- cursor: pointer;
331
- position: absolute;
332
- bottom: -4px; /* 5px height -1px de dépassement du curseur */
333
- right: 0;
334
- height: 5px;
335
- width: 100%;
336
- margin: 0;
337
- border-radius: var(--main-border-radius);
338
- }
339
-
340
- /* la zone de déplacement */
341
- .p-gui__slider-ctrl::-webkit-slider-runnable-track {
342
- height: 13px;
343
- border: none;
344
- border-radius: 0;
345
- background-color: transparent; /* supprimé définie sur l'input */
346
- }
347
-
348
- /* Curseur */
349
- .p-gui__slider-ctrl::-webkit-slider-thumb {
350
- -webkit-appearance: none; /* également nécessaire sur le curseur */
351
- width: 15px;
352
- height: 7px;
353
- border: none; /* pris en compte sur Webkit et Edge */
354
- background: white; /* pris en compte sur Webkit only */
355
- position: relative;
356
- top: 3px;
357
- border-radius: 1px;
358
- }
359
-
360
- .p-gui__slider-value,
361
- .p-gui__vector-value {
362
- display: inline-block;
363
- position: absolute;
364
- right: 7px;
365
- }
366
-
367
- .p-gui__folder {
368
- width: 100%;
369
- position: relative;
370
- background: #434343;
371
- overflow: auto;
372
- margin-bottom: 3px;
373
- display: flex;
374
- flex-wrap: wrap;
375
- border: 1px solid grey;
376
- padding: 0 3px 3px 3px;
377
- border-radius: var(--main-border-radius);
378
- }
379
-
380
- .p-gui__folder:last-of-type {
381
- margin-bottom: 0;
382
- border-bottom: none;
383
- }
384
-
385
- .p-gui__folder--first {
386
- margin-top: 0;
387
- }
388
-
389
- .p-gui__folder--closed {
390
- height: 32px;
391
- overflow: hidden;
392
- }
393
-
394
- .p-gui__folder-header {
395
- padding: 10px 5px;
396
- background-color: rgba(0, 0, 0, .5);
397
- color: white;
398
- cursor: pointer;
399
- width: 100%;
400
- margin: 0 -2px 2px -3px;
401
- }
402
-
403
- .p-gui__folder-header:hover {
404
- background-color: rgba(0, 0, 0, .75);
405
- }
406
-
407
- .p-gui__folder-arrow {
408
- width: 8px;
409
- height: 8px;
410
- display: inline-block;
411
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAHlBMVEUAAAD///////////////////////////////////8kfJuVAAAACXRSTlMA9Z1fCdMo1yxEJnA0AAAAK0lEQVQI12PABlRgjKkJUMZMYRhjpgqMAZSEMICSaIzpDWiKhdENhEhgAgATSg5jyWnYewAAAABJRU5ErkJggg==);
412
- background-size: contain;
413
- margin-right: 5px;
414
- transform: rotate(90deg)
415
- }
416
-
417
- .p-gui__folder--closed .p-gui__folder-arrow {
418
- transform: rotate(0deg);
419
- }
420
- `
421
- };