@operato/board 0.2.15

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 (69) hide show
  1. package/.storybook/main.js +3 -0
  2. package/.storybook/server.mjs +8 -0
  3. package/CHANGELOG.md +22 -0
  4. package/LICENSE +21 -0
  5. package/README.md +95 -0
  6. package/custom-elements.json +1377 -0
  7. package/demo/index-player.html +101 -0
  8. package/demo/index-viewer.html +101 -0
  9. package/demo/index.html +101 -0
  10. package/dist/src/index.d.ts +2 -0
  11. package/dist/src/index.js +3 -0
  12. package/dist/src/index.js.map +1 -0
  13. package/dist/src/ox-board-player copy.d.ts +39 -0
  14. package/dist/src/ox-board-player copy.js +258 -0
  15. package/dist/src/ox-board-player copy.js.map +1 -0
  16. package/dist/src/ox-board-player-control.d.ts +39 -0
  17. package/dist/src/ox-board-player-control.js +390 -0
  18. package/dist/src/ox-board-player-control.js.map +1 -0
  19. package/dist/src/ox-board-player-style.d.ts +1 -0
  20. package/dist/src/ox-board-player-style.js +200 -0
  21. package/dist/src/ox-board-player-style.js.map +1 -0
  22. package/dist/src/ox-board-player.d.ts +39 -0
  23. package/dist/src/ox-board-player.js +284 -0
  24. package/dist/src/ox-board-player.js.map +1 -0
  25. package/dist/src/ox-board-viewer.d.ts +45 -0
  26. package/dist/src/ox-board-viewer.js +491 -0
  27. package/dist/src/ox-board-viewer.js.map +1 -0
  28. package/dist/src/ox-board-wrapper.d.ts +1 -0
  29. package/dist/src/ox-board-wrapper.js +88 -0
  30. package/dist/src/ox-board-wrapper.js.map +1 -0
  31. package/dist/src/player/board-player-carousel.d.ts +1 -0
  32. package/dist/src/player/board-player-carousel.js +205 -0
  33. package/dist/src/player/board-player-carousel.js.map +1 -0
  34. package/dist/src/player/board-player-grid.d.ts +1 -0
  35. package/dist/src/player/board-player-grid.js +78 -0
  36. package/dist/src/player/board-player-grid.js.map +1 -0
  37. package/dist/src/utils/fullscreen.d.ts +14 -0
  38. package/dist/src/utils/fullscreen.js +69 -0
  39. package/dist/src/utils/fullscreen.js.map +1 -0
  40. package/dist/src/utils/os.d.ts +20 -0
  41. package/dist/src/utils/os.js +41 -0
  42. package/dist/src/utils/os.js.map +1 -0
  43. package/dist/src/utils/swipe-listener.d.ts +10 -0
  44. package/dist/src/utils/swipe-listener.js +257 -0
  45. package/dist/src/utils/swipe-listener.js.map +1 -0
  46. package/dist/stories/index.stories.d.ts +33 -0
  47. package/dist/stories/index.stories.js +33 -0
  48. package/dist/stories/index.stories.js.map +1 -0
  49. package/dist/test/board-viewer.test.d.ts +1 -0
  50. package/dist/test/board-viewer.test.js +24 -0
  51. package/dist/test/board-viewer.test.js.map +1 -0
  52. package/dist/tsconfig.tsbuildinfo +1 -0
  53. package/package.json +76 -0
  54. package/src/index.ts +2 -0
  55. package/src/ox-board-player-style.ts +200 -0
  56. package/src/ox-board-player.ts +292 -0
  57. package/src/ox-board-viewer.ts +534 -0
  58. package/src/ox-board-wrapper.ts +93 -0
  59. package/src/player/board-player-carousel.ts +197 -0
  60. package/src/player/board-player-grid.ts +78 -0
  61. package/src/utils/fullscreen.ts +82 -0
  62. package/src/utils/os.ts +41 -0
  63. package/src/utils/swipe-listener.ts +290 -0
  64. package/src/utils/things-scene.d.ts +1 -0
  65. package/stories/index.stories.ts +52 -0
  66. package/test/board-viewer.test.ts +35 -0
  67. package/tsconfig.json +22 -0
  68. package/web-dev-server.config.mjs +28 -0
  69. package/web-test-runner.config.mjs +29 -0
@@ -0,0 +1,390 @@
1
+ import { __decorate } from "tslib";
2
+ import '@material/mwc-fab';
3
+ import '@material/mwc-icon';
4
+ import './ox-board-wrapper';
5
+ import './player/board-player-carousel';
6
+ import { LitElement, css, html } from 'lit';
7
+ import { customElement, property, query, state } from 'lit/decorators.js';
8
+ import { exitfullscreen, togglefullscreen } from './utils/fullscreen';
9
+ import { SwipeListener } from './utils/swipe-listener';
10
+ let BoardPlayerControl = class BoardPlayerControl extends LitElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.boards = [];
14
+ this.playtime = 30;
15
+ this.columns = 1;
16
+ this.rows = 1;
17
+ this.started = false;
18
+ this.playing = false;
19
+ this._fullscreened = false;
20
+ }
21
+ render() {
22
+ return html `
23
+ <slot @mousemove=${() => this.onMousemove()} @transform=${() => this.onTransform()} tabindex="-1">
24
+ ${this.started
25
+ ? html `
26
+ <ox-board-player-carousel axis="y" .rows=${this.rows} .columns=${this.columns} player>
27
+ ${this.boards.map(item => html ` <ox-board-wrapper page .sceneId=${item.id} .provider=${this.provider}> </ox-board-wrapper> `)}
28
+ </ox-board-player-carousel>
29
+ `
30
+ : html ``}
31
+ </slot>
32
+
33
+ <div id="control" @mouseover=${() => this.onMouseoverControl()} hidden>
34
+ <div id="joystick">
35
+ <mwc-icon id="up" @click=${() => this.onTapUp()}>keyboard_arrow_up</mwc-icon>
36
+ <mwc-icon id="left" @click=${() => this.onTapLeft()}>keyboard_arrow_left</mwc-icon>
37
+ <mwc-icon id="play" @click=${() => this.onTapPlay()} ?hidden=${this.playing}>play_arrow</mwc-icon>
38
+ <mwc-icon id="pause" @click=${() => this.onTapPause()} ?hidden=${!this.playing}>pause</mwc-icon>
39
+ <mwc-icon id="right" @click=${() => this.onTapRight()}>keyboard_arrow_right</mwc-icon>
40
+ <mwc-icon id="down" @click=${() => this.onTapDown()}>keyboard_arrow_down</mwc-icon>
41
+ </div>
42
+
43
+ <div id="setting-container">
44
+ <div id="setting">
45
+ <label id="schedule-container">
46
+ <mwc-icon id="schedule">schedule</mwc-icon>
47
+ <input
48
+ .value=${this.playtime}
49
+ @change=${(e) => (this.playtime = Number(e.target.value))}
50
+ />
51
+ sec.
52
+ </label>
53
+ <div id="grid-setting-container">
54
+ <mwc-icon id="view_module">view_module</mwc-icon>
55
+ <select
56
+ .value=${this.rows}
57
+ @change=${(e) => (this.rows = Number(e.target.value))}
58
+ >
59
+ ${[1, 2, 3, 4, 5].map(row => html ` <option>${row}</option> `)}
60
+ </select>
61
+ x
62
+ <select
63
+ .value=${this.columns}
64
+ @change=${(e) => (this.columns = Number(e.target.value))}
65
+ >
66
+ ${[1, 2, 3, 4, 5].map(column => html ` <option>${column}</option> `)}
67
+ </select>
68
+ </div>
69
+ </div>
70
+
71
+ <div id="etc">
72
+ <mwc-icon id="fullscreen" @click=${() => this.onTapFullscreen()} ?hidden=${this._fullscreened}
73
+ >fullscreen</mwc-icon
74
+ >
75
+ <mwc-icon id="fullscreen-exit" @click=${() => this.onTapFullscreen()} ?hidden=${!this._fullscreened}
76
+ >fullscreen_exit</mwc-icon
77
+ >
78
+ <mwc-icon id="close" @click=${() => this.onTapClose()}>close</mwc-icon>
79
+ </div>
80
+ </div>
81
+ </div>
82
+ `;
83
+ }
84
+ firstUpdated() {
85
+ SwipeListener(this);
86
+ this.addEventListener('swipe', (e) => {
87
+ var directions = e.detail.directions;
88
+ if (directions.left) {
89
+ this.onTapRight();
90
+ }
91
+ else if (directions.right) {
92
+ this.onTapLeft();
93
+ }
94
+ else if (directions.top) {
95
+ this.onTapDown();
96
+ }
97
+ else if (directions.bottom) {
98
+ this.onTapUp();
99
+ }
100
+ });
101
+ }
102
+ updated(changes) {
103
+ if (changes.has('boards') || changes.has('columns') || changes.has('rows')) {
104
+ this.boards && this.boards.length > 0 ? this.restart() : this.stop();
105
+ }
106
+ else if (changes.has('playtime') && this.playing) {
107
+ this._resetTransformTimer();
108
+ }
109
+ }
110
+ async _resetFadeTimer(stop) {
111
+ if (!this._controlAnimation) {
112
+ this._controlAnimation = this._control.animate([
113
+ {
114
+ opacity: 1,
115
+ easing: 'ease-in'
116
+ },
117
+ { opacity: 0 }
118
+ ], { delay: 1000, duration: 2000 });
119
+ }
120
+ this._control.hidden = false;
121
+ this._controlAnimation.cancel();
122
+ if (stop)
123
+ return;
124
+ try {
125
+ this._controlAnimation.play();
126
+ await this._controlAnimation.finished;
127
+ this._control.hidden = true;
128
+ }
129
+ catch (e) {
130
+ /* cancelled */
131
+ }
132
+ }
133
+ _resetTransformTimer() {
134
+ clearTimeout(this._transferTimer);
135
+ this.playing = true;
136
+ if (this._currentPlayer) {
137
+ this._transferTimer = setTimeout(() => {
138
+ if (this._transferTimer)
139
+ this._currentPlayer.next();
140
+ }, this.playtime * 1000);
141
+ }
142
+ }
143
+ onMousemove() {
144
+ this._resetFadeTimer();
145
+ }
146
+ onMouseoverControl() {
147
+ this._resetFadeTimer(true);
148
+ }
149
+ onTapFullscreen() {
150
+ togglefullscreen(this, () => {
151
+ this._fullscreened = true;
152
+ this.focus();
153
+ }, () => {
154
+ this._fullscreened = false;
155
+ this.focus();
156
+ });
157
+ }
158
+ onTransform() {
159
+ requestAnimationFrame(() => this.started && this.playing && this._resetTransformTimer());
160
+ }
161
+ onTapPlay() {
162
+ this._resetTransformTimer();
163
+ }
164
+ onTapPause() {
165
+ clearTimeout(this._transferTimer);
166
+ this.playing = false;
167
+ }
168
+ onTapLeft() {
169
+ this._currentPlayer.axis = 'y';
170
+ this._currentPlayer.previous();
171
+ }
172
+ onTapRight() {
173
+ this._currentPlayer.axis = 'y';
174
+ this._currentPlayer.next();
175
+ }
176
+ onTapUp() {
177
+ this._currentPlayer.axis = 'x';
178
+ this._currentPlayer.next();
179
+ }
180
+ onTapDown() {
181
+ this._currentPlayer.axis = 'x';
182
+ this._currentPlayer.previous();
183
+ }
184
+ onTapClose() {
185
+ if (this._fullscreened) {
186
+ exitfullscreen();
187
+ }
188
+ window.history.back();
189
+ }
190
+ async restart() {
191
+ await this.stop();
192
+ await this.start();
193
+ }
194
+ async start() {
195
+ if (!this.boards || this.boards.length == 0)
196
+ return;
197
+ this.started = true;
198
+ this.playing = true;
199
+ await this.updateComplete;
200
+ this._currentPlayer = this.renderRoot.querySelector(':not([style*="display: none"])[player]');
201
+ this._resetTransformTimer();
202
+ this._resetFadeTimer();
203
+ this.focus();
204
+ }
205
+ async stop() {
206
+ clearTimeout(this._transferTimer);
207
+ this._currentPlayer && this._currentPlayer.stop();
208
+ this.started = false;
209
+ /**
210
+ * this.started = false 로 인한 update를 강제하기 위함임.
211
+ * this.start() 가 바로 호출되어 this.started 의 변화가 render에 반영되지 않을 수 있으므로.
212
+ */
213
+ await this.updateComplete;
214
+ }
215
+ };
216
+ BoardPlayerControl.styles = css `
217
+ div > * {
218
+ cursor: pointer;
219
+ user-select: none;
220
+ }
221
+
222
+ #joystick {
223
+ position: relative;
224
+ box-sizing: border-box;
225
+ border: 2px solid tomato;
226
+ background-color: #c34827;
227
+ box-shadow: 0 0 5px #000;
228
+ width: 100%;
229
+ height: 100%;
230
+ grid-column: 1 / span 2;
231
+ border-radius: 50%;
232
+ z-index: 2;
233
+ grid-row: 1 / span 3;
234
+ }
235
+
236
+ #joystick mwc-icon {
237
+ position: absolute;
238
+ display: block;
239
+ width: 20px;
240
+ height: 20px;
241
+ font-size: 25px;
242
+ line-height: 0.7;
243
+ }
244
+
245
+ mwc-icon#up {
246
+ left: 29px;
247
+ }
248
+
249
+ mwc-icon#left {
250
+ top: 32px;
251
+ left: -2px;
252
+ }
253
+
254
+ mwc-icon#play,
255
+ mwc-icon#pause {
256
+ left: 20px;
257
+ top: 20px;
258
+ width: 40px;
259
+ height: 40px;
260
+ border: 1px solid rgba(0, 0, 0, 0.15);
261
+ border-radius: 50%;
262
+ background-color: rgba(0, 0, 0, 0.15);
263
+ font-size: 45px;
264
+ line-height: 0.9;
265
+ }
266
+
267
+ mwc-icon#right {
268
+ top: 31px;
269
+ left: 60px;
270
+ }
271
+
272
+ mwc-icon#down {
273
+ left: 29px;
274
+ top: 63px;
275
+ }
276
+
277
+ mwc-icon#pause {
278
+ text-indent: -2px;
279
+ }
280
+
281
+ #setting-container {
282
+ grid-column: 2 / span 2;
283
+ grid-row: 2;
284
+ gap: 0 10px;
285
+ border-radius: 12px;
286
+ background: rgba(0, 0, 0, 0.7);
287
+ height: 100%;
288
+ box-shadow: rgb(0, 0, 0) 0px 0px 5px;
289
+ display: grid;
290
+ grid-template-columns: 1fr 60px;
291
+ align-items: center;
292
+ padding-left: 60px;
293
+ padding-right: 5px;
294
+ }
295
+
296
+ #setting {
297
+ display: grid;
298
+ grid-template-columns: 1fr 1fr;
299
+ grid-gap: 0 10px;
300
+ }
301
+
302
+ #setting mwc-icon {
303
+ font-size: 22px;
304
+ color: rgba(255, 174, 53, 0.8);
305
+ }
306
+
307
+ #setting input {
308
+ width: 50px;
309
+ margin-right: 5px;
310
+ font-size: 14px;
311
+ background-color: transparent;
312
+ border: none;
313
+ border-bottom: 1px solid #fff;
314
+ color: #fff;
315
+ text-align: right;
316
+ }
317
+
318
+ #setting select {
319
+ border: none;
320
+ font-size: 14px;
321
+ }
322
+
323
+ #setting input:focus {
324
+ outline: none;
325
+ }
326
+
327
+ #schedule-container {
328
+ display: flex;
329
+ align-items: center;
330
+ justify-content: space-between;
331
+ }
332
+
333
+ #grid-setting-container {
334
+ display: flex;
335
+ align-items: center;
336
+ justify-content: space-between;
337
+ }
338
+
339
+ #etc {
340
+ display: grid;
341
+ grid-template-columns: 1fr 1fr;
342
+ align-items: center;
343
+ justify-items: center;
344
+ }
345
+
346
+ #etc mwc-icon {
347
+ font-size: 30px;
348
+ }
349
+ `;
350
+ __decorate([
351
+ property({ type: Array })
352
+ ], BoardPlayerControl.prototype, "boards", void 0);
353
+ __decorate([
354
+ property({ type: Number })
355
+ ], BoardPlayerControl.prototype, "playtime", void 0);
356
+ __decorate([
357
+ property({ type: Number })
358
+ ], BoardPlayerControl.prototype, "columns", void 0);
359
+ __decorate([
360
+ property({ type: Number })
361
+ ], BoardPlayerControl.prototype, "rows", void 0);
362
+ __decorate([
363
+ property({ type: Boolean })
364
+ ], BoardPlayerControl.prototype, "started", void 0);
365
+ __decorate([
366
+ property({ type: Boolean })
367
+ ], BoardPlayerControl.prototype, "playing", void 0);
368
+ __decorate([
369
+ property({ type: Object })
370
+ ], BoardPlayerControl.prototype, "provider", void 0);
371
+ __decorate([
372
+ state()
373
+ ], BoardPlayerControl.prototype, "_controlAnimation", void 0);
374
+ __decorate([
375
+ state()
376
+ ], BoardPlayerControl.prototype, "_transferTimer", void 0);
377
+ __decorate([
378
+ state()
379
+ ], BoardPlayerControl.prototype, "_currentPlayer", void 0);
380
+ __decorate([
381
+ state()
382
+ ], BoardPlayerControl.prototype, "_fullscreened", void 0);
383
+ __decorate([
384
+ query('#control')
385
+ ], BoardPlayerControl.prototype, "_control", void 0);
386
+ BoardPlayerControl = __decorate([
387
+ customElement('ox-board-player-control')
388
+ ], BoardPlayerControl);
389
+ export { BoardPlayerControl };
390
+ //# sourceMappingURL=ox-board-player-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-board-player-control.js","sourceRoot":"","sources":["../../src/ox-board-player-control.ts"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAItD,IAAa,kBAAkB,GAA/B,MAAa,kBAAmB,SAAQ,UAAU;IAAlD;;QAwI6B,WAAM,GAAe,EAAE,CAAA;QACtB,aAAQ,GAAG,EAAE,CAAA;QACb,YAAO,GAAG,CAAC,CAAA;QACX,SAAI,GAAG,CAAC,CAAA;QACP,YAAO,GAAG,KAAK,CAAA;QACf,YAAO,GAAG,KAAK,CAAA;QAMnC,kBAAa,GAAG,KAAK,CAAA;IAyOhC,CAAC;IArOC,MAAM;QACJ,OAAO,IAAI,CAAA;yBACU,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE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;;;;;;GAqIlB,CAAA;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAAwB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAS;AACP;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAAgB;AACf;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAAgB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAAc;AAEhC;IAAR,KAAK,EAAE;6DAA8B;AAC7B;IAAR,KAAK,EAAE;0DAAqB;AACpB;IAAR,KAAK,EAAE;0DAAqB;AACpB;IAAR,KAAK,EAAE;yDAAsB;AAEX;IAAlB,KAAK,CAAC,UAAU,CAAC;oDAAuB;AArJ9B,kBAAkB;IAD9B,aAAa,CAAC,yBAAyB,CAAC;GAC5B,kBAAkB,CA4X9B;SA5XY,kBAAkB","sourcesContent":["import '@material/mwc-fab'\nimport '@material/mwc-icon'\nimport './ox-board-wrapper'\nimport './player/board-player-carousel'\n\nimport { LitElement, PropertyValues, css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { exitfullscreen, togglefullscreen } from './utils/fullscreen'\n\nimport { SwipeListener } from './utils/swipe-listener'\nimport { style } from './ox-board-player-style'\n\n@customElement('ox-board-player-control')\nexport class BoardPlayerControl extends LitElement {\n static styles = css`\n div > * {\n cursor: pointer;\n user-select: none;\n }\n\n #joystick {\n position: relative;\n box-sizing: border-box;\n border: 2px solid tomato;\n background-color: #c34827;\n box-shadow: 0 0 5px #000;\n width: 100%;\n height: 100%;\n grid-column: 1 / span 2;\n border-radius: 50%;\n z-index: 2;\n grid-row: 1 / span 3;\n }\n\n #joystick mwc-icon {\n position: absolute;\n display: block;\n width: 20px;\n height: 20px;\n font-size: 25px;\n line-height: 0.7;\n }\n\n mwc-icon#up {\n left: 29px;\n }\n\n mwc-icon#left {\n top: 32px;\n left: -2px;\n }\n\n mwc-icon#play,\n mwc-icon#pause {\n left: 20px;\n top: 20px;\n width: 40px;\n height: 40px;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 50%;\n background-color: rgba(0, 0, 0, 0.15);\n font-size: 45px;\n line-height: 0.9;\n }\n\n mwc-icon#right {\n top: 31px;\n left: 60px;\n }\n\n mwc-icon#down {\n left: 29px;\n top: 63px;\n }\n\n mwc-icon#pause {\n text-indent: -2px;\n }\n\n #setting-container {\n grid-column: 2 / span 2;\n grid-row: 2;\n gap: 0 10px;\n border-radius: 12px;\n background: rgba(0, 0, 0, 0.7);\n height: 100%;\n box-shadow: rgb(0, 0, 0) 0px 0px 5px;\n display: grid;\n grid-template-columns: 1fr 60px;\n align-items: center;\n padding-left: 60px;\n padding-right: 5px;\n }\n\n #setting {\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: 0 10px;\n }\n\n #setting mwc-icon {\n font-size: 22px;\n color: rgba(255, 174, 53, 0.8);\n }\n\n #setting input {\n width: 50px;\n margin-right: 5px;\n font-size: 14px;\n background-color: transparent;\n border: none;\n border-bottom: 1px solid #fff;\n color: #fff;\n text-align: right;\n }\n\n #setting select {\n border: none;\n font-size: 14px;\n }\n\n #setting input:focus {\n outline: none;\n }\n\n #schedule-container {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n #grid-setting-container {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n #etc {\n display: grid;\n grid-template-columns: 1fr 1fr;\n align-items: center;\n justify-items: center;\n }\n\n #etc mwc-icon {\n font-size: 30px;\n }\n `\n\n @property({ type: Array }) boards: Array<any> = []\n @property({ type: Number }) playtime = 30\n @property({ type: Number }) columns = 1\n @property({ type: Number }) rows = 1\n @property({ type: Boolean }) started = false\n @property({ type: Boolean }) playing = false\n @property({ type: Object }) provider: any\n\n @state() _controlAnimation?: Animation\n @state() _transferTimer?: any\n @state() _currentPlayer?: any\n @state() _fullscreened = false\n\n @query('#control') _control!: HTMLElement\n\n render() {\n return html`\n <slot @mousemove=${() => this.onMousemove()} @transform=${() => this.onTransform()} tabindex=\"-1\">\n ${this.started\n ? html`\n <ox-board-player-carousel axis=\"y\" .rows=${this.rows} .columns=${this.columns} player>\n ${this.boards.map(\n item =>\n html` <ox-board-wrapper page .sceneId=${item.id} .provider=${this.provider}> </ox-board-wrapper> `\n )}\n </ox-board-player-carousel>\n `\n : html``}\n </slot>\n\n <div id=\"control\" @mouseover=${() => this.onMouseoverControl()} hidden>\n <div id=\"joystick\">\n <mwc-icon id=\"up\" @click=${() => this.onTapUp()}>keyboard_arrow_up</mwc-icon>\n <mwc-icon id=\"left\" @click=${() => this.onTapLeft()}>keyboard_arrow_left</mwc-icon>\n <mwc-icon id=\"play\" @click=${() => this.onTapPlay()} ?hidden=${this.playing}>play_arrow</mwc-icon>\n <mwc-icon id=\"pause\" @click=${() => this.onTapPause()} ?hidden=${!this.playing}>pause</mwc-icon>\n <mwc-icon id=\"right\" @click=${() => this.onTapRight()}>keyboard_arrow_right</mwc-icon>\n <mwc-icon id=\"down\" @click=${() => this.onTapDown()}>keyboard_arrow_down</mwc-icon>\n </div>\n\n <div id=\"setting-container\">\n <div id=\"setting\">\n <label id=\"schedule-container\">\n <mwc-icon id=\"schedule\">schedule</mwc-icon>\n <input\n .value=${this.playtime}\n @change=${(e: Event) => (this.playtime = Number((e.target as HTMLInputElement).value))}\n />\n sec.\n </label>\n <div id=\"grid-setting-container\">\n <mwc-icon id=\"view_module\">view_module</mwc-icon>\n <select\n .value=${this.rows}\n @change=${(e: Event) => (this.rows = Number((e.target as HTMLInputElement).value))}\n >\n ${[1, 2, 3, 4, 5].map(row => html` <option>${row}</option> `)}\n </select>\n x\n <select\n .value=${this.columns}\n @change=${(e: Event) => (this.columns = Number((e.target as HTMLInputElement).value))}\n >\n ${[1, 2, 3, 4, 5].map(column => html` <option>${column}</option> `)}\n </select>\n </div>\n </div>\n\n <div id=\"etc\">\n <mwc-icon id=\"fullscreen\" @click=${() => this.onTapFullscreen()} ?hidden=${this._fullscreened}\n >fullscreen</mwc-icon\n >\n <mwc-icon id=\"fullscreen-exit\" @click=${() => this.onTapFullscreen()} ?hidden=${!this._fullscreened}\n >fullscreen_exit</mwc-icon\n >\n <mwc-icon id=\"close\" @click=${() => this.onTapClose()}>close</mwc-icon>\n </div>\n </div>\n </div>\n `\n }\n\n firstUpdated() {\n SwipeListener(this)\n\n this.addEventListener('swipe', (e: Event) => {\n var directions = (e as any).detail.directions\n\n if (directions.left) {\n this.onTapRight()\n } else if (directions.right) {\n this.onTapLeft()\n } else if (directions.top) {\n this.onTapDown()\n } else if (directions.bottom) {\n this.onTapUp()\n }\n })\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('boards') || changes.has('columns') || changes.has('rows')) {\n this.boards && this.boards.length > 0 ? this.restart() : this.stop()\n } else if (changes.has('playtime') && this.playing) {\n this._resetTransformTimer()\n }\n }\n\n async _resetFadeTimer(stop?: boolean) {\n if (!this._controlAnimation) {\n this._controlAnimation = this._control.animate(\n [\n {\n opacity: 1,\n easing: 'ease-in'\n },\n { opacity: 0 }\n ],\n { delay: 1000, duration: 2000 }\n )\n }\n\n this._control.hidden = false\n\n this._controlAnimation.cancel()\n if (stop) return\n\n try {\n this._controlAnimation.play()\n await this._controlAnimation.finished\n this._control.hidden = true\n } catch (e) {\n /* cancelled */\n }\n }\n\n _resetTransformTimer() {\n clearTimeout(this._transferTimer)\n\n this.playing = true\n\n if (this._currentPlayer) {\n this._transferTimer = setTimeout(() => {\n if (this._transferTimer) this._currentPlayer.next()\n }, this.playtime * 1000)\n }\n }\n\n onMousemove() {\n this._resetFadeTimer()\n }\n\n onMouseoverControl() {\n this._resetFadeTimer(true)\n }\n\n onTapFullscreen() {\n togglefullscreen(\n this,\n () => {\n this._fullscreened = true\n this.focus()\n },\n () => {\n this._fullscreened = false\n this.focus()\n }\n )\n }\n\n onTransform() {\n requestAnimationFrame(() => this.started && this.playing && this._resetTransformTimer())\n }\n\n onTapPlay() {\n this._resetTransformTimer()\n }\n\n onTapPause() {\n clearTimeout(this._transferTimer)\n this.playing = false\n }\n\n onTapLeft() {\n this._currentPlayer.axis = 'y'\n this._currentPlayer.previous()\n }\n\n onTapRight() {\n this._currentPlayer.axis = 'y'\n this._currentPlayer.next()\n }\n\n onTapUp() {\n this._currentPlayer.axis = 'x'\n this._currentPlayer.next()\n }\n\n onTapDown() {\n this._currentPlayer.axis = 'x'\n this._currentPlayer.previous()\n }\n\n onTapClose() {\n if (this._fullscreened) {\n exitfullscreen()\n }\n\n window.history.back()\n }\n\n async restart() {\n await this.stop()\n await this.start()\n }\n\n async start() {\n if (!this.boards || this.boards.length == 0) return\n\n this.started = true\n this.playing = true\n\n await this.updateComplete\n\n this._currentPlayer = this.renderRoot.querySelector(':not([style*=\"display: none\"])[player]')\n\n this._resetTransformTimer()\n this._resetFadeTimer()\n\n this.focus()\n }\n\n async stop() {\n clearTimeout(this._transferTimer)\n\n this._currentPlayer && this._currentPlayer.stop()\n this.started = false\n\n /**\n * this.started = false 로 인한 update를 강제하기 위함임.\n * this.start() 가 바로 호출되어 this.started 의 변화가 render에 반영되지 않을 수 있으므로.\n */\n await this.updateComplete\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare const style: import("lit-element").CSSResult;
@@ -0,0 +1,200 @@
1
+ import { css } from 'lit-element';
2
+ export const style = css `
3
+ :host {
4
+ display: flex;
5
+ position: relative;
6
+ flex-direction: column;
7
+ width: 100%;
8
+ height: 100%;
9
+ overflow: hidden;
10
+ justify-content: center;
11
+ align-items: center;
12
+ }
13
+
14
+ ::slotted(*) {
15
+ border: none;
16
+ }
17
+
18
+ ::slotted > * {
19
+ flex: 1;
20
+ }
21
+
22
+ board-wrapper {
23
+ width: 100%;
24
+ height: 100%;
25
+ position: relative;
26
+ }
27
+
28
+ board-wrapper[front] {
29
+ background: black;
30
+ }
31
+
32
+ board-wrapper[back] {
33
+ background: black;
34
+ }
35
+
36
+ #control {
37
+ position: absolute;
38
+ bottom: 1vh;
39
+ width: 100vw;
40
+ max-width: 435px;
41
+ display: grid;
42
+ grid-template-columns: 42px 42px 1fr;
43
+ color: white;
44
+ justify-content: center;
45
+ align-items: center;
46
+ grid-auto-flow: dense;
47
+ padding: 5px;
48
+ box-sizing: border-box;
49
+ grid-template-rows: 12px 60px 12px;
50
+ }
51
+
52
+ #control[hidden] {
53
+ display: none;
54
+ }
55
+
56
+ #control > div > * {
57
+ cursor: pointer;
58
+ user-select: none;
59
+ }
60
+
61
+ #joystick {
62
+ position: relative;
63
+ box-sizing: border-box;
64
+ border: 2px solid tomato;
65
+ background-color: #c34827;
66
+ box-shadow: 0 0 5px #000;
67
+ width: 100%;
68
+ height: 100%;
69
+ grid-column: 1 / span 2;
70
+ border-radius: 50%;
71
+ z-index: 2;
72
+ grid-row: 1 / span 3;
73
+ }
74
+
75
+ #joystick mwc-icon {
76
+ position: absolute;
77
+ display: block;
78
+ width: 20px;
79
+ height: 20px;
80
+ font-size: 25px;
81
+ line-height: 0.7;
82
+ }
83
+
84
+ mwc-icon#up {
85
+ left: 29px;
86
+ }
87
+
88
+ mwc-icon#left {
89
+ top: 32px;
90
+ left: -2px;
91
+ }
92
+
93
+ mwc-icon#play,
94
+ mwc-icon#pause {
95
+ left: 20px;
96
+ top: 20px;
97
+ width: 40px;
98
+ height: 40px;
99
+ border: 1px solid rgba(0, 0, 0, 0.15);
100
+ border-radius: 50%;
101
+ background-color: rgba(0, 0, 0, 0.15);
102
+ font-size: 45px;
103
+ line-height: 0.9;
104
+ }
105
+
106
+ mwc-icon#right {
107
+ top: 31px;
108
+ left: 60px;
109
+ }
110
+
111
+ mwc-icon#down {
112
+ left: 29px;
113
+ top: 63px;
114
+ }
115
+
116
+ mwc-icon#pause {
117
+ text-indent: -2px;
118
+ }
119
+
120
+ #setting-container {
121
+ grid-column: 2 / span 2;
122
+ grid-row: 2;
123
+ gap: 0 10px;
124
+ border-radius: 12px;
125
+ background: rgba(0, 0, 0, 0.7);
126
+ height: 100%;
127
+ box-shadow: rgb(0, 0, 0) 0px 0px 5px;
128
+ display: grid;
129
+ grid-template-columns: 1fr 60px;
130
+ align-items: center;
131
+ padding-left: 60px;
132
+ padding-right: 5px;
133
+ }
134
+
135
+ #setting {
136
+ display: grid;
137
+ grid-template-columns: 1fr 1fr;
138
+ grid-gap: 0 10px;
139
+ }
140
+
141
+ #setting mwc-icon {
142
+ font-size: 22px;
143
+ color: rgba(255, 174, 53, 0.8);
144
+ }
145
+
146
+ #setting input {
147
+ width: 50px;
148
+ margin-right: 5px;
149
+ font-size: 14px;
150
+ background-color: transparent;
151
+ border: none;
152
+ border-bottom: 1px solid #fff;
153
+ color: #fff;
154
+ text-align: right;
155
+ }
156
+
157
+ #setting select {
158
+ border: none;
159
+ font-size: 14px;
160
+ }
161
+
162
+ #setting input:focus {
163
+ outline: none;
164
+ }
165
+
166
+ #schedule-container {
167
+ display: flex;
168
+ align-items: center;
169
+ justify-content: space-between;
170
+ }
171
+
172
+ #grid-setting-container {
173
+ display: flex;
174
+ align-items: center;
175
+ justify-content: space-between;
176
+ }
177
+
178
+ #etc {
179
+ display: grid;
180
+ grid-template-columns: 1fr 1fr;
181
+ align-items: center;
182
+ justify-items: center;
183
+ }
184
+
185
+ #etc mwc-icon {
186
+ font-size: 30px;
187
+ }
188
+
189
+ #control [hidden] {
190
+ display: none;
191
+ }
192
+
193
+ @media screen and (max-width: 460px) {
194
+ #setting {
195
+ grid-template-columns: 1fr;
196
+ grid-template-rows: 1fr 1fr;
197
+ }
198
+ }
199
+ `;
200
+ //# sourceMappingURL=ox-board-player-style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-board-player-style.js","sourceRoot":"","sources":["../../src/ox-board-player-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqMvB,CAAA","sourcesContent":["import { css } from 'lit-element'\n\nexport const style = css`\n :host {\n display: flex;\n position: relative;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow: hidden;\n justify-content: center;\n align-items: center;\n }\n\n ::slotted(*) {\n border: none;\n }\n\n ::slotted > * {\n flex: 1;\n }\n\n board-wrapper {\n width: 100%;\n height: 100%;\n position: relative;\n }\n\n board-wrapper[front] {\n background: black;\n }\n\n board-wrapper[back] {\n background: black;\n }\n\n #control {\n position: absolute;\n bottom: 1vh;\n width: 100vw;\n max-width: 435px;\n display: grid;\n grid-template-columns: 42px 42px 1fr;\n color: white;\n justify-content: center;\n align-items: center;\n grid-auto-flow: dense;\n padding: 5px;\n box-sizing: border-box;\n grid-template-rows: 12px 60px 12px;\n }\n\n #control[hidden] {\n display: none;\n }\n\n #control > div > * {\n cursor: pointer;\n user-select: none;\n }\n\n #joystick {\n position: relative;\n box-sizing: border-box;\n border: 2px solid tomato;\n background-color: #c34827;\n box-shadow: 0 0 5px #000;\n width: 100%;\n height: 100%;\n grid-column: 1 / span 2;\n border-radius: 50%;\n z-index: 2;\n grid-row: 1 / span 3;\n }\n\n #joystick mwc-icon {\n position: absolute;\n display: block;\n width: 20px;\n height: 20px;\n font-size: 25px;\n line-height: 0.7;\n }\n\n mwc-icon#up {\n left: 29px;\n }\n\n mwc-icon#left {\n top: 32px;\n left: -2px;\n }\n\n mwc-icon#play,\n mwc-icon#pause {\n left: 20px;\n top: 20px;\n width: 40px;\n height: 40px;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 50%;\n background-color: rgba(0, 0, 0, 0.15);\n font-size: 45px;\n line-height: 0.9;\n }\n\n mwc-icon#right {\n top: 31px;\n left: 60px;\n }\n\n mwc-icon#down {\n left: 29px;\n top: 63px;\n }\n\n mwc-icon#pause {\n text-indent: -2px;\n }\n\n #setting-container {\n grid-column: 2 / span 2;\n grid-row: 2;\n gap: 0 10px;\n border-radius: 12px;\n background: rgba(0, 0, 0, 0.7);\n height: 100%;\n box-shadow: rgb(0, 0, 0) 0px 0px 5px;\n display: grid;\n grid-template-columns: 1fr 60px;\n align-items: center;\n padding-left: 60px;\n padding-right: 5px;\n }\n\n #setting {\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: 0 10px;\n }\n\n #setting mwc-icon {\n font-size: 22px;\n color: rgba(255, 174, 53, 0.8);\n }\n\n #setting input {\n width: 50px;\n margin-right: 5px;\n font-size: 14px;\n background-color: transparent;\n border: none;\n border-bottom: 1px solid #fff;\n color: #fff;\n text-align: right;\n }\n\n #setting select {\n border: none;\n font-size: 14px;\n }\n\n #setting input:focus {\n outline: none;\n }\n\n #schedule-container {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n #grid-setting-container {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n #etc {\n display: grid;\n grid-template-columns: 1fr 1fr;\n align-items: center;\n justify-items: center;\n }\n\n #etc mwc-icon {\n font-size: 30px;\n }\n\n #control [hidden] {\n display: none;\n }\n\n @media screen and (max-width: 460px) {\n #setting {\n grid-template-columns: 1fr;\n grid-template-rows: 1fr 1fr;\n }\n }\n`\n"]}
@@ -0,0 +1,39 @@
1
+ import '@material/mwc-fab';
2
+ import '@material/mwc-icon';
3
+ import './ox-board-wrapper';
4
+ import './player/board-player-carousel';
5
+ import { LitElement, PropertyValues } from 'lit';
6
+ export declare class BoardPlayer extends LitElement {
7
+ static styles: import("lit").CSSResult;
8
+ boards: Array<any>;
9
+ playtime: number;
10
+ columns: number;
11
+ rows: number;
12
+ started: boolean;
13
+ playing: boolean;
14
+ provider: any;
15
+ _controlAnimation?: Animation;
16
+ _transferTimer?: any;
17
+ _currentPlayer?: any;
18
+ _fullscreened: boolean;
19
+ _control: HTMLElement;
20
+ render(): import("lit-html").TemplateResult<1>;
21
+ firstUpdated(): void;
22
+ updated(changes: PropertyValues<this>): void;
23
+ _resetFadeTimer(stop?: boolean): Promise<void>;
24
+ _resetTransformTimer(): void;
25
+ onMousemove(): void;
26
+ onMouseoverControl(): void;
27
+ onTapFullscreen(): void;
28
+ onTransform(): void;
29
+ play(): void;
30
+ pause(): void;
31
+ moveLeft(): void;
32
+ moveRight(): void;
33
+ moveUp(): void;
34
+ moveDown(): void;
35
+ onTapClose(): void;
36
+ restart(): Promise<void>;
37
+ start(): Promise<void>;
38
+ stop(): Promise<void>;
39
+ }