}, | }, | ||||
view() { | view() { | ||||
const dims = [StreamContainer.getRows(), StreamContainer.getColumns()] | const dims = [StreamContainer.getRows(), StreamContainer.getColumns()] | ||||
if(screen.height > screen.width) dims.reverse() | |||||
if(document.body.clientHeight > document.body.clientWidth) dims.reverse() | |||||
const style = { | const style = { | ||||
overflow: 'hidden', | overflow: 'hidden', | ||||
display: 'grid', | display: 'grid', |
* SIGNALING | * SIGNALING | ||||
* | * | ||||
*/ | */ | ||||
addEventListener('resize', () => m.redraw()) | |||||
const wire = (message) => State.websocket.send(JSON.stringify(message)) | const wire = (message) => State.websocket.send(JSON.stringify(message)) | ||||
const signal = (message) => dispatchEvent(new CustomEvent(message.kind, {detail: message})) | const signal = (message) => dispatchEvent(new CustomEvent(message.kind, {detail: message})) | ||||
const listen = (kind, handler) => { | const listen = (kind, handler) => { |