MikaFil commited on
Commit
85d0d45
·
verified ·
1 Parent(s): 5897e52

Update style/defaults/style.css

Browse files
Files changed (1) hide show
  1. style/defaults/style.css +40 -319
style/defaults/style.css CHANGED
@@ -1,274 +1,56 @@
1
- /* viewer.css */
2
-
3
- /* Widget container styling */
4
- .ply-widget-container {
5
- position: relative;
6
- width: 100%;
7
- height: 0; /* Height: 0 so padding-bottom controls the aspect ratio */
8
- background-color: white;
9
- transition: all 0.3s ease;
10
- box-sizing: border-box;
11
- overflow: hidden;
12
- }
13
-
14
- /* When in fake fullscreen mode (iOS fallback) */
15
- .ply-widget-container.fake-fullscreen {
16
- position: fixed !important;
17
- top: 0 !important;
18
- left: 0 !important;
19
- width: 100vw !important;
20
- height: 100vh !important;
21
- padding-bottom: 0 !important;
22
- z-index: 9999 !important;
23
- background-color: black;
24
- border-radius: 0 !important;
25
- margin: 0 !important;
26
- max-width: 100vw !important;
27
- max-height: 100vh !important;
28
- box-sizing: border-box;
29
- overflow: hidden;
30
- }
31
-
32
- /* For native fullscreen - ensure no aspect ratio padding */
33
- .ply-widget-container:fullscreen {
34
- width: 100vw !important;
35
- height: 100vh !important;
36
- padding-bottom: 0 !important;
37
- border-radius: 0 !important;
38
- background-color: black;
39
- }
40
-
41
- /* Vendor prefixes for fullscreen */
42
- .ply-widget-container:-webkit-full-screen {
43
- width: 100vw !important;
44
- height: 100vh !important;
45
- padding-bottom: 0 !important;
46
- border-radius: 0 !important;
47
- background-color: black;
48
- }
49
- .ply-widget-container:-moz-full-screen {
50
- width: 100vw !important;
51
- height: 100vh !important;
52
- padding-bottom: 0 !important;
53
- border-radius: 0 !important;
54
- background-color: black;
55
- }
56
- .ply-widget-container:-ms-fullscreen {
57
- width: 100vw !important;
58
- height: 100vh !important;
59
- padding-bottom: 0 !important;
60
- border-radius: 0 !important;
61
- background-color: black;
62
- }
63
-
64
- /* Viewer Container styling */
65
- .viewer-container {
66
- display: none;
67
- position: absolute;
68
- top: 0;
69
- left: 0;
70
- right: 0;
71
- bottom: 0;
72
- width: 100%;
73
- height: 100%;
74
- background: black;
75
- border: 1px solid #474558;
76
- border-radius: 10px;
77
- overflow: hidden;
78
- box-sizing: border-box;
79
- transition: all 0.3s ease;
80
- min-height: 100%;
81
- object-fit: contain;
82
- }
83
-
84
- /* When parent container is fullscreen, adjust viewer container */
85
- .fake-fullscreen .viewer-container,
86
- :fullscreen .viewer-container,
87
- :-webkit-full-screen .viewer-container,
88
- :-moz-full-screen .viewer-container,
89
- :-ms-fullscreen .viewer-container {
90
- border-radius: 0;
91
- border: none;
92
- width: 100%;
93
- height: 100%;
94
- }
95
-
96
- /* Canvas fills the viewer container */
97
- .ply-canvas {
98
- width: 100%;
99
- height: 100%;
100
- display: block;
101
- background-color: transparent;
102
- z-index: 1;
103
- position: absolute;
104
- top: 0;
105
- left: 0;
106
- right: 0;
107
- bottom: 0;
108
- }
109
-
110
- /* Make sure canvas fills entire space in fullscreen */
111
- .fake-fullscreen .ply-canvas,
112
- :fullscreen .ply-canvas,
113
- :-webkit-full-screen .ply-canvas,
114
- :-moz-full-screen .ply-canvas,
115
- :-ms-fullscreen .ply-canvas {
116
- width: 100vw;
117
- height: 100vh;
118
- }
119
-
120
- /* Progress dialog styling (centered) */
121
- .progress-dialog {
122
- position: absolute;
123
- top: 50%;
124
- left: 50%;
125
- transform: translate(-50%, -50%);
126
- border: none;
127
- background: rgba(0,0,0,0.7);
128
- padding: 20px;
129
- border-radius: 5px;
130
- z-index: 1000;
131
- display: none;
132
- color: white;
133
- }
134
-
135
- /* Progress bar styling */
136
- progress {
137
- width: 250px;
138
- height: 15px;
139
- appearance: none;
140
- border: none;
141
- border-radius: 10px;
142
- overflow: hidden;
143
- }
144
- progress::-webkit-progress-bar {
145
- background-color: #333;
146
- border-radius: 10px;
147
- }
148
- progress::-webkit-progress-value {
149
- background-color: #4682B4;
150
- border-radius: 10px;
151
- }
152
- progress::-moz-progress-bar {
153
- background-color: #4682B4;
154
- border-radius: 10px;
155
- }
156
-
157
- /* Menu (instructions) content styling */
158
- .menu-content {
159
- display: none;
160
- position: absolute;
161
- top: 50%;
162
- left: 50%;
163
- transform: translate(-50%, -50%);
164
- background: rgba(242,240,239,0.9); /* #F2F0EF at 90% opacity */
165
- color: #545454;
166
- border: 1px solid #ddd;
167
- border-radius: 10px;
168
- padding: 18px 24px;
169
- font-size: 15px;
170
- line-height: 1.4;
171
- box-shadow: none;
172
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
173
- z-index: 1010;
174
- }
175
-
176
- /* Help-close button inside instructions panel */
177
- .help-close {
178
- position: absolute;
179
- top: 8px;
180
- right: 8px;
181
- background-color: #B0B0B0;
182
- color: #333;
183
- border: none;
184
- border-radius: 4px;
185
- width: 24px;
186
- height: 24px;
187
- line-height: 24px;
188
- text-align: center;
189
- cursor: pointer;
190
- font-size: 16px;
191
- }
192
-
193
- /* Button styling with improved visibility and spacing tweaks */
194
- .widget-button {
195
- position: absolute;
196
- width: 32px; /* Reduced by 30% from 45px */
197
- height: 32px; /* Reduced by 30% */
198
- background-color: #F2F0EF;
199
- border: 1px solid #ccc;
200
- border-radius: 8px;
201
- cursor: pointer;
202
- font-size: 16px;
203
- color: #545454;
204
- display: flex !important;
205
- align-items: center;
206
- justify-content: center;
207
- transition: background-color 0.2s ease;
208
- z-index: 1000;
209
- opacity: 1 !important;
210
- visibility: visible !important;
211
- margin-right: 8px; /* Tighter gap between buttons */
212
- }
213
- .widget-button:hover {
214
- background-color: rgba(242,240,239,0.7);
215
- }
216
-
217
- /* Specific button positions (tighter spacing) */
218
- .fullscreen-toggle {
219
- top: 12px;
220
- right: 12px;
221
- }
222
- .help-toggle {
223
- top: 12px;
224
- right: 52px;
225
- font-size: 18px;
226
- }
227
- .reset-camera-btn {
228
- top: 12px;
229
- right: 92px;
230
- font-size: 18px;
231
- line-height: normal;
232
- padding: 0;
233
- }
234
- .tooltips-toggle {
235
- top: 12px;
236
- right: 132px;
237
- font-size: 18px;
238
- }
239
-
240
- /* Ensure buttons remain visible in fullscreen */
241
- .fake-fullscreen .widget-button,
242
- :fullscreen .widget-button,
243
- :-webkit-full-screen .widget-button,
244
- :-moz-full-screen .widget-button,
245
- :-ms-fullscreen .widget-button {
246
- z-index: 10000;
247
- }
248
-
249
- /* Tooltip panel styling */
250
  .tooltip-panel {
251
  position: absolute;
252
  top: 50%;
253
  right: 5%;
254
  transform: translate(0%, -50%);
255
- background: rgba(242,240,239,0.9);
256
  color: #545454;
257
  border: 1px solid #ddd;
258
  border-radius: 6px;
259
  padding: 15px;
260
- max-width: 300px;
 
 
 
261
  z-index: 20000;
262
  display: none;
263
  flex-direction: column;
264
  align-items: flex-start;
265
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
 
 
266
  }
 
267
  .tooltip-content {
268
  position: relative;
269
  width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  }
271
- /* --- FIX: Perfectly center the tooltip close button (×) on all devices --- */
 
272
  .tooltip-close {
273
  position: absolute;
274
  top: -8px;
@@ -278,89 +60,28 @@ progress::-moz-progress-bar {
278
  border-radius: 50%;
279
  width: 20px;
280
  height: 20px;
281
-
282
- /* New for centering: */
283
  display: flex;
284
  align-items: center;
285
  justify-content: center;
286
  padding: 0;
287
  line-height: normal;
288
  vertical-align: middle;
289
-
290
  text-align: center;
291
  cursor: pointer;
292
  font-weight: bold;
 
293
  }
294
- .tooltip-text {
295
- margin-bottom: 10px;
296
- font-size: 14px;
297
- line-height: 1.4;
298
- }
299
  .tooltip-image {
300
  max-width: 100%;
 
301
  border-radius: 4px;
302
  margin-top: 5px;
303
- }
304
-
305
- /* --- Mobile adjustments: when the widget container has the "mobile" class --- */
306
- .ply-widget-container.mobile .widget-button {
307
- width: 24px; /* 32px * 0.75 */
308
- height: 24px; /* 32px * 0.75 */
309
- font-size: 12px; /* 16px * 0.75 */
310
- }
311
- .ply-widget-container.mobile .help-toggle {
312
- font-size: 14px;
313
- }
314
- .ply-widget-container.mobile .fullscreen-toggle {
315
- top: 8px;
316
- right: 8px;
317
- }
318
- .ply-widget-container.mobile .help-toggle {
319
- top: 8px;
320
- right: 40px;
321
- }
322
- .ply-widget-container.mobile .reset-camera-btn {
323
- top: 8px;
324
- right: 72px;
325
- }
326
- .ply-widget-container.mobile .tooltips-toggle {
327
- top: 8px;
328
- right: 104px;
329
- }
330
-
331
- /* Additional styles for PlayCanvas compatibility */
332
- #application-canvas {
333
- width: 100%;
334
- height: 100%;
335
  display: block;
336
  }
337
- html, body {
338
- margin: 0;
339
- padding: 0;
340
- height: 100%;
341
- }
342
-
343
- /* Error message styling */
344
- .progress-dialog p {
345
- margin: 0;
346
- padding: 5px;
347
- }
348
-
349
- /* --------------------------------------------------------------------------- */
350
- /* NEW MOBILE RULES — ensure instructions panel fits on phones */
351
- /* --------------------------------------------------------------------------- */
352
  @media (max-width: 600px) {
353
- .menu-content {
354
- width: 85vw; /* 80-90 % of viewport width */
355
- max-height: 55vh; /* ~half the screen tall */
356
- overflow-y: auto; /* scroll if content longer */
357
- padding: 40px 18px 14px;/* ↑ 40 px top pushes text below close btn */
358
- font-size: 14px;
359
- }
360
-
361
- /* keep the close button clearly inside the panel */
362
- .menu-content .help-close {
363
- top: 6px;
364
- right: 6px;
365
  }
366
  }
 
1
+ /* Tooltip panel styling: always fits inside viewer */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  .tooltip-panel {
3
  position: absolute;
4
  top: 50%;
5
  right: 5%;
6
  transform: translate(0%, -50%);
7
+ background: rgba(242,240,239,0.97);
8
  color: #545454;
9
  border: 1px solid #ddd;
10
  border-radius: 6px;
11
  padding: 15px;
12
+ max-width: 92vw; /* Never exceed viewport width */
13
+ max-height: 90vh; /* Never exceed 90% of viewer */
14
+ min-width: 180px;
15
+ min-height: 60px;
16
  z-index: 20000;
17
  display: none;
18
  flex-direction: column;
19
  align-items: flex-start;
20
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
21
+ overflow: auto; /* Scroll for overflow! */
22
+ box-sizing: border-box;
23
  }
24
+
25
  .tooltip-content {
26
  position: relative;
27
  width: 100%;
28
+ min-width: 160px;
29
+ max-width: 100%;
30
+ box-sizing: border-box;
31
+ }
32
+
33
+ /* Mobile fix: make sure tooltip fits vertically and horizontally */
34
+ @media (max-width: 600px) {
35
+ .tooltip-panel {
36
+ top: auto;
37
+ bottom: 8px;
38
+ right: 3vw;
39
+ left: 3vw;
40
+ transform: none;
41
+ width: auto;
42
+ max-width: 94vw;
43
+ min-width: 0;
44
+ max-height: 60vh;
45
+ padding: 12px;
46
+ font-size: 13.5px;
47
+ }
48
+ .tooltip-content {
49
+ min-width: 0;
50
+ }
51
  }
52
+
53
+ /* Always keep the close button visible */
54
  .tooltip-close {
55
  position: absolute;
56
  top: -8px;
 
60
  border-radius: 50%;
61
  width: 20px;
62
  height: 20px;
 
 
63
  display: flex;
64
  align-items: center;
65
  justify-content: center;
66
  padding: 0;
67
  line-height: normal;
68
  vertical-align: middle;
 
69
  text-align: center;
70
  cursor: pointer;
71
  font-weight: bold;
72
+ z-index: 2;
73
  }
74
+
75
+ /* Tooltip image: never overflow panel */
 
 
 
76
  .tooltip-image {
77
  max-width: 100%;
78
+ max-height: 220px; /* limits tall images on mobile */
79
  border-radius: 4px;
80
  margin-top: 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  display: block;
82
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  @media (max-width: 600px) {
84
+ .tooltip-image {
85
+ max-height: 30vh;
 
 
 
 
 
 
 
 
 
 
86
  }
87
  }