qcobjects-sdk 2.4.6 → 2.4.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.
Files changed (31) hide show
  1. package/.eslintrc.json +26 -21
  2. package/QCObjects-SDK.js +47 -47
  3. package/VERSION +1 -1
  4. package/demo-tests/test-component-grid.html +43 -30
  5. package/demo-tests/test-component-list.html +31 -23
  6. package/demo-tests/test-component-notifications.html +31 -12
  7. package/demo-tests/test-component-slider.html +47 -31
  8. package/js/org.qcobjects.cloud.auth.session.data.js +106 -47
  9. package/js/org.qcobjects.cloud.auth.session.usertoken.js +64 -54
  10. package/js/org.qcobjects.components.grid.js +46 -34
  11. package/js/org.qcobjects.components.js +137 -80
  12. package/js/org.qcobjects.components.list.js +27 -18
  13. package/js/org.qcobjects.components.notifications.js +73 -58
  14. package/js/org.qcobjects.components.slider.js +174 -151
  15. package/js/org.qcobjects.components.splashscreen.js +480 -460
  16. package/js/org.qcobjects.controllers.form.js +38 -20
  17. package/js/org.qcobjects.controllers.grid.js +46 -25
  18. package/js/org.qcobjects.controllers.js +38 -6
  19. package/js/org.qcobjects.controllers.list.js +169 -157
  20. package/js/org.qcobjects.controllers.slider.js +113 -97
  21. package/js/org.qcobjects.controllers.swagger.js +60 -51
  22. package/js/org.qcobjects.effects.js +149 -124
  23. package/js/org.qcobjects.i18n_messages.js +11 -6
  24. package/js/org.qcobjects.modal.controllers.js +14 -9
  25. package/js/org.qcobjects.modal.effects.js +25 -16
  26. package/js/org.qcobjects.models.js +19 -11
  27. package/js/org.qcobjects.tools.canvas.js +10 -6
  28. package/js/org.qcobjects.tools.js +17 -8
  29. package/js/org.qcobjects.tools.layouts.js +19 -8
  30. package/js/org.qcobjects.views.js +12 -7
  31. package/package.json +3 -4
@@ -26,11 +26,20 @@ logger.debugEnabled = true;
26
26
  (function() {
27
27
  "use strict";
28
28
  Package("org.qcobjects.components.splashscreen",[
29
- Class("SplashScreenComponent", Component, {
30
- name: "splashscreen",
31
- cached: false,
32
- shadowed: true,
33
- _new_: function(o) {
29
+
30
+ class SplashScreenComponent extends Component {
31
+ constructor () {
32
+ super();
33
+ this.name= "splashscreen";
34
+ this.cached= false;
35
+ this.shadowed= true;
36
+
37
+
38
+ }
39
+
40
+ _new_() {
41
+ super._new_();
42
+ var o = this;
34
43
  var isBrowser = typeof window !== "undefined" && typeof window.self !== "undefined" && window === window.self;
35
44
  let component = this;
36
45
  var isStartURL = (location.hash === ""
@@ -101,500 +110,511 @@ Package("org.qcobjects.components.splashscreen",[
101
110
  } else {
102
111
  component.body.style.display="none";
103
112
  }
104
- _super_("Component", "_new_").call(this,o);
105
- }
106
- }),
107
- Class ("VideoSplashScreenComponent",
108
- ClassFactory("SplashScreenComponent"), {
109
- name: "videosplashscreen",
110
- cached: false,
111
- shadowed: true,
112
- tplsource: "inline",
113
- template: `
114
- <style>
115
- :host * {
116
- box-sizing: border-box;
117
113
  }
118
114
 
119
- :host {
120
- zoom: 1.0;
121
- width: device-width;
122
- margin: 0;
123
- top: 0;
124
- left: 0;
125
- right: 0;
126
- bottom: 0;
127
- position: absolute;
128
- padding: 0;
129
- min-width: 100vw;
130
- min-height: 100vh;
131
- width: 100vw;
132
- height: 100vh;
133
- overflow: hidden;
134
- background-color: black;
135
- }
136
- #slot-logo::slotted(img) {
137
- vertical-align: middle;
138
- display: block;
139
- width: 40vw;
115
+ },
116
+
117
+ class VideoSplashScreenComponent extends SplashScreenComponent {
118
+ constructor () {
119
+ super();
120
+
121
+ this.name= "videosplashscreen";
122
+ this.cached= false;
123
+ this.shadowed= true;
124
+ this.tplsource= "inline";
125
+ this.template= `
126
+ <style>
127
+ :host * {
128
+ box-sizing: border-box;
129
+ }
130
+
131
+ :host {
132
+ zoom: 1.0;
133
+ width: device-width;
134
+ margin: 0;
135
+ top: 0;
140
136
  left: 0;
137
+ right: 0;
138
+ bottom: 0;
139
+ position: absolute;
140
+ padding: 0;
141
+ min-width: 100vw;
142
+ min-height: 100vh;
143
+ width: 100vw;
144
+ height: 100vh;
145
+ overflow: hidden;
146
+ background-color: black;
147
+ }
148
+ #slot-logo::slotted(img) {
149
+ vertical-align: middle;
150
+ display: block;
151
+ width: 40vw;
152
+ left: 0;
153
+ margin: 0;
154
+ padding: 0;
155
+ z-index: 9999999999;
156
+ transform-origin: center;
157
+ transform-style: preserve-3d;
158
+ filter: blur(0em);
159
+ transition: filter 0.5s;
160
+ max-width: 300px;
161
+ position: absolute;
162
+ top: 50%;
163
+ left: 50%;
164
+ transform: translate(-50%, -50%);
165
+ animation: fadeIn 5s;
166
+ -webkit-animation: fadeIn 5s;
167
+ -moz-animation: fadeIn 5s;
168
+ -o-animation: fadeIn 5s;
169
+ -ms-animation: fadeIn 5s;
170
+ }
171
+
172
+ :host * {
173
+ -webkit-user-select: none;
174
+ -moz-user-select: none;
175
+ -ms-user-select: none;
176
+ user-select: none;
177
+ -webkit-touch-callout: none;
178
+ /* prevent callout to copy image, etc when tap to hold */
179
+ -webkit-text-size-adjust: none;
180
+ /* prevent webkit from resizing text to fit */
181
+ -webkit-user-select: none;
182
+ /* prevent copy paste, to allow, change 'none' to 'text' */
183
+ }
184
+
185
+ /* FOCUS */
186
+ :host summary:focus,
187
+ :host a:focus,
188
+ :host button:focus {
189
+ outline: none;
190
+ }
191
+
192
+ .splashscreen,
193
+ .fullscreen-bg {
194
+ padding: 0;
141
195
  margin: 0;
196
+ top: 0;
197
+ left: 0;
198
+ right: 0;
199
+ bottom: 0;
142
200
  padding: 0;
143
- z-index: 9999999999;
144
- transform-origin: center;
201
+ background-attachment: fixed;
202
+ background-position: center;
203
+ background-clip: content-box;
204
+ background-size: cover;
205
+ position: absolute;
206
+ min-width: 100vw;
207
+ min-height: 100vh;
208
+ width: 100vw;
209
+ height: 100vh;
210
+ z-index: 0;
211
+ overflow: hidden;
212
+ }
213
+
214
+ .splashscreen .splashcontent {
215
+ top: 0;
216
+ left: 0;
217
+ right: 0;
218
+ bottom: 0;
219
+ margin: 0 auto;
220
+ width: 100vw;
221
+ height: 100vh;
222
+ padding: 0;
223
+ overflow: hidden;
224
+ z-index: 1;
225
+ }
226
+
227
+ .splashscreen .splashcontent p {
228
+ color: white;
229
+ }
230
+
231
+ video.fullscreen-bg__video {
232
+ top: 0;
233
+ left: 0;
234
+ bottom: 0;
235
+ right: 0;
236
+ margin: 0;
237
+ padding: 0;
238
+ position: absolute;
239
+ min-width: 100vw;
240
+ min-height: 100vh;
241
+ overflow: hidden;
242
+ z-index: 0;
243
+ object-fit: cover;
244
+ filter: brightness(0.3);
245
+ }
246
+ .splashscreen,
247
+ .fullscreen-bg {
248
+ background-image: url('{{background}}');
249
+ }
250
+
251
+ @keyframes fadeIn {
252
+ 0% {opacity:0;}
253
+ 100% {opacity:1;}
254
+ }
255
+
256
+ @-moz-keyframes fadeIn {
257
+ 0% {opacity:0;}
258
+ 100% {opacity:1;}
259
+ }
260
+
261
+ @-webkit-keyframes fadeIn {
262
+ 0% {opacity:0;}
263
+ 100% {opacity:1;}
264
+ }
265
+
266
+ @-o-keyframes fadeIn {
267
+ 0% {opacity:0;}
268
+ 100% {opacity:1;}
269
+ }
270
+
271
+ @-ms-keyframes fadeIn {
272
+ 0% {opacity:0;}
273
+ 100% {opacity:1;}
274
+ }
275
+
276
+ </style>
277
+ <div class="splashscreen">
278
+ <div class="fullscreen-bg splashcontent">
279
+ <video loop muted autoplay playsinline name="media" poster="{{background}}" class="fullscreen-bg__video" data-setup="{}" height="100%">
280
+ <source src="{{video_mp4}}" type="video/mp4">
281
+ <source src="{{video_ogg}}" type="video/ogg">
282
+ <source src="{{video_webm}}" type="video/webm">
283
+ </video>
284
+ <slot id="slot-logo" name="logo"></slot>
285
+ </div>
286
+ </div>
287
+
288
+ `;
289
+ }
290
+ },
291
+
292
+ class CubeSplashScreenComponent extends SplashScreenComponent {
293
+
294
+ constructor () {
295
+ super();
296
+ this.name= "cubesplashscreen";
297
+ this.cached= false;
298
+ this.shadowed= true;
299
+ this.tplsource= "inline";
300
+ this.template= `
301
+ <style>
302
+ @keyframes spin {
303
+ 0% {
304
+ transform: translateZ(-100px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
305
+ }
306
+
307
+ 16% {
308
+ transform: translateZ(-100px) rotateX(180deg) rotateY(180deg) rotateZ(0deg);
309
+ }
310
+
311
+ 33% {
312
+ transform: translateZ(-100px) rotateX(360deg) rotateY(90deg) rotateZ(180deg);
313
+ }
314
+
315
+ 50% {
316
+ transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
317
+ }
318
+
319
+ 66% {
320
+ transform: translateZ(-100px) rotateX(180deg) rotateY(360deg) rotateZ(270deg);
321
+ }
322
+
323
+ 83% {
324
+ transform: translateZ(-100px) rotateX(270deg) rotateY(180deg) rotateZ(180deg);
325
+ }
326
+
327
+ 100% {
328
+ transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
329
+ }
330
+ }
331
+
332
+ @keyframes spin-duplicate {
333
+ 0% {
334
+ transform: translateZ(-100px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
335
+ }
336
+
337
+ 16% {
338
+ transform: translateZ(-100px) rotateX(180deg) rotateY(180deg) rotateZ(0deg);
339
+ }
340
+
341
+ 33% {
342
+ transform: translateZ(-100px) rotateX(360deg) rotateY(90deg) rotateZ(180deg);
343
+ }
344
+
345
+ 50% {
346
+ transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
347
+ }
348
+
349
+ 66% {
350
+ transform: translateZ(-100px) rotateX(180deg) rotateY(360deg) rotateZ(270deg);
351
+ }
352
+
353
+ 83% {
354
+ transform: translateZ(-100px) rotateX(270deg) rotateY(180deg) rotateZ(180deg);
355
+ }
356
+
357
+ 100% {
358
+ transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
359
+ }
360
+ }
361
+
362
+ @keyframes roll {
363
+ 0% {
364
+ transform: translate3d(-200px, -50px, -400px)
365
+ }
366
+
367
+ 12% {
368
+ transform: translate3d(0px, 0, -100px)
369
+ }
370
+
371
+ 25% {
372
+ transform: translate3d(200px, -50px, -400px)
373
+ }
374
+
375
+ 37% {
376
+ transform: translate3d(0px, -100px, -800px)
377
+ }
378
+
379
+ 50% {
380
+ transform: translate3d(-200px, -50px, -400px)
381
+ }
382
+
383
+ 62% {
384
+ transform: translate3d(0px, 0, -100px)
385
+ }
386
+
387
+ 75% {
388
+ transform: translate3d(200px, -50px, -400px)
389
+ }
390
+
391
+ 87% {
392
+ transform: translate3d(0px, -100px, -800px)
393
+ }
394
+
395
+ 100% {
396
+ transform: translate3d(-200px, -50px, -400px)
397
+ }
398
+ }
399
+
400
+ #wrapper {
401
+ position: relative;
402
+ width: 200px;
403
+ padding-top: 100px;
404
+ margin: 0 auto;
405
+ perspective: 1200px;
406
+ }
407
+
408
+ #platform {
409
+ margin-top: 100px;
410
+ }
411
+
412
+ #dice span {
413
+ position: absolute;
414
+ margin: 100px 0 0 100px;
415
+ display: block;
416
+ font-size: 2.5em;
417
+ padding: 10px;
418
+ }
419
+
420
+ #dice {
421
+ position: absolute;
422
+ width: 200px;
423
+ height: 200px;
145
424
  transform-style: preserve-3d;
146
- filter: blur(0em);
147
- transition: filter 0.5s;
148
- max-width: 300px;
425
+ animation: spin 50s infinite linear;
426
+ }
427
+
428
+ .side {
149
429
  position: absolute;
150
- top: 50%;
151
- left: 50%;
152
- transform: translate(-50%, -50%);
153
- animation: fadeIn 5s;
154
- -webkit-animation: fadeIn 5s;
155
- -moz-animation: fadeIn 5s;
156
- -o-animation: fadeIn 5s;
157
- -ms-animation: fadeIn 5s;
158
- }
159
-
160
- :host * {
161
- -webkit-user-select: none;
162
- -moz-user-select: none;
163
- -ms-user-select: none;
164
- user-select: none;
165
- -webkit-touch-callout: none;
166
- /* prevent callout to copy image, etc when tap to hold */
167
- -webkit-text-size-adjust: none;
168
- /* prevent webkit from resizing text to fit */
169
- -webkit-user-select: none;
170
- /* prevent copy paste, to allow, change 'none' to 'text' */
171
- }
172
-
173
- /* FOCUS */
174
- :host summary:focus,
175
- :host a:focus,
176
- :host button:focus {
177
- outline: none;
178
- }
179
-
180
- .splashscreen,
181
- .fullscreen-bg {
182
- padding: 0;
183
- margin: 0;
184
- top: 0;
185
- left: 0;
186
- right: 0;
187
- bottom: 0;
188
- padding: 0;
189
- background-attachment: fixed;
190
- background-position: center;
191
- background-clip: content-box;
192
- background-size: cover;
193
- position: absolute;
194
- min-width: 100vw;
195
- min-height: 100vh;
196
- width: 100vw;
197
- height: 100vh;
198
- z-index: 0;
199
- overflow: hidden;
200
- }
201
-
202
- .splashscreen .splashcontent {
203
- top: 0;
204
- left: 0;
205
- right: 0;
206
- bottom: 0;
207
- margin: 0 auto;
208
- width: 100vw;
209
- height: 100vh;
210
- padding: 0;
211
- overflow: hidden;
212
- z-index: 1;
213
- }
214
-
215
- .splashscreen .splashcontent p {
216
- color: white;
217
- }
218
-
219
- video.fullscreen-bg__video {
220
- top: 0;
221
- left: 0;
222
- bottom: 0;
223
- right: 0;
224
- margin: 0;
225
- padding: 0;
226
- position: absolute;
227
- min-width: 100vw;
228
- min-height: 100vh;
229
- overflow: hidden;
230
- z-index: 0;
231
- object-fit: cover;
232
- filter: brightness(0.3);
233
- }
234
- .splashscreen,
235
- .fullscreen-bg {
236
- background-image: url('{{background}}');
430
+ width: 200px;
431
+ height: 200px;
432
+ background: none;
433
+ box-shadow: inset 0 0 40px #fff0;
434
+ border-radius: 40px;
237
435
  }
238
-
239
- @keyframes fadeIn {
240
- 0% {opacity:0;}
241
- 100% {opacity:1;}
436
+
437
+ #dice .cover, #dice .inner {
438
+ background: #e0e0e0;
439
+ box-shadow: none;
242
440
  }
243
-
244
- @-moz-keyframes fadeIn {
245
- 0% {opacity:0;}
246
- 100% {opacity:1;}
441
+
442
+ #dice .cover {
443
+ border-radius: 0;
444
+ transform-origin: center;
445
+ transform: translateZ(0px);
247
446
  }
248
-
249
- @-webkit-keyframes fadeIn {
250
- 0% {opacity:0;}
251
- 100% {opacity:1;}
447
+
448
+ #dice .cover.x {
449
+ transform-origin: center;
450
+ transform: rotateY(90deg);
252
451
  }
253
-
254
- @-o-keyframes fadeIn {
255
- 0% {opacity:0;}
256
- 100% {opacity:1;}
452
+
453
+ #dice .cover.z {
454
+ transform-origin: center;
455
+ transform: rotateX(90deg);
257
456
  }
258
-
259
- @-ms-keyframes fadeIn {
260
- 0% {opacity:0;}
261
- 100% {opacity:1;}
262
- }
263
-
264
- </style>
265
- <div class="splashscreen">
266
- <div class="fullscreen-bg splashcontent">
267
- <video loop muted autoplay playsinline name="media" poster="{{background}}" class="fullscreen-bg__video" data-setup="{}" height="100%">
268
- <source src="{{video_mp4}}" type="video/mp4">
269
- <source src="{{video_ogg}}" type="video/ogg">
270
- <source src="{{video_webm}}" type="video/webm">
271
- </video>
272
- <slot id="slot-logo" name="logo"></slot>
273
- </div>
274
- </div>
275
-
276
- `
277
- }),
278
- Class ("CubeSplashScreenComponent",
279
- ClassFactory("SplashScreenComponent"), {
280
- name: "cubesplashscreen",
281
- cached: false,
282
- shadowed: true,
283
- tplsource: "inline",
284
- template: `
285
- <style>
286
- @keyframes spin {
287
- 0% {
288
- transform: translateZ(-100px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
457
+
458
+ #dice .front {
459
+ transform-origin: center;
460
+ transform: translateZ(100px);
289
461
  }
290
-
291
- 16% {
292
- transform: translateZ(-100px) rotateX(180deg) rotateY(180deg) rotateZ(0deg);
462
+
463
+ #dice .front.inner {
464
+ transform-origin: center;
465
+ transform: translateZ(98px);
293
466
  }
294
-
295
- 33% {
296
- transform: translateZ(-100px) rotateX(360deg) rotateY(90deg) rotateZ(180deg);
467
+
468
+ #dice .back {
469
+ transform-origin: center;
470
+ transform: rotateX(-180deg) translateZ(100px);
297
471
  }
298
-
299
- 50% {
300
- transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
472
+
473
+ #dice .back.inner {
474
+ transform-origin: center;
475
+ transform: rotateX(-180deg) translateZ(98px);
301
476
  }
302
-
303
- 66% {
304
- transform: translateZ(-100px) rotateX(180deg) rotateY(360deg) rotateZ(270deg);
477
+
478
+ #dice .right {
479
+ transform-origin: center;
480
+ transform: rotateY(90deg) translateZ(100px);
305
481
  }
306
-
307
- 83% {
308
- transform: translateZ(-100px) rotateX(270deg) rotateY(180deg) rotateZ(180deg);
482
+
483
+ #dice .right.inner {
484
+ transform-origin: center;
485
+ transform: rotateY(90deg) translateZ(98px);
309
486
  }
310
-
311
- 100% {
312
- transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
487
+
488
+ #dice .left {
489
+ transform-origin: center;
490
+ transform: rotateY(-90deg) translateZ(100px);
313
491
  }
314
- }
315
-
316
- @keyframes spin-duplicate {
317
- 0% {
318
- transform: translateZ(-100px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
492
+
493
+ #dice .left.inner {
494
+ transform-origin: center;
495
+ transform: rotateY(-90deg) translateZ(98px);
319
496
  }
320
-
321
- 16% {
322
- transform: translateZ(-100px) rotateX(180deg) rotateY(180deg) rotateZ(0deg);
497
+
498
+ #dice .top {
499
+ transform-origin: center;
500
+ transform: rotateX(90deg) translateZ(100px);
323
501
  }
324
-
325
- 33% {
326
- transform: translateZ(-100px) rotateX(360deg) rotateY(90deg) rotateZ(180deg);
502
+
503
+ #dice .top.inner {
504
+ transform-origin: center;
505
+ transform: rotateX(90deg) translateZ(98px);
327
506
  }
328
-
329
- 50% {
330
- transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
507
+
508
+ #dice .bottom {
509
+ transform-origin: center;
510
+ transform: rotateX(-90deg) translateZ(100px);
331
511
  }
332
-
333
- 66% {
334
- transform: translateZ(-100px) rotateX(180deg) rotateY(360deg) rotateZ(270deg);
512
+
513
+ #dice .bottom.inner {
514
+ transform-origin: center;
515
+ transform: rotateX(-90deg) translateZ(98px);
335
516
  }
336
-
337
- 83% {
338
- transform: translateZ(-100px) rotateX(270deg) rotateY(180deg) rotateZ(180deg);
517
+
518
+ .dot {
519
+ position: absolute;
520
+ width: 46px;
521
+ height: 46px;
522
+ border-radius: 23px;
523
+ background: #444;
524
+ box-shadow: inset 5px 0 10px #000;
339
525
  }
340
-
341
- 100% {
342
- transform: translateZ(-100px) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
526
+
527
+ .dot.center {
528
+ margin: 77px 0 0 77px;
343
529
  }
344
- }
345
-
346
- @keyframes roll {
347
- 0% {
348
- transform: translate3d(-200px, -50px, -400px)
530
+
531
+ .dot.dtop {
532
+ margin-top: 20px;
349
533
  }
350
-
351
- 12% {
352
- transform: translate3d(0px, 0, -100px)
534
+
535
+ .dot.dleft {
536
+ margin-left: 134px;
353
537
  }
354
-
355
- 25% {
356
- transform: translate3d(200px, -50px, -400px)
538
+
539
+ .dot.dright {
540
+ margin-left: 20px;
357
541
  }
358
-
359
- 37% {
360
- transform: translate3d(0px, -100px, -800px)
542
+
543
+ .dot.dbottom {
544
+ margin-top: 134px;
361
545
  }
362
-
363
- 50% {
364
- transform: translate3d(-200px, -50px, -400px)
546
+
547
+ .dot.center.dleft {
548
+ margin: 77px 0 0 20px;
365
549
  }
366
-
367
- 62% {
368
- transform: translate3d(0px, 0, -100px)
550
+
551
+ .dot.center.dright {
552
+ margin: 77px 0 0 134px;
369
553
  }
370
-
371
- 75% {
372
- transform: translate3d(200px, -50px, -400px)
554
+
555
+ #background {
556
+ top: 0px;
557
+ left: 0px;
558
+ position: fixed;
559
+ z-index: -1;
560
+ width: 100%;
561
+ height: 100%;
562
+ background: var(--root-background, transparent);
563
+ background-size: cover;
564
+ background-origin: border-box;
373
565
  }
374
-
375
- 87% {
376
- transform: translate3d(0px, -100px, -800px)
566
+
567
+ #dice .side.front,
568
+ #dice .side.top,
569
+ #dice .side.right,
570
+ #dice .side.left,
571
+ #dice .side.bottom,
572
+ #dice .side.back {
573
+ background-image: var(--background-3d-cube-image, "none");
574
+ background-size: cover;
575
+ background-origin: border-box;
377
576
  }
378
-
379
- 100% {
380
- transform: translate3d(-200px, -50px, -400px)
577
+
578
+
579
+ :root, :host {
580
+ --background-3d-cube-image: url('{{cube_image}}');
581
+ --box-width: 200px;
582
+ font-size:.9em;
583
+ font-family:sans-serif;
584
+ --root-background: {{background}};
381
585
  }
382
- }
383
-
384
- #wrapper {
385
- position: relative;
386
- width: 200px;
387
- padding-top: 100px;
388
- margin: 0 auto;
389
- perspective: 1200px;
390
- }
391
-
392
- #platform {
393
- margin-top: 100px;
394
- }
395
-
396
- #dice span {
397
- position: absolute;
398
- margin: 100px 0 0 100px;
399
- display: block;
400
- font-size: 2.5em;
401
- padding: 10px;
402
- }
403
-
404
- #dice {
405
- position: absolute;
406
- width: 200px;
407
- height: 200px;
408
- transform-style: preserve-3d;
409
- animation: spin 50s infinite linear;
410
- }
411
-
412
- .side {
413
- position: absolute;
414
- width: 200px;
415
- height: 200px;
416
- background: none;
417
- box-shadow: inset 0 0 40px #fff0;
418
- border-radius: 40px;
419
- }
420
-
421
- #dice .cover, #dice .inner {
422
- background: #e0e0e0;
423
- box-shadow: none;
424
- }
425
-
426
- #dice .cover {
427
- border-radius: 0;
428
- transform-origin: center;
429
- transform: translateZ(0px);
430
- }
431
-
432
- #dice .cover.x {
433
- transform-origin: center;
434
- transform: rotateY(90deg);
435
- }
436
-
437
- #dice .cover.z {
438
- transform-origin: center;
439
- transform: rotateX(90deg);
440
- }
441
-
442
- #dice .front {
443
- transform-origin: center;
444
- transform: translateZ(100px);
445
- }
446
-
447
- #dice .front.inner {
448
- transform-origin: center;
449
- transform: translateZ(98px);
450
- }
451
-
452
- #dice .back {
453
- transform-origin: center;
454
- transform: rotateX(-180deg) translateZ(100px);
455
- }
456
-
457
- #dice .back.inner {
458
- transform-origin: center;
459
- transform: rotateX(-180deg) translateZ(98px);
460
- }
461
-
462
- #dice .right {
463
- transform-origin: center;
464
- transform: rotateY(90deg) translateZ(100px);
465
- }
466
-
467
- #dice .right.inner {
468
- transform-origin: center;
469
- transform: rotateY(90deg) translateZ(98px);
470
- }
471
-
472
- #dice .left {
473
- transform-origin: center;
474
- transform: rotateY(-90deg) translateZ(100px);
475
- }
476
-
477
- #dice .left.inner {
478
- transform-origin: center;
479
- transform: rotateY(-90deg) translateZ(98px);
480
- }
481
-
482
- #dice .top {
483
- transform-origin: center;
484
- transform: rotateX(90deg) translateZ(100px);
485
- }
486
-
487
- #dice .top.inner {
488
- transform-origin: center;
489
- transform: rotateX(90deg) translateZ(98px);
490
- }
491
-
492
- #dice .bottom {
493
- transform-origin: center;
494
- transform: rotateX(-90deg) translateZ(100px);
495
- }
496
-
497
- #dice .bottom.inner {
498
- transform-origin: center;
499
- transform: rotateX(-90deg) translateZ(98px);
500
- }
501
-
502
- .dot {
503
- position: absolute;
504
- width: 46px;
505
- height: 46px;
506
- border-radius: 23px;
507
- background: #444;
508
- box-shadow: inset 5px 0 10px #000;
509
- }
510
-
511
- .dot.center {
512
- margin: 77px 0 0 77px;
513
- }
514
-
515
- .dot.dtop {
516
- margin-top: 20px;
517
- }
518
-
519
- .dot.dleft {
520
- margin-left: 134px;
521
- }
522
-
523
- .dot.dright {
524
- margin-left: 20px;
525
- }
526
-
527
- .dot.dbottom {
528
- margin-top: 134px;
529
- }
530
-
531
- .dot.center.dleft {
532
- margin: 77px 0 0 20px;
533
- }
534
-
535
- .dot.center.dright {
536
- margin: 77px 0 0 134px;
537
- }
538
-
539
- #background {
540
- top: 0px;
541
- left: 0px;
542
- position: fixed;
543
- z-index: -1;
544
- width: 100%;
545
- height: 100%;
546
- background: var(--root-background, transparent);
547
- background-size: cover;
548
- background-origin: border-box;
549
- }
550
-
551
- #dice .side.front,
552
- #dice .side.top,
553
- #dice .side.right,
554
- #dice .side.left,
555
- #dice .side.bottom,
556
- #dice .side.back {
557
- background-image: var(--background-3d-cube-image, "none");
558
- background-size: cover;
559
- background-origin: border-box;
560
- }
561
-
562
-
563
- :root, :host {
564
- --background-3d-cube-image: url('{{cube_image}}');
565
- --box-width: 200px;
566
- font-size:.9em;
567
- font-family:sans-serif;
568
- --root-background: {{background}};
569
- }
570
- </style>
571
-
572
- <div id="background"></div>
573
- <div id="wrapper">
574
- <div id="platform">
575
- <div id="dice">
576
- <div class="side front">
586
+ </style>
587
+
588
+ <div id="background"></div>
589
+ <div id="wrapper">
590
+ <div id="platform">
591
+ <div id="dice">
592
+ <div class="side front">
593
+ </div>
594
+ <div class="side front inner"></div>
595
+ <div class="side top"></div>
596
+ <div class="side top inner"></div>
597
+ <div class="side right"></div>
598
+ <div class="side right inner"></div>
599
+ <div class="side left"></div>
600
+ <div class="side left inner"></div>
601
+ <div class="side bottom"></div>
602
+ <div class="side bottom inner"></div>
603
+ <div class="side back"></div>
604
+ <div class="side back inner"></div>
605
+ <div class="side cover x"></div>
606
+ <div class="side cover y"></div>
607
+ <div class="side cover z"></div>
577
608
  </div>
578
- <div class="side front inner"></div>
579
- <div class="side top"></div>
580
- <div class="side top inner"></div>
581
- <div class="side right"></div>
582
- <div class="side right inner"></div>
583
- <div class="side left"></div>
584
- <div class="side left inner"></div>
585
- <div class="side bottom"></div>
586
- <div class="side bottom inner"></div>
587
- <div class="side back"></div>
588
- <div class="side back inner"></div>
589
- <div class="side cover x"></div>
590
- <div class="side cover y"></div>
591
- <div class="side cover z"></div>
592
609
  </div>
593
610
  </div>
594
- </div>
611
+
612
+ `;
613
+
614
+ }
615
+
616
+ }
595
617
 
596
- `
597
- })
598
618
  ]);
599
619
 
600
620