瀏覽代碼

Layout change

master
Roderic Day 4 年之前
父節點
當前提交
d8c162e0d6
共有 3 個文件被更改,包括 27 次插入16 次删除
  1. +1
    -0
      apps/streams.js
  2. +13
    -3
      pico.html
  3. +13
    -13
      pico.js

+ 1
- 0
apps/streams.js 查看文件

@@ -200,6 +200,7 @@ const StreamContainer = {
if(innerHeight > innerWidth) dims.reverse()
const style = {
backgroundColor: 'black',
height: '100%',
overflow: 'hidden',
display: 'grid',
gridTemplateRows: dims[0],

+ 13
- 3
pico.html 查看文件

@@ -13,7 +13,17 @@
<!-- <script src="/apps/volume.js"></script> -->
<!-- <script src="/apps/screen.js"></script> -->
</head>
<body style="margin: 0; padding: 0;">
<div>PicoChat requires JS</div>
</body>
<style>
body {
margin: 0;
padding: 0;
position: fixed;
width: 100%;
height: 100%;
display: grid;
grid-template-rows: auto 1fr;
overflow: hidden;
}
</style>
<body>PicoChat requires JS</body>
</html>

+ 13
- 13
pico.js 查看文件

@@ -175,33 +175,33 @@ const Base = {
autocomplete: 'off',
value: localStorage.username,
}
const mainStyle = {
position: 'fixed',
width: '100%',
display: 'grid',
gridTemplateRows: 'auto 1fr',
height: window.innerHeight + 'px',
overflow: 'hidden',
}
const headerStyle = {
display: 'grid',
gridAutoFlow: 'column',
justifyItems: 'start',
marginRight: 'auto',
}
return m('main', {style: mainStyle},
return [
m('header', {style: headerStyle},
State.isConnected ? Headers.map(h => m(...h)) : [
State.isConnected
? Headers.map(h => m(...h))
: [
m('form.login',
{onsubmit: Base.sendLogin},
m('input', attrs),
m('button', 're-join'),
),
],
m('span.error', State.info),
),
State.isConnected ? Apps.map(a => m(...a)) : null,
)
m('main', {style: {overflow: 'hidden'}},
State.isConnected
? Apps.map(a => m(...a))
: [
m('span.error', State.info),
m(Settings),
],
),
]
},
}
const Headers = [

Loading…
取消
儲存