| @@ -166,12 +166,12 @@ const StreamContainer = { | |||
| display: 'grid', | |||
| padding: '3px', | |||
| gridGap: '3px', | |||
| height: '70vh', | |||
| height: '90vh', | |||
| gridTemplateRows: dims[0], | |||
| gridTemplateColumns: dims[1], | |||
| } | |||
| return m('div', | |||
| m('.video-controls', | |||
| return [ | |||
| m('span.video-controls', | |||
| m('button', {onclick: VideoConfig.toggle('videoOn')}, 'video'), | |||
| m('button', {onclick: VideoConfig.toggle('audioOn')}, 'audio'), | |||
| ), | |||
| @@ -180,7 +180,7 @@ const StreamContainer = { | |||
| State.online.filter(username => username != State.username) | |||
| .map(username => m(Video, {username})) | |||
| ), | |||
| ) | |||
| ] | |||
| }, | |||
| } | |||
| @@ -6,11 +6,6 @@ | |||
| <script src="/libs/mithril.min.js"></script> | |||
| <script src="/apps/streams.js"></script> | |||
| <script src="/pico.js" defer></script> | |||
| <style> | |||
| .hidden { | |||
| display: none; | |||
| } | |||
| </style> | |||
| </head> | |||
| <body style="margin: 0; padding: 0;"> | |||
| <div>PicoChat requires JS</div> | |||
| @@ -79,19 +79,22 @@ const Base = { | |||
| autocomplete: 'off', | |||
| value: localStorage.username, | |||
| } | |||
| const style = { | |||
| display: 'inline', | |||
| } | |||
| return m('main', | |||
| m('.login-container', | |||
| m('form.login' + (State.isConnected ? '.hidden' : ''), | |||
| {onsubmit: Base.sendLogin}, | |||
| m('span.login-container', | |||
| State.isConnected ? null : m('form.login', | |||
| {style, onsubmit: Base.sendLogin}, | |||
| m('input', attrs), | |||
| m('button', 'Login'), | |||
| ), | |||
| m('form.logout' + (State.isConnected ? '' : '.hidden'), | |||
| {onsubmit: Base.sendLogout}, | |||
| State.isConnected ? m('form.logout', | |||
| {style, onsubmit: Base.sendLogout}, | |||
| m('button', 'Logout'), | |||
| m('input[readonly]', {value: location}), | |||
| ), | |||
| m('.error', State.info), | |||
| ) : null, | |||
| m('span.error', State.info), | |||
| ), | |||
| State.isConnected ? m(StreamContainer) : null, | |||
| ) | |||