unit.gl 0.1.2 → 0.1.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/README.md +5 -5
- package/css/unit.gl.css +253 -122
- package/css/unit.gl.min.css +1 -1
- package/js/grids.js +59 -0
- package/js/grids.js.map +1 -0
- package/js/unit.gl.js +10 -0
- package/js/unit.gl.js.map +1 -0
- package/package.json +2 -2
- package/scss/_reset.scss +15 -1
- package/scss/classes/_guide.scss +56 -54
- package/scss/classes/_index.scss +1 -5
- package/scss/classes/_ratio.scss +56 -6
- package/scss/dev/_banner.scss +0 -4
- package/scss/functions/_color.scss +1 -5
- package/scss/functions/_index.scss +0 -4
- package/scss/functions/_layer.scss +3 -6
- package/scss/functions/_ratio.scss +2 -5
- package/scss/functions/_scale.scss +8 -14
- package/scss/functions/_sequence.scss +0 -5
- package/scss/functions/_view.scss +0 -4
- package/scss/functions/math/_arithmetic.scss +12 -10
- package/scss/functions/math/_index.scss +0 -4
- package/scss/functions/unit/_index.scss +0 -4
- package/scss/functions/unit/_unit_conversion.scss +6 -30
- package/scss/functions/unit/_unit_functions.scss +2 -16
- package/scss/index.scss +12 -1
- package/scss/maps/_color.scss +1 -5
- package/scss/{variables → maps}/_device.scss +78 -73
- package/scss/maps/_index.scss +36 -5
- package/scss/{variables/_ratio.scss → maps/_interval.scss} +1 -6
- package/scss/{variables → maps}/_layer.scss +24 -20
- package/scss/{variables → maps}/_paper.scss +613 -414
- package/scss/maps/_ratio.scss +76 -0
- package/scss/maps/_scale.scss +82 -0
- package/scss/mixins/_device.scss +11 -8
- package/scss/mixins/_display.scss +35 -72
- package/scss/mixins/_guide.scss +151 -43
- package/scss/mixins/_helper.scss +2 -6
- package/scss/mixins/_index.scss +0 -4
- package/scss/mixins/_paper.scss +3 -7
- package/scss/mixins/_ratio.scss +79 -238
- package/scss/mixins/_unit.scss +1 -10
- package/scss/mixins/_view.scss +1 -5
- package/scss/tags/_index.scss +0 -4
- package/scss/tags/_unit.scss +0 -4
- package/scss/test.scss +0 -0
- package/scss/variables/_color.scss +7 -7
- package/scss/variables/_guide.scss +0 -0
- package/scss/variables/_index.scss +6 -40
- package/scss/variables/_scale.scss +4 -89
- package/scss/variables/_unit.scss +2 -5
- package/scss/variables/_view.scss +2 -7
- package/ts/grids.ts +92 -0
- package/ts/index.ts +19 -1
- package/scss/classes/_guides.scss +0 -141
- package/ts/AspectRatio.ts +0 -50
- package/ts/Border.ts +0 -60
- package/ts/BoxModel.ts +0 -68
- package/ts/FlexContainer.ts +0 -75
- package/ts/Grid.ts +0 -46
- package/ts/GridContainer.ts +0 -59
- package/ts/Layout.ts +0 -64
- package/ts/Position.ts +0 -53
- package/ts/Rectangle.ts +0 -51
- package/ts/ResponsiveImage.ts +0 -47
- package/ts/ResponsiveScale.ts +0 -44
- package/ts/Size.ts +0 -54
- package/ts/Spacing.ts +0 -106
- package/ts/Transform.ts +0 -71
- package/ts/Typography.ts +0 -75
- package/ts/Unit.ts +0 -81
- package/ts/Viewport.ts +0 -52
package/README.md
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
<div align="center">
|
|
10
10
|
|
|
11
|
-
[
|
|
12
12
|
](https://www.unit.gl)
|
|
13
|
-
[](https://www.npmjs.com/unit.gl)
|
|
14
|
+
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/stylescape/unit.gl)
|
|
15
|
+
[](https://stackblitz.com/github/stylescape/unit.gl/tree/main?file=src%2Findex.html)
|
|
16
|
+
[](https://github.com/stylescape/unit.gl/blob/main/LICENSE)
|
|
17
17
|
|
|
18
18
|
</div>
|
|
19
19
|
|
package/css/unit.gl.css
CHANGED
|
@@ -149,211 +149,342 @@ main {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
.ratio_1x1 {
|
|
152
|
+
position: relative;
|
|
153
|
+
width: 100%;
|
|
152
154
|
aspect-ratio: 1;
|
|
155
|
+
}
|
|
156
|
+
.ratio_1x1::before {
|
|
157
|
+
content: "";
|
|
158
|
+
display: block;
|
|
159
|
+
padding-top: calc(1 / 1 * 100%);
|
|
160
|
+
}
|
|
161
|
+
.ratio_1x1 > * {
|
|
162
|
+
position: absolute;
|
|
163
|
+
top: 0;
|
|
164
|
+
right: 0;
|
|
165
|
+
bottom: 0;
|
|
166
|
+
left: 0;
|
|
153
167
|
width: 100%;
|
|
154
|
-
|
|
155
|
-
overflow: hidden;
|
|
156
|
-
display: inline-block;
|
|
168
|
+
height: 100%;
|
|
157
169
|
}
|
|
158
170
|
|
|
159
171
|
.ratio_1x2 {
|
|
172
|
+
position: relative;
|
|
173
|
+
width: 100%;
|
|
160
174
|
aspect-ratio: 0.5;
|
|
175
|
+
}
|
|
176
|
+
.ratio_1x2::before {
|
|
177
|
+
content: "";
|
|
178
|
+
display: block;
|
|
179
|
+
padding-top: calc(2 / 1 * 100%);
|
|
180
|
+
}
|
|
181
|
+
.ratio_1x2 > * {
|
|
182
|
+
position: absolute;
|
|
183
|
+
top: 0;
|
|
184
|
+
right: 0;
|
|
185
|
+
bottom: 0;
|
|
186
|
+
left: 0;
|
|
161
187
|
width: 100%;
|
|
162
|
-
|
|
163
|
-
overflow: hidden;
|
|
164
|
-
display: inline-block;
|
|
188
|
+
height: 100%;
|
|
165
189
|
}
|
|
166
190
|
|
|
167
191
|
.ratio_2x1 {
|
|
192
|
+
position: relative;
|
|
193
|
+
width: 100%;
|
|
168
194
|
aspect-ratio: 2;
|
|
195
|
+
}
|
|
196
|
+
.ratio_2x1::before {
|
|
197
|
+
content: "";
|
|
198
|
+
display: block;
|
|
199
|
+
padding-top: calc(1 / 2 * 100%);
|
|
200
|
+
}
|
|
201
|
+
.ratio_2x1 > * {
|
|
202
|
+
position: absolute;
|
|
203
|
+
top: 0;
|
|
204
|
+
right: 0;
|
|
205
|
+
bottom: 0;
|
|
206
|
+
left: 0;
|
|
169
207
|
width: 100%;
|
|
170
|
-
|
|
171
|
-
overflow: hidden;
|
|
172
|
-
display: inline-block;
|
|
208
|
+
height: 100%;
|
|
173
209
|
}
|
|
174
210
|
|
|
175
211
|
.ratio_1x3 {
|
|
212
|
+
position: relative;
|
|
213
|
+
width: 100%;
|
|
176
214
|
aspect-ratio: 0.3333333333;
|
|
215
|
+
}
|
|
216
|
+
.ratio_1x3::before {
|
|
217
|
+
content: "";
|
|
218
|
+
display: block;
|
|
219
|
+
padding-top: calc(3 / 1 * 100%);
|
|
220
|
+
}
|
|
221
|
+
.ratio_1x3 > * {
|
|
222
|
+
position: absolute;
|
|
223
|
+
top: 0;
|
|
224
|
+
right: 0;
|
|
225
|
+
bottom: 0;
|
|
226
|
+
left: 0;
|
|
177
227
|
width: 100%;
|
|
178
|
-
|
|
179
|
-
overflow: hidden;
|
|
180
|
-
display: inline-block;
|
|
228
|
+
height: 100%;
|
|
181
229
|
}
|
|
182
230
|
|
|
183
231
|
.ratio_3x1 {
|
|
232
|
+
position: relative;
|
|
233
|
+
width: 100%;
|
|
184
234
|
aspect-ratio: 3;
|
|
235
|
+
}
|
|
236
|
+
.ratio_3x1::before {
|
|
237
|
+
content: "";
|
|
238
|
+
display: block;
|
|
239
|
+
padding-top: calc(1 / 3 * 100%);
|
|
240
|
+
}
|
|
241
|
+
.ratio_3x1 > * {
|
|
242
|
+
position: absolute;
|
|
243
|
+
top: 0;
|
|
244
|
+
right: 0;
|
|
245
|
+
bottom: 0;
|
|
246
|
+
left: 0;
|
|
185
247
|
width: 100%;
|
|
186
|
-
|
|
187
|
-
overflow: hidden;
|
|
188
|
-
display: inline-block;
|
|
248
|
+
height: 100%;
|
|
189
249
|
}
|
|
190
250
|
|
|
191
251
|
.ratio_1x4 {
|
|
252
|
+
position: relative;
|
|
253
|
+
width: 100%;
|
|
192
254
|
aspect-ratio: 0.25;
|
|
255
|
+
}
|
|
256
|
+
.ratio_1x4::before {
|
|
257
|
+
content: "";
|
|
258
|
+
display: block;
|
|
259
|
+
padding-top: calc(4 / 1 * 100%);
|
|
260
|
+
}
|
|
261
|
+
.ratio_1x4 > * {
|
|
262
|
+
position: absolute;
|
|
263
|
+
top: 0;
|
|
264
|
+
right: 0;
|
|
265
|
+
bottom: 0;
|
|
266
|
+
left: 0;
|
|
193
267
|
width: 100%;
|
|
194
|
-
|
|
195
|
-
overflow: hidden;
|
|
196
|
-
display: inline-block;
|
|
268
|
+
height: 100%;
|
|
197
269
|
}
|
|
198
270
|
|
|
199
271
|
.ratio_4x1 {
|
|
272
|
+
position: relative;
|
|
273
|
+
width: 100%;
|
|
200
274
|
aspect-ratio: 4;
|
|
275
|
+
}
|
|
276
|
+
.ratio_4x1::before {
|
|
277
|
+
content: "";
|
|
278
|
+
display: block;
|
|
279
|
+
padding-top: calc(1 / 4 * 100%);
|
|
280
|
+
}
|
|
281
|
+
.ratio_4x1 > * {
|
|
282
|
+
position: absolute;
|
|
283
|
+
top: 0;
|
|
284
|
+
right: 0;
|
|
285
|
+
bottom: 0;
|
|
286
|
+
left: 0;
|
|
201
287
|
width: 100%;
|
|
202
|
-
|
|
203
|
-
overflow: hidden;
|
|
204
|
-
display: inline-block;
|
|
288
|
+
height: 100%;
|
|
205
289
|
}
|
|
206
290
|
|
|
207
291
|
.ratio_3x2 {
|
|
292
|
+
position: relative;
|
|
293
|
+
width: 100%;
|
|
208
294
|
aspect-ratio: 1.5;
|
|
295
|
+
}
|
|
296
|
+
.ratio_3x2::before {
|
|
297
|
+
content: "";
|
|
298
|
+
display: block;
|
|
299
|
+
padding-top: calc(2 / 3 * 100%);
|
|
300
|
+
}
|
|
301
|
+
.ratio_3x2 > * {
|
|
302
|
+
position: absolute;
|
|
303
|
+
top: 0;
|
|
304
|
+
right: 0;
|
|
305
|
+
bottom: 0;
|
|
306
|
+
left: 0;
|
|
209
307
|
width: 100%;
|
|
210
|
-
|
|
211
|
-
overflow: hidden;
|
|
212
|
-
display: inline-block;
|
|
308
|
+
height: 100%;
|
|
213
309
|
}
|
|
214
310
|
|
|
215
311
|
.ratio_2x3 {
|
|
312
|
+
position: relative;
|
|
313
|
+
width: 100%;
|
|
216
314
|
aspect-ratio: 0.6666666667;
|
|
315
|
+
}
|
|
316
|
+
.ratio_2x3::before {
|
|
317
|
+
content: "";
|
|
318
|
+
display: block;
|
|
319
|
+
padding-top: calc(3 / 2 * 100%);
|
|
320
|
+
}
|
|
321
|
+
.ratio_2x3 > * {
|
|
322
|
+
position: absolute;
|
|
323
|
+
top: 0;
|
|
324
|
+
right: 0;
|
|
325
|
+
bottom: 0;
|
|
326
|
+
left: 0;
|
|
217
327
|
width: 100%;
|
|
218
|
-
|
|
219
|
-
overflow: hidden;
|
|
220
|
-
display: inline-block;
|
|
328
|
+
height: 100%;
|
|
221
329
|
}
|
|
222
330
|
|
|
223
331
|
.ratio_4x3 {
|
|
332
|
+
position: relative;
|
|
333
|
+
width: 100%;
|
|
224
334
|
aspect-ratio: 1.3333333333;
|
|
335
|
+
}
|
|
336
|
+
.ratio_4x3::before {
|
|
337
|
+
content: "";
|
|
338
|
+
display: block;
|
|
339
|
+
padding-top: calc(3 / 4 * 100%);
|
|
340
|
+
}
|
|
341
|
+
.ratio_4x3 > * {
|
|
342
|
+
position: absolute;
|
|
343
|
+
top: 0;
|
|
344
|
+
right: 0;
|
|
345
|
+
bottom: 0;
|
|
346
|
+
left: 0;
|
|
225
347
|
width: 100%;
|
|
226
|
-
|
|
227
|
-
overflow: hidden;
|
|
228
|
-
display: inline-block;
|
|
348
|
+
height: 100%;
|
|
229
349
|
}
|
|
230
350
|
|
|
231
351
|
.ratio_3x4 {
|
|
352
|
+
position: relative;
|
|
353
|
+
width: 100%;
|
|
232
354
|
aspect-ratio: 0.75;
|
|
355
|
+
}
|
|
356
|
+
.ratio_3x4::before {
|
|
357
|
+
content: "";
|
|
358
|
+
display: block;
|
|
359
|
+
padding-top: calc(4 / 3 * 100%);
|
|
360
|
+
}
|
|
361
|
+
.ratio_3x4 > * {
|
|
362
|
+
position: absolute;
|
|
363
|
+
top: 0;
|
|
364
|
+
right: 0;
|
|
365
|
+
bottom: 0;
|
|
366
|
+
left: 0;
|
|
233
367
|
width: 100%;
|
|
234
|
-
|
|
235
|
-
overflow: hidden;
|
|
236
|
-
display: inline-block;
|
|
368
|
+
height: 100%;
|
|
237
369
|
}
|
|
238
370
|
|
|
239
371
|
.ratio_16x9 {
|
|
240
|
-
aspect-ratio: 1.7777777778;
|
|
241
|
-
width: 100%;
|
|
242
372
|
position: relative;
|
|
243
|
-
overflow: hidden;
|
|
244
|
-
display: inline-block;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.ratio_16x10 {
|
|
248
|
-
aspect-ratio: 1.6;
|
|
249
373
|
width: 100%;
|
|
250
|
-
|
|
251
|
-
overflow: hidden;
|
|
252
|
-
display: inline-block;
|
|
374
|
+
aspect-ratio: 1.7777777778;
|
|
253
375
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
position: relative;
|
|
259
|
-
overflow: hidden;
|
|
260
|
-
display: inline-block;
|
|
376
|
+
.ratio_16x9::before {
|
|
377
|
+
content: "";
|
|
378
|
+
display: block;
|
|
379
|
+
padding-top: calc(9 / 16 * 100%);
|
|
261
380
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
381
|
+
.ratio_16x9 > * {
|
|
382
|
+
position: absolute;
|
|
383
|
+
top: 0;
|
|
384
|
+
right: 0;
|
|
385
|
+
bottom: 0;
|
|
386
|
+
left: 0;
|
|
265
387
|
width: 100%;
|
|
266
|
-
|
|
267
|
-
overflow: hidden;
|
|
268
|
-
display: inline-block;
|
|
388
|
+
height: 100%;
|
|
269
389
|
}
|
|
270
390
|
|
|
271
|
-
.
|
|
272
|
-
padding-bottom: 50%;
|
|
273
|
-
width: 100%;
|
|
391
|
+
.ratio_16x10 {
|
|
274
392
|
position: relative;
|
|
275
|
-
overflow: hidden;
|
|
276
|
-
display: inline-block;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.ratio_p_1x3 {
|
|
280
|
-
padding-bottom: 300%;
|
|
281
393
|
width: 100%;
|
|
282
|
-
|
|
283
|
-
overflow: hidden;
|
|
284
|
-
display: inline-block;
|
|
394
|
+
aspect-ratio: 1.6;
|
|
285
395
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
position: relative;
|
|
291
|
-
overflow: hidden;
|
|
292
|
-
display: inline-block;
|
|
396
|
+
.ratio_16x10::before {
|
|
397
|
+
content: "";
|
|
398
|
+
display: block;
|
|
399
|
+
padding-top: calc(10 / 16 * 100%);
|
|
293
400
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
401
|
+
.ratio_16x10 > * {
|
|
402
|
+
position: absolute;
|
|
403
|
+
top: 0;
|
|
404
|
+
right: 0;
|
|
405
|
+
bottom: 0;
|
|
406
|
+
left: 0;
|
|
297
407
|
width: 100%;
|
|
298
|
-
|
|
299
|
-
overflow: hidden;
|
|
300
|
-
display: inline-block;
|
|
408
|
+
height: 100%;
|
|
301
409
|
}
|
|
302
410
|
|
|
303
|
-
.
|
|
304
|
-
|
|
411
|
+
.guide {
|
|
412
|
+
z-index: 9999;
|
|
413
|
+
position: absolute;
|
|
414
|
+
top: 0;
|
|
415
|
+
left: 0;
|
|
305
416
|
width: 100%;
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
417
|
+
height: 100%;
|
|
418
|
+
margin: 0;
|
|
419
|
+
pointer-events: none;
|
|
420
|
+
opacity: 1;
|
|
421
|
+
background-attachment: local;
|
|
309
422
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
padding-bottom: 66.67%;
|
|
313
|
-
width: 100%;
|
|
314
|
-
position: relative;
|
|
315
|
-
overflow: hidden;
|
|
316
|
-
display: inline-block;
|
|
423
|
+
.guide.is-hidden {
|
|
424
|
+
display: none !important;
|
|
317
425
|
}
|
|
318
426
|
|
|
319
|
-
.
|
|
320
|
-
|
|
427
|
+
.guide_graph {
|
|
428
|
+
z-index: 9999;
|
|
429
|
+
position: absolute;
|
|
430
|
+
top: 0;
|
|
431
|
+
left: 0;
|
|
321
432
|
width: 100%;
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
433
|
+
height: 100%;
|
|
434
|
+
margin: 0;
|
|
435
|
+
pointer-events: none;
|
|
436
|
+
opacity: 1;
|
|
437
|
+
background-attachment: local;
|
|
438
|
+
background-repeat: repeat;
|
|
439
|
+
background-size: 1.25rem 1.25rem;
|
|
440
|
+
background-image: repeating-linear-gradient(to right, rgba(111, 124, 126, 0.483) 0, rgba(111, 124, 126, 0.483) 1px, transparent 1px, transparent 1.25rem), repeating-linear-gradient(to bottom, rgba(111, 124, 126, 0.483) 0, rgba(111, 124, 126, 0.483) 1px, transparent 1px, transparent 1.25rem);
|
|
325
441
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
padding-bottom: 75%;
|
|
329
|
-
width: 100%;
|
|
330
|
-
position: relative;
|
|
331
|
-
overflow: hidden;
|
|
332
|
-
display: inline-block;
|
|
442
|
+
.guide_graph.is-hidden {
|
|
443
|
+
display: none !important;
|
|
333
444
|
}
|
|
334
445
|
|
|
335
|
-
.
|
|
336
|
-
|
|
446
|
+
.guide_graph_centered {
|
|
447
|
+
z-index: 9999;
|
|
448
|
+
position: absolute;
|
|
449
|
+
top: 0;
|
|
450
|
+
left: 0;
|
|
337
451
|
width: 100%;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
452
|
+
height: 100%;
|
|
453
|
+
margin: 0;
|
|
454
|
+
pointer-events: none;
|
|
455
|
+
opacity: 1;
|
|
456
|
+
background-attachment: local;
|
|
457
|
+
background-repeat: repeat;
|
|
458
|
+
background-size: 1.25rem 1.25rem;
|
|
459
|
+
background-position: calc(50% - 15rem / 2) 0;
|
|
460
|
+
background-image: repeating-linear-gradient(to right, rgba(111, 124, 126, 0.483) 0, rgba(111, 124, 126, 0.483) 1px, transparent 1px, transparent 1.25rem), repeating-linear-gradient(to bottom, rgba(111, 124, 126, 0.483) 0, rgba(111, 124, 126, 0.483) 1px, transparent 1px, transparent 1.25rem);
|
|
461
|
+
}
|
|
462
|
+
.guide_graph_centered.is-hidden {
|
|
463
|
+
display: none !important;
|
|
341
464
|
}
|
|
342
465
|
|
|
343
|
-
.
|
|
344
|
-
|
|
466
|
+
.guide_baseline {
|
|
467
|
+
z-index: 9999;
|
|
468
|
+
position: absolute;
|
|
469
|
+
top: 0;
|
|
470
|
+
left: 0;
|
|
345
471
|
width: 100%;
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
472
|
+
height: 100%;
|
|
473
|
+
margin: 0;
|
|
474
|
+
pointer-events: none;
|
|
475
|
+
opacity: 1;
|
|
476
|
+
background-attachment: local;
|
|
477
|
+
background-repeat: repeat;
|
|
478
|
+
background-size: 100% 1.25rem;
|
|
479
|
+
background-image: repeating-linear-gradient(to bottom, rgb(0, 200, 255) 0 1px, transparent 1px 100%);
|
|
480
|
+
}
|
|
481
|
+
.guide_baseline.is-hidden {
|
|
482
|
+
display: none !important;
|
|
349
483
|
}
|
|
350
484
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
position: relative;
|
|
355
|
-
overflow: hidden;
|
|
356
|
-
display: inline-block;
|
|
485
|
+
html,
|
|
486
|
+
body {
|
|
487
|
+
height: 100%;
|
|
357
488
|
}
|
|
358
489
|
|
|
359
490
|
html {
|
package/css/unit.gl.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
*,a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bb,bdo,big,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,em,embed,eventsource,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,img,input,ins,isindex,kbd,keygen,label,legend,li,link,map,mark,menu,meta,meter,nav,noframes,noscript,object,ol,optgroup,option,output,p,param,pre,progress,q,rp,rt,ruby,s,samp,script,section,select,small,source,span,strike,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr{border:0;font-size:100%;font:inherit;margin:0;margin-block-end:0;margin-block-start:0;margin-inline-end:0;margin-inline-start:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}.ratio_1x1{aspect-ratio:1}.ratio_1x1
|
|
1
|
+
*,a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bb,bdo,big,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,em,embed,eventsource,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,img,input,ins,isindex,kbd,keygen,label,legend,li,link,map,mark,menu,meta,meter,nav,noframes,noscript,object,ol,optgroup,option,output,p,param,pre,progress,q,rp,rt,ruby,s,samp,script,section,select,small,source,span,strike,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr{border:0;font-size:100%;font:inherit;margin:0;margin-block-end:0;margin-block-start:0;margin-inline-end:0;margin-inline-start:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}.ratio_1x1{aspect-ratio:1;position:relative;width:100%}.ratio_1x1:before{content:"";display:block;padding-top:100%}.ratio_1x1>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_1x2{aspect-ratio:.5;position:relative;width:100%}.ratio_1x2:before{content:"";display:block;padding-top:200%}.ratio_1x2>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_2x1{aspect-ratio:2;position:relative;width:100%}.ratio_2x1:before{content:"";display:block;padding-top:50%}.ratio_2x1>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_1x3{aspect-ratio:.3333333333;position:relative;width:100%}.ratio_1x3:before{content:"";display:block;padding-top:300%}.ratio_1x3>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_3x1{aspect-ratio:3;position:relative;width:100%}.ratio_3x1:before{content:"";display:block;padding-top:33.33333%}.ratio_3x1>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_1x4{aspect-ratio:.25;position:relative;width:100%}.ratio_1x4:before{content:"";display:block;padding-top:400%}.ratio_1x4>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_4x1{aspect-ratio:4;position:relative;width:100%}.ratio_4x1:before{content:"";display:block;padding-top:25%}.ratio_4x1>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_3x2{aspect-ratio:1.5;position:relative;width:100%}.ratio_3x2:before{content:"";display:block;padding-top:66.66667%}.ratio_3x2>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_2x3{aspect-ratio:.6666666667;position:relative;width:100%}.ratio_2x3:before{content:"";display:block;padding-top:150%}.ratio_2x3>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_4x3{aspect-ratio:1.3333333333;position:relative;width:100%}.ratio_4x3:before{content:"";display:block;padding-top:75%}.ratio_4x3>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_3x4{aspect-ratio:.75;position:relative;width:100%}.ratio_3x4:before{content:"";display:block;padding-top:133.33333%}.ratio_3x4>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_16x9{aspect-ratio:1.7777777778;position:relative;width:100%}.ratio_16x9:before{content:"";display:block;padding-top:56.25%}.ratio_16x9>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ratio_16x10{aspect-ratio:1.6;position:relative;width:100%}.ratio_16x10:before{content:"";display:block;padding-top:62.5%}.ratio_16x10>*{bottom:0;right:0}.guide,.ratio_16x10>*{height:100%;left:0;position:absolute;top:0;width:100%}.guide{background-attachment:local;margin:0;opacity:1;pointer-events:none;z-index:9999}.guide.is-hidden{display:none!important}.guide_graph{background-attachment:local;background-image:repeating-linear-gradient(90deg,hsla(188,6%,46%,.483) 0,hsla(188,6%,46%,.483) 1px,transparent 0,transparent 1.25rem),repeating-linear-gradient(180deg,hsla(188,6%,46%,.483) 0,hsla(188,6%,46%,.483) 1px,transparent 0,transparent 1.25rem);background-repeat:repeat;background-size:1.25rem 1.25rem;height:100%;left:0;margin:0;opacity:1;pointer-events:none;position:absolute;top:0;width:100%;z-index:9999}.guide_graph.is-hidden{display:none!important}.guide_graph_centered{background-attachment:local;background-image:repeating-linear-gradient(90deg,hsla(188,6%,46%,.483) 0,hsla(188,6%,46%,.483) 1px,transparent 0,transparent 1.25rem),repeating-linear-gradient(180deg,hsla(188,6%,46%,.483) 0,hsla(188,6%,46%,.483) 1px,transparent 0,transparent 1.25rem);background-position:calc(50% - 7.5rem) 0;background-repeat:repeat;background-size:1.25rem 1.25rem;height:100%;left:0;margin:0;opacity:1;pointer-events:none;position:absolute;top:0;width:100%;z-index:9999}.guide_graph_centered.is-hidden{display:none!important}.guide_baseline{background-attachment:local;background-image:repeating-linear-gradient(180deg,#00c8ff 0 1px,transparent 1px 100%);background-repeat:repeat;background-size:100% 1.25rem;height:100%;left:0;margin:0;opacity:1;pointer-events:none;position:absolute;top:0;width:100%;z-index:9999}.guide_baseline.is-hidden{display:none!important}html{font-size:12px}@media screen and (min-width:320px){html{font-size:calc(8.57143px + 1.07143vw)}}@media screen and (min-width:1440px){html{font-size:24px}}html{box-sizing:border-box;-webkit-text-size-adjust:100%;height:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-break:normal}body{height:100vh;margin:0;min-height:100%;position:absolute;width:100vw}body,html{height:100%;margin:0}*,:after,:before{background-repeat:no-repeat;box-sizing:inherit}:after,:before{text-decoration:inherit;vertical-align:inherit}*{margin:0;padding:0}
|
|
2
2
|
/*# sourceMappingURL=to.css.map */
|
package/js/grids.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const STORAGE_KEY = 'unitgl:grid:visibility';
|
|
3
|
+
function loadVisibility() {
|
|
4
|
+
try {
|
|
5
|
+
return JSON.parse(localStorage.getItem(STORAGE_KEY) || '{}');
|
|
6
|
+
}
|
|
7
|
+
catch (_a) {
|
|
8
|
+
return {};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function saveVisibility(visibilityMap) {
|
|
12
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(visibilityMap));
|
|
13
|
+
}
|
|
14
|
+
function updateAllGridHeights() {
|
|
15
|
+
const height = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
|
|
16
|
+
document.querySelectorAll('.grid_layer').forEach(layer => {
|
|
17
|
+
if (layer.offsetHeight !== height) {
|
|
18
|
+
layer.style.height = `${height}px`;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function updateStatusIndicator(id, isHidden) {
|
|
23
|
+
const badge = document.querySelector(`[data-status="${id}"]`);
|
|
24
|
+
if (badge) {
|
|
25
|
+
badge.textContent = isHidden ? '✕ Off' : '✓ On';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function applyVisibilityState(state) {
|
|
29
|
+
document.querySelectorAll('.grid_layer').forEach(layer => {
|
|
30
|
+
const id = layer.dataset.grid;
|
|
31
|
+
const hidden = !!state[id];
|
|
32
|
+
layer.classList.toggle('is-hidden', hidden);
|
|
33
|
+
updateStatusIndicator(id, hidden);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function setupGridToggles() {
|
|
37
|
+
const visibility = loadVisibility();
|
|
38
|
+
const buttons = document.querySelectorAll('button[data-toggle]');
|
|
39
|
+
buttons.forEach(button => {
|
|
40
|
+
const id = button.dataset.toggle;
|
|
41
|
+
const layer = document.querySelector(`[data-grid="${id}"]`);
|
|
42
|
+
if (!layer)
|
|
43
|
+
return;
|
|
44
|
+
button.addEventListener('click', () => {
|
|
45
|
+
const isNowHidden = layer.classList.toggle('is-hidden');
|
|
46
|
+
visibility[id] = isNowHidden;
|
|
47
|
+
saveVisibility(visibility);
|
|
48
|
+
updateStatusIndicator(id, isNowHidden);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
applyVisibilityState(visibility);
|
|
52
|
+
}
|
|
53
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
54
|
+
updateAllGridHeights();
|
|
55
|
+
setupGridToggles();
|
|
56
|
+
window.addEventListener('resize', updateAllGridHeights);
|
|
57
|
+
window.addEventListener('scroll', updateAllGridHeights);
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=grids.js.map
|
package/js/grids.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grids.js","sourceRoot":"","sources":["../../src/ts/grids.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAK7C,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,CAAC;IAC/D,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAKD,SAAS,cAAc,CAAC,aAAsC;IAC5D,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;AACnE,CAAC;AAKD,SAAS,oBAAoB;IAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CACrB,QAAQ,CAAC,IAAI,CAAC,YAAY,EAC1B,QAAQ,CAAC,eAAe,CAAC,YAAY,CACtC,CAAC;IAEF,QAAQ,CAAC,gBAAgB,CAAc,aAAa,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAEpE,IAAI,KAAK,CAAC,YAAY,KAAK,MAAM,EAAE,CAAC;YAClC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAKD,SAAS,qBAAqB,CAAC,EAAU,EAAE,QAAiB;IAC1D,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAkB,iBAAiB,EAAE,IAAI,CAAC,CAAC;IAC/E,IAAI,KAAK,EAAE,CAAC;QACV,KAAK,CAAC,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAClD,CAAC;AACH,CAAC;AAKD,SAAS,oBAAoB,CAAC,KAA8B;IAC1D,QAAQ,CAAC,gBAAgB,CAAY,aAAa,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAClE,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAC9B,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC3B,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC5C,qBAAqB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC;AAKD,SAAS,gBAAgB;IACvB,MAAM,UAAU,GAAG,cAAc,EAAE,CAAC;IAEpC,MAAM,OAAO,GAAG,QAAQ,CAAC,gBAAgB,CAAe,qBAAqB,CAAC,CAAC;IAC/E,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACvB,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;QACjC,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAY,eAAe,EAAE,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,KAAK;YAAE,OAAO;QAEnB,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YACpC,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YACxD,UAAU,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC;YAC7B,cAAc,CAAC,UAAU,CAAC,CAAC;YAC3B,qBAAqB,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,oBAAoB,CAAC,UAAU,CAAC,CAAC;AACnC,CAAC;AAGD,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,GAAG,EAAE;IACjD,oBAAoB,EAAE,CAAC;IACvB,gBAAgB,EAAE,CAAC;IAEnB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;IACxD,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;AAC1D,CAAC,CAAC,CAAC"}
|
package/js/unit.gl.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import './grids.js';
|
|
2
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
3
|
+
console.log('[unit.gl] Test site initialized');
|
|
4
|
+
const current = location.pathname.split('/').pop();
|
|
5
|
+
const activeLink = document.querySelector(`a[href$="${current}"]`);
|
|
6
|
+
if (activeLink) {
|
|
7
|
+
activeLink.classList.add('active');
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AAOpB,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,GAAG,EAAE;IACjD,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAG/C,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACnD,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,YAAY,OAAO,IAAI,CAAC,CAAC;IACnE,IAAI,UAAU,EAAE,CAAC;QACf,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;AAGH,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unit.gl",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Dynamic Layout Engine.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unit.gl",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"exports": {
|
|
61
61
|
".": {
|
|
62
62
|
"sass": "./scss/index.scss",
|
|
63
|
-
"typescript": "./ts/index.
|
|
63
|
+
"typescript": "./ts/index.ts"
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
package/scss/_reset.scss
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
////
|
|
2
|
+
///
|
|
3
|
+
/// Reset Mixins Module
|
|
4
|
+
/// ===========================================================================
|
|
5
|
+
///
|
|
6
|
+
/// @group Reset
|
|
7
|
+
/// @author Scape Agency
|
|
8
|
+
/// @link https://unit.gl
|
|
9
|
+
/// @since 0.1.0 initial release
|
|
10
|
+
/// @todo None
|
|
11
|
+
/// @access public
|
|
12
|
+
///
|
|
13
|
+
////
|
|
14
|
+
|
|
1
15
|
// ============================================================================
|
|
2
|
-
//
|
|
16
|
+
// Use
|
|
3
17
|
// ============================================================================
|
|
4
18
|
|
|
5
19
|
// Reset margin and padding for all elements
|