pindo 5.1.1 → 5.1.3

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,433 @@
1
+ /* 预览页面的样式代码 */
2
+ * {
3
+ box-sizing: border-box;
4
+ margin: 0;
5
+ padding: 0;
6
+ }
7
+
8
+ body {
9
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
10
+ line-height: 1.6;
11
+ color: #333;
12
+ background-color: #f5f5f7;
13
+ overflow-x: hidden;
14
+ }
15
+
16
+ .container {
17
+ display: flex;
18
+ flex-direction: column;
19
+ height: 100vh;
20
+ }
21
+
22
+ .header {
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: space-between;
26
+ padding: 10px 20px;
27
+ background-color: #fff;
28
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
29
+ z-index: 100;
30
+ min-height: 60px;
31
+ }
32
+
33
+ .logo-container {
34
+ display: flex;
35
+ align-items: center;
36
+ }
37
+
38
+ .logo {
39
+ width: 30px;
40
+ height: 30px;
41
+ margin-right: 10px;
42
+ }
43
+
44
+ .logo-text {
45
+ font-size: 1.2rem;
46
+ font-weight: 600;
47
+ color: #333;
48
+ }
49
+
50
+ .controls {
51
+ display: flex;
52
+ align-items: center;
53
+ gap: 15px;
54
+ }
55
+
56
+ .device-select {
57
+ position: relative;
58
+ z-index: 200;
59
+ }
60
+
61
+ .select-button {
62
+ display: flex;
63
+ align-items: center;
64
+ background: #fff;
65
+ border: 1px solid #ddd;
66
+ border-radius: 4px;
67
+ padding: 8px 12px;
68
+ cursor: pointer;
69
+ min-width: 180px;
70
+ transition: all 0.2s ease;
71
+ }
72
+
73
+ .select-button:hover {
74
+ border-color: #999;
75
+ }
76
+
77
+ .select-button span {
78
+ white-space: nowrap;
79
+ overflow: hidden;
80
+ text-overflow: ellipsis;
81
+ flex: 1;
82
+ text-align: left;
83
+ font-size: 14px;
84
+ }
85
+
86
+ .caret-icon {
87
+ border-style: solid;
88
+ border-width: 5px 5px 0 5px;
89
+ border-color: #666 transparent transparent transparent;
90
+ margin-left: 10px;
91
+ transition: transform 0.2s ease;
92
+ }
93
+
94
+ .caret-icon.up {
95
+ transform: rotate(180deg);
96
+ }
97
+
98
+ .device-select-dropdown {
99
+ position: absolute;
100
+ top: 100%;
101
+ left: 0;
102
+ width: 100%;
103
+ background: #fff;
104
+ border: 1px solid #ddd;
105
+ border-radius: 0 0 4px 4px;
106
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
107
+ max-height: 0;
108
+ overflow-y: auto;
109
+ opacity: 0;
110
+ transition: all 0.3s ease;
111
+ z-index: 150;
112
+ pointer-events: none;
113
+ }
114
+
115
+ .device-select-dropdown.active {
116
+ max-height: 400px;
117
+ opacity: 1;
118
+ pointer-events: all;
119
+ }
120
+
121
+ .device-group-header {
122
+ padding: 8px 12px;
123
+ background: #f0f0f0;
124
+ font-weight: 600;
125
+ color: #333;
126
+ font-size: 14px;
127
+ border-top: 1px solid #ddd;
128
+ border-bottom: 1px solid #ddd;
129
+ }
130
+
131
+ .device-option {
132
+ padding: 8px 12px;
133
+ cursor: pointer;
134
+ font-size: 14px;
135
+ transition: background 0.2s ease;
136
+ }
137
+
138
+ .device-option:hover {
139
+ background: #f0f0f0;
140
+ }
141
+
142
+ .buttons {
143
+ display: flex;
144
+ gap: 10px;
145
+ }
146
+
147
+ .btn {
148
+ background: #fff;
149
+ border: 1px solid #ddd;
150
+ border-radius: 4px;
151
+ padding: 8px 12px;
152
+ cursor: pointer;
153
+ display: flex;
154
+ align-items: center;
155
+ transition: all 0.2s ease;
156
+ }
157
+
158
+ .btn:hover {
159
+ border-color: #999;
160
+ background: #f9f9f9;
161
+ }
162
+
163
+ .btn svg {
164
+ width: 16px;
165
+ height: 16px;
166
+ fill: #666;
167
+ }
168
+
169
+ .main-content {
170
+ flex: 1;
171
+ overflow-y: auto;
172
+ display: flex;
173
+ justify-content: center;
174
+ align-items: flex-start;
175
+ padding: 20px;
176
+ position: relative;
177
+ }
178
+
179
+ .device-container {
180
+ margin-top: 20px;
181
+ position: relative;
182
+ transition: all 0.3s ease;
183
+ display: flex;
184
+ flex-direction: column;
185
+ align-items: center;
186
+ }
187
+
188
+ /* 横屏模式下的设备容器 */
189
+ .device-container.landscape {
190
+ margin: 80px 20px;
191
+ transform-origin: center center;
192
+ }
193
+
194
+ /* 旋转设备框架 */
195
+ .device-frame.landscape {
196
+ transform: rotate(-90deg);
197
+ transform-origin: center center;
198
+ }
199
+
200
+ /* 横屏模式时交换设备框架宽高 */
201
+ .device-container.landscape .device-frame {
202
+ width: var(--device-height, 667px);
203
+ height: var(--device-width, 375px);
204
+ }
205
+
206
+ /* iframe不需要旋转,只需要交换宽高比例 */
207
+ #device-frame.landscape #preview-frame {
208
+ transform: rotate(90deg);
209
+ transform-origin: center center;
210
+ width: 100%;
211
+ height: 100%;
212
+ position: relative;
213
+ }
214
+
215
+ /* 基本iframe样式 */
216
+ #preview-frame {
217
+ border: none;
218
+ width: 100%;
219
+ height: 100%;
220
+ display: block;
221
+ }
222
+
223
+ /* 设备框架基本样式 */
224
+ .device-frame {
225
+ border: 12px solid #333;
226
+ border-radius: 30px;
227
+ background: #fff;
228
+ position: relative;
229
+ overflow: hidden;
230
+ transition: all 0.3s ease;
231
+ box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
232
+ }
233
+
234
+ .dimensions-display {
235
+ position: absolute;
236
+ bottom: -30px;
237
+ left: 50%;
238
+ transform: translateX(-50%);
239
+ background: rgba(0, 0, 0, 0.6);
240
+ color: #fff;
241
+ padding: 5px 10px;
242
+ border-radius: 15px;
243
+ font-size: 12px;
244
+ white-space: nowrap;
245
+ }
246
+
247
+ /* 顶部尺寸显示样式 */
248
+ #header-dimensions-display {
249
+ position: static;
250
+ transform: none;
251
+ background: #fff;
252
+ color: #666;
253
+ border: 1px solid #ddd;
254
+ border-radius: 4px;
255
+ padding: 8px 12px;
256
+ }
257
+
258
+ /* 设备框架下方的尺寸显示 */
259
+ #frame-dimensions-display {
260
+ bottom: -30px;
261
+ left: 50%;
262
+ transform: translateX(-50%);
263
+ }
264
+
265
+ .current-device {
266
+ position: absolute;
267
+ top: -30px;
268
+ left: 0;
269
+ font-size: 14px;
270
+ color: #666;
271
+ }
272
+
273
+ .loading {
274
+ position: absolute;
275
+ top: 0;
276
+ left: 0;
277
+ right: 0;
278
+ bottom: 0;
279
+ background: rgba(255, 255, 255, 0.8);
280
+ display: flex;
281
+ justify-content: center;
282
+ align-items: center;
283
+ z-index: 100;
284
+ display: none;
285
+ }
286
+
287
+ .spinner {
288
+ width: 40px;
289
+ height: 40px;
290
+ border: 4px solid rgba(0, 0, 0, 0.1);
291
+ border-left-color: #333;
292
+ border-radius: 50%;
293
+ animation: spin 1s linear infinite;
294
+ }
295
+
296
+ @keyframes spin {
297
+ to {
298
+ transform: rotate(360deg);
299
+ }
300
+ }
301
+
302
+ .custom-dimensions {
303
+ position: absolute;
304
+ top: 0;
305
+ left: 0;
306
+ width: 100%;
307
+ background: #fff;
308
+ border: 1px solid #ddd;
309
+ border-radius: 4px;
310
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
311
+ padding: 15px;
312
+ z-index: 100;
313
+ max-height: 0;
314
+ overflow: hidden;
315
+ opacity: 0;
316
+ transition: all 0.3s ease;
317
+ pointer-events: none;
318
+ }
319
+
320
+ .custom-dimensions.active {
321
+ max-height: 200px;
322
+ opacity: 1;
323
+ pointer-events: all;
324
+ }
325
+
326
+ .custom-dimensions h3 {
327
+ margin-bottom: 15px;
328
+ font-size: 16px;
329
+ }
330
+
331
+ .dimensions-input {
332
+ display: flex;
333
+ gap: 10px;
334
+ margin-bottom: 15px;
335
+ }
336
+
337
+ .input-group {
338
+ display: flex;
339
+ flex-direction: column;
340
+ flex: 1;
341
+ }
342
+
343
+ .input-group label {
344
+ font-size: 14px;
345
+ margin-bottom: 5px;
346
+ color: #666;
347
+ }
348
+
349
+ .input-group input {
350
+ padding: 8px;
351
+ border: 1px solid #ddd;
352
+ border-radius: 4px;
353
+ font-size: 14px;
354
+ }
355
+
356
+ .dimensions-actions {
357
+ display: flex;
358
+ justify-content: flex-end;
359
+ }
360
+
361
+ .dimensions-actions button {
362
+ padding: 8px 16px;
363
+ background: #4170FF;
364
+ color: white;
365
+ border: none;
366
+ border-radius: 4px;
367
+ cursor: pointer;
368
+ font-size: 14px;
369
+ transition: background 0.2s ease;
370
+ }
371
+
372
+ .dimensions-actions button:hover {
373
+ background: #2C5CD9;
374
+ }
375
+
376
+ /* 媒体查询,响应式调整 */
377
+ @media (max-width: 768px) {
378
+ .header {
379
+ flex-direction: column;
380
+ padding: 10px;
381
+ gap: 10px;
382
+ }
383
+
384
+ .controls {
385
+ width: 100%;
386
+ justify-content: space-between;
387
+ }
388
+
389
+ .device-select {
390
+ flex: 1;
391
+ max-width: 50%;
392
+ }
393
+
394
+ .buttons {
395
+ gap: 5px;
396
+ }
397
+
398
+ .btn {
399
+ padding: 6px 8px;
400
+ }
401
+
402
+ .select-button {
403
+ padding: 6px 8px;
404
+ min-width: auto;
405
+ }
406
+
407
+ .device-frame {
408
+ border-width: 8px;
409
+ border-radius: 20px;
410
+ }
411
+
412
+ #header-dimensions-display {
413
+ padding: 6px 8px;
414
+ font-size: 12px;
415
+ }
416
+ }
417
+
418
+ /* 针对小屏幕的优化 */
419
+ @media (max-width: 480px) {
420
+ .main-content {
421
+ padding: 10px 5px;
422
+ }
423
+
424
+ .device-container {
425
+ margin-top: 10px;
426
+ }
427
+
428
+ .device-frame {
429
+ border-width: 6px;
430
+ border-radius: 15px;
431
+ max-width: calc(100vw - 20px);
432
+ }
433
+ }
@@ -0,0 +1,73 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>WebGL预览</title>
7
+ <link rel="stylesheet" href="preview.css">
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+ <div class="header">
12
+ <div class="logo-container">
13
+ <div class="logo-text">WebGL预览</div>
14
+ </div>
15
+ <div class="controls">
16
+ <div class="device-select">
17
+ <div class="select-button" id="device-select-button">
18
+ <span id="current-device-name">iPhone 8 Plus</span>
19
+ <div class="caret-icon"></div>
20
+ </div>
21
+ <div class="device-select-dropdown" id="device-select-dropdown">
22
+ <!-- 这里的设备选项会通过JavaScript动态生成 -->
23
+ </div>
24
+ <div class="custom-dimensions" id="custom-dimensions">
25
+ <h3>自定义尺寸</h3>
26
+ <div class="dimensions-input">
27
+ <div class="input-group">
28
+ <label for="width-input">宽度 (px)</label>
29
+ <input type="number" id="width-input" value="375" min="200" max="2560">
30
+ </div>
31
+ <div class="input-group">
32
+ <label for="height-input">高度 (px)</label>
33
+ <input type="number" id="height-input" value="667" min="200" max="2560">
34
+ </div>
35
+ </div>
36
+ <div class="dimensions-actions">
37
+ <button id="apply-dimensions">应用尺寸</button>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ <div id="header-dimensions-display" class="dimensions-display">375 × 667</div>
42
+ <div class="buttons">
43
+ <button class="btn" id="rotate-button" title="旋转屏幕">
44
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
45
+ <path d="M7.34 6.41L.86 12.9l6.49 6.48 6.49-6.48-6.5-6.49zM3.69 12.9l3.66-3.66L11 12.9l-3.66 3.66-3.65-3.66zm15.67-6.26C17.61 4.88 15.3 4 13 4V.76L8.76 5 13 9.24V6c1.79 0 3.58.68 4.95 2.05 2.73 2.73 2.73 7.17 0 9.9C16.58 19.32 14.79 20 13 20c-.97 0-1.94-.21-2.84-.61l-1.49 1.49C10.02 21.62 11.51 22 13 22c2.3 0 4.61-.88 6.36-2.64 3.52-3.51 3.52-9.21 0-12.72z"/>
46
+ </svg>
47
+ </button>
48
+ <button class="btn" id="fullscreen-button" title="全屏预览">
49
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
50
+ <path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/>
51
+ </svg>
52
+ </button>
53
+ </div>
54
+ </div>
55
+ </div>
56
+
57
+ <div class="main-content">
58
+ <div id="device-container" class="device-container">
59
+ <div id="device-frame" class="device-frame">
60
+ <!-- iframe的src属性会被后端替换 -->
61
+ <iframe id="preview-frame" src="./rawindex.html"></iframe>
62
+ </div>
63
+ <div id="frame-dimensions-display" class="dimensions-display">375 × 667</div>
64
+ <div id="loading" class="loading">
65
+ <div class="spinner"></div>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ </div>
70
+
71
+ <script src="preview.js"></script>
72
+ </body>
73
+ </html>