@operato/board 0.2.15 → 0.2.16
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/CHANGELOG.md +9 -0
- package/custom-elements.json +87 -87
- package/dist/src/ox-board-player.d.ts +2 -2
- package/dist/src/ox-board-player.js +2 -2
- package/dist/src/ox-board-player.js.map +1 -1
- package/dist/src/player/ox-board-player-carousel.d.ts +1 -0
- package/dist/src/player/{board-player-carousel.js → ox-board-player-carousel.js} +2 -2
- package/dist/src/player/ox-board-player-carousel.js.map +1 -0
- package/dist/src/{ox-board-wrapper.d.ts → player/ox-board-player-grid.d.ts} +0 -0
- package/dist/src/player/{board-player-grid.js → ox-board-player-grid.js} +1 -1
- package/dist/src/player/ox-board-player-grid.js.map +1 -0
- package/dist/src/player/{board-player-grid.d.ts → ox-board-wrapper.d.ts} +0 -0
- package/dist/src/{ox-board-wrapper.js → player/ox-board-wrapper.js} +0 -0
- package/dist/src/player/ox-board-wrapper.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -3
- package/src/ox-board-player.ts +2 -2
- package/src/player/{board-player-carousel.ts → ox-board-player-carousel.ts} +1 -1
- package/src/player/{board-player-grid.ts → ox-board-player-grid.ts} +0 -0
- package/src/{ox-board-wrapper.ts → player/ox-board-wrapper.ts} +0 -0
- package/dist/src/ox-board-player copy.d.ts +0 -39
- package/dist/src/ox-board-player copy.js +0 -258
- package/dist/src/ox-board-player copy.js.map +0 -1
- package/dist/src/ox-board-player-control.d.ts +0 -39
- package/dist/src/ox-board-player-control.js +0 -390
- package/dist/src/ox-board-player-control.js.map +0 -1
- package/dist/src/ox-board-wrapper.js.map +0 -1
- package/dist/src/player/board-player-carousel.d.ts +0 -1
- package/dist/src/player/board-player-carousel.js.map +0 -1
- package/dist/src/player/board-player-grid.js.map +0 -1
package/src/ox-board-player.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@material/mwc-fab'
|
|
2
2
|
import '@material/mwc-icon'
|
|
3
|
-
import './ox-board-wrapper'
|
|
4
|
-
import './player/board-player-carousel'
|
|
3
|
+
import './player/ox-board-wrapper'
|
|
4
|
+
import './player/ox-board-player-carousel'
|
|
5
5
|
|
|
6
6
|
import { LitElement, PropertyValues, html } from 'lit'
|
|
7
7
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
File without changes
|
|
File without changes
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
onTapPlay(): void;
|
|
30
|
-
onTapPause(): void;
|
|
31
|
-
onTapLeft(): void;
|
|
32
|
-
onTapRight(): void;
|
|
33
|
-
onTapUp(): void;
|
|
34
|
-
onTapDown(): void;
|
|
35
|
-
onTapClose(): void;
|
|
36
|
-
restart(): Promise<void>;
|
|
37
|
-
start(): Promise<void>;
|
|
38
|
-
stop(): Promise<void>;
|
|
39
|
-
}
|
|
@@ -1,258 +0,0 @@
|
|
|
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, 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
|
-
import { style } from './ox-board-player-style';
|
|
11
|
-
let BoardPlayer = class BoardPlayer extends LitElement {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.boards = [];
|
|
15
|
-
this.playtime = 30;
|
|
16
|
-
this.columns = 1;
|
|
17
|
-
this.rows = 1;
|
|
18
|
-
this.started = false;
|
|
19
|
-
this.playing = false;
|
|
20
|
-
this._fullscreened = false;
|
|
21
|
-
}
|
|
22
|
-
render() {
|
|
23
|
-
return html `
|
|
24
|
-
<slot @mousemove=${() => this.onMousemove()} @transform=${() => this.onTransform()} tabindex="-1">
|
|
25
|
-
${this.started
|
|
26
|
-
? html `
|
|
27
|
-
<ox-board-player-carousel axis="y" .rows=${this.rows} .columns=${this.columns} player>
|
|
28
|
-
${this.boards.map(item => html ` <ox-board-wrapper page .sceneId=${item.id} .provider=${this.provider}> </ox-board-wrapper> `)}
|
|
29
|
-
</ox-board-player-carousel>
|
|
30
|
-
`
|
|
31
|
-
: html ``}
|
|
32
|
-
</slot>
|
|
33
|
-
|
|
34
|
-
<div id="control" @mouseover=${() => this.onMouseoverControl()} hidden>
|
|
35
|
-
<div id="joystick">
|
|
36
|
-
<mwc-icon id="up" @click=${() => this.onTapUp()}>keyboard_arrow_up</mwc-icon>
|
|
37
|
-
<mwc-icon id="left" @click=${() => this.onTapLeft()}>keyboard_arrow_left</mwc-icon>
|
|
38
|
-
<mwc-icon id="play" @click=${() => this.onTapPlay()} ?hidden=${this.playing}>play_arrow</mwc-icon>
|
|
39
|
-
<mwc-icon id="pause" @click=${() => this.onTapPause()} ?hidden=${!this.playing}>pause</mwc-icon>
|
|
40
|
-
<mwc-icon id="right" @click=${() => this.onTapRight()}>keyboard_arrow_right</mwc-icon>
|
|
41
|
-
<mwc-icon id="down" @click=${() => this.onTapDown()}>keyboard_arrow_down</mwc-icon>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<div id="setting-container">
|
|
45
|
-
<div id="setting">
|
|
46
|
-
<label id="schedule-container">
|
|
47
|
-
<mwc-icon id="schedule">schedule</mwc-icon>
|
|
48
|
-
<input
|
|
49
|
-
.value=${this.playtime}
|
|
50
|
-
@change=${(e) => (this.playtime = Number(e.target.value))}
|
|
51
|
-
/>
|
|
52
|
-
sec.
|
|
53
|
-
</label>
|
|
54
|
-
<div id="grid-setting-container">
|
|
55
|
-
<mwc-icon id="view_module">view_module</mwc-icon>
|
|
56
|
-
<select
|
|
57
|
-
.value=${this.rows}
|
|
58
|
-
@change=${(e) => (this.rows = Number(e.target.value))}
|
|
59
|
-
>
|
|
60
|
-
${[1, 2, 3, 4, 5].map(row => html ` <option>${row}</option> `)}
|
|
61
|
-
</select>
|
|
62
|
-
x
|
|
63
|
-
<select
|
|
64
|
-
.value=${this.columns}
|
|
65
|
-
@change=${(e) => (this.columns = Number(e.target.value))}
|
|
66
|
-
>
|
|
67
|
-
${[1, 2, 3, 4, 5].map(column => html ` <option>${column}</option> `)}
|
|
68
|
-
</select>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
|
|
72
|
-
<div id="etc">
|
|
73
|
-
<mwc-icon id="fullscreen" @click=${() => this.onTapFullscreen()} ?hidden=${this._fullscreened}
|
|
74
|
-
>fullscreen</mwc-icon
|
|
75
|
-
>
|
|
76
|
-
<mwc-icon id="fullscreen-exit" @click=${() => this.onTapFullscreen()} ?hidden=${!this._fullscreened}
|
|
77
|
-
>fullscreen_exit</mwc-icon
|
|
78
|
-
>
|
|
79
|
-
<mwc-icon id="close" @click=${() => this.onTapClose()}>close</mwc-icon>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
`;
|
|
84
|
-
}
|
|
85
|
-
firstUpdated() {
|
|
86
|
-
SwipeListener(this);
|
|
87
|
-
this.addEventListener('swipe', (e) => {
|
|
88
|
-
var directions = e.detail.directions;
|
|
89
|
-
if (directions.left) {
|
|
90
|
-
this.onTapRight();
|
|
91
|
-
}
|
|
92
|
-
else if (directions.right) {
|
|
93
|
-
this.onTapLeft();
|
|
94
|
-
}
|
|
95
|
-
else if (directions.top) {
|
|
96
|
-
this.onTapDown();
|
|
97
|
-
}
|
|
98
|
-
else if (directions.bottom) {
|
|
99
|
-
this.onTapUp();
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
updated(changes) {
|
|
104
|
-
if (changes.has('boards') || changes.has('columns') || changes.has('rows')) {
|
|
105
|
-
this.boards && this.boards.length > 0 ? this.restart() : this.stop();
|
|
106
|
-
}
|
|
107
|
-
else if (changes.has('playtime') && this.playing) {
|
|
108
|
-
this._resetTransformTimer();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
async _resetFadeTimer(stop) {
|
|
112
|
-
if (!this._controlAnimation) {
|
|
113
|
-
this._controlAnimation = this._control.animate([
|
|
114
|
-
{
|
|
115
|
-
opacity: 1,
|
|
116
|
-
easing: 'ease-in'
|
|
117
|
-
},
|
|
118
|
-
{ opacity: 0 }
|
|
119
|
-
], { delay: 1000, duration: 2000 });
|
|
120
|
-
}
|
|
121
|
-
this._control.hidden = false;
|
|
122
|
-
this._controlAnimation.cancel();
|
|
123
|
-
if (stop)
|
|
124
|
-
return;
|
|
125
|
-
try {
|
|
126
|
-
this._controlAnimation.play();
|
|
127
|
-
await this._controlAnimation.finished;
|
|
128
|
-
this._control.hidden = true;
|
|
129
|
-
}
|
|
130
|
-
catch (e) {
|
|
131
|
-
/* cancelled */
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
_resetTransformTimer() {
|
|
135
|
-
clearTimeout(this._transferTimer);
|
|
136
|
-
this.playing = true;
|
|
137
|
-
if (this._currentPlayer) {
|
|
138
|
-
this._transferTimer = setTimeout(() => {
|
|
139
|
-
if (this._transferTimer)
|
|
140
|
-
this._currentPlayer.next();
|
|
141
|
-
}, this.playtime * 1000);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
onMousemove() {
|
|
145
|
-
this._resetFadeTimer();
|
|
146
|
-
}
|
|
147
|
-
onMouseoverControl() {
|
|
148
|
-
this._resetFadeTimer(true);
|
|
149
|
-
}
|
|
150
|
-
onTapFullscreen() {
|
|
151
|
-
togglefullscreen(this, () => {
|
|
152
|
-
this._fullscreened = true;
|
|
153
|
-
this.focus();
|
|
154
|
-
}, () => {
|
|
155
|
-
this._fullscreened = false;
|
|
156
|
-
this.focus();
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
onTransform() {
|
|
160
|
-
requestAnimationFrame(() => this.started && this.playing && this._resetTransformTimer());
|
|
161
|
-
}
|
|
162
|
-
onTapPlay() {
|
|
163
|
-
this._resetTransformTimer();
|
|
164
|
-
}
|
|
165
|
-
onTapPause() {
|
|
166
|
-
clearTimeout(this._transferTimer);
|
|
167
|
-
this.playing = false;
|
|
168
|
-
}
|
|
169
|
-
onTapLeft() {
|
|
170
|
-
this._currentPlayer.axis = 'y';
|
|
171
|
-
this._currentPlayer.previous();
|
|
172
|
-
}
|
|
173
|
-
onTapRight() {
|
|
174
|
-
this._currentPlayer.axis = 'y';
|
|
175
|
-
this._currentPlayer.next();
|
|
176
|
-
}
|
|
177
|
-
onTapUp() {
|
|
178
|
-
this._currentPlayer.axis = 'x';
|
|
179
|
-
this._currentPlayer.next();
|
|
180
|
-
}
|
|
181
|
-
onTapDown() {
|
|
182
|
-
this._currentPlayer.axis = 'x';
|
|
183
|
-
this._currentPlayer.previous();
|
|
184
|
-
}
|
|
185
|
-
onTapClose() {
|
|
186
|
-
if (this._fullscreened) {
|
|
187
|
-
exitfullscreen();
|
|
188
|
-
}
|
|
189
|
-
window.history.back();
|
|
190
|
-
}
|
|
191
|
-
async restart() {
|
|
192
|
-
await this.stop();
|
|
193
|
-
await this.start();
|
|
194
|
-
}
|
|
195
|
-
async start() {
|
|
196
|
-
if (!this.boards || this.boards.length == 0)
|
|
197
|
-
return;
|
|
198
|
-
this.started = true;
|
|
199
|
-
this.playing = true;
|
|
200
|
-
await this.updateComplete;
|
|
201
|
-
this._currentPlayer = this.renderRoot.querySelector(':not([style*="display: none"])[player]');
|
|
202
|
-
this._resetTransformTimer();
|
|
203
|
-
this._resetFadeTimer();
|
|
204
|
-
this.focus();
|
|
205
|
-
}
|
|
206
|
-
async stop() {
|
|
207
|
-
clearTimeout(this._transferTimer);
|
|
208
|
-
this._currentPlayer && this._currentPlayer.stop();
|
|
209
|
-
this.started = false;
|
|
210
|
-
/**
|
|
211
|
-
* this.started = false 로 인한 update를 강제하기 위함임.
|
|
212
|
-
* this.start() 가 바로 호출되어 this.started 의 변화가 render에 반영되지 않을 수 있으므로.
|
|
213
|
-
*/
|
|
214
|
-
await this.updateComplete;
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
BoardPlayer.styles = style;
|
|
218
|
-
__decorate([
|
|
219
|
-
property({ type: Array })
|
|
220
|
-
], BoardPlayer.prototype, "boards", void 0);
|
|
221
|
-
__decorate([
|
|
222
|
-
property({ type: Number })
|
|
223
|
-
], BoardPlayer.prototype, "playtime", void 0);
|
|
224
|
-
__decorate([
|
|
225
|
-
property({ type: Number })
|
|
226
|
-
], BoardPlayer.prototype, "columns", void 0);
|
|
227
|
-
__decorate([
|
|
228
|
-
property({ type: Number })
|
|
229
|
-
], BoardPlayer.prototype, "rows", void 0);
|
|
230
|
-
__decorate([
|
|
231
|
-
property({ type: Boolean })
|
|
232
|
-
], BoardPlayer.prototype, "started", void 0);
|
|
233
|
-
__decorate([
|
|
234
|
-
property({ type: Boolean })
|
|
235
|
-
], BoardPlayer.prototype, "playing", void 0);
|
|
236
|
-
__decorate([
|
|
237
|
-
property({ type: Object })
|
|
238
|
-
], BoardPlayer.prototype, "provider", void 0);
|
|
239
|
-
__decorate([
|
|
240
|
-
state()
|
|
241
|
-
], BoardPlayer.prototype, "_controlAnimation", void 0);
|
|
242
|
-
__decorate([
|
|
243
|
-
state()
|
|
244
|
-
], BoardPlayer.prototype, "_transferTimer", void 0);
|
|
245
|
-
__decorate([
|
|
246
|
-
state()
|
|
247
|
-
], BoardPlayer.prototype, "_currentPlayer", void 0);
|
|
248
|
-
__decorate([
|
|
249
|
-
state()
|
|
250
|
-
], BoardPlayer.prototype, "_fullscreened", void 0);
|
|
251
|
-
__decorate([
|
|
252
|
-
query('#control')
|
|
253
|
-
], BoardPlayer.prototype, "_control", void 0);
|
|
254
|
-
BoardPlayer = __decorate([
|
|
255
|
-
customElement('ox-board-player')
|
|
256
|
-
], BoardPlayer);
|
|
257
|
-
export { BoardPlayer };
|
|
258
|
-
//# sourceMappingURL=ox-board-player%20copy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-board-player copy.js","sourceRoot":"","sources":["../../src/ox-board-player copy.ts"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAA;AACtD,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,M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IAAI,CAAC,KAAK,EAAE,CAAA;IACd,CAAC;IAED,KAAK,CAAC,IAAI;QACR,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QAEjC,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAA;QACjD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QAEpB;;;WAGG;QACH,MAAM,IAAI,CAAC,cAAc,CAAA;IAC3B,CAAC;CACF,CAAA;AAtPQ,kBAAM,GAAG,KAAK,CAAA;AAEM;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;2CAAwB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAS;AACP;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAgB;AACf;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAgB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAc;AAEhC;IAAR,KAAK,EAAE;sDAA8B;AAC7B;IAAR,KAAK,EAAE;mDAAqB;AACpB;IAAR,KAAK,EAAE;mDAAqB;AACpB;IAAR,KAAK,EAAE;kDAAsB;AAEX;IAAlB,KAAK,CAAC,UAAU,CAAC;6CAAuB;AAhB9B,WAAW;IADvB,aAAa,CAAC,iBAAiB,CAAC;GACpB,WAAW,CAuPvB;SAvPY,WAAW","sourcesContent":["import '@material/mwc-fab'\nimport '@material/mwc-icon'\nimport './ox-board-wrapper'\nimport './player/board-player-carousel'\n\nimport { LitElement, PropertyValues, 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')\nexport class BoardPlayer extends LitElement {\n static styles = style\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"]}
|
|
@@ -1,39 +0,0 @@
|
|
|
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 BoardPlayerControl 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
|
-
onTapPlay(): void;
|
|
30
|
-
onTapPause(): void;
|
|
31
|
-
onTapLeft(): void;
|
|
32
|
-
onTapRight(): void;
|
|
33
|
-
onTapUp(): void;
|
|
34
|
-
onTapDown(): void;
|
|
35
|
-
onTapClose(): void;
|
|
36
|
-
restart(): Promise<void>;
|
|
37
|
-
start(): Promise<void>;
|
|
38
|
-
stop(): Promise<void>;
|
|
39
|
-
}
|