git ssb

16+

Dominic / patchbay



Commit 7cf35de753155a880bece2498dee7cb02c01f251

add basic css

Dominic Tarr committed on 5/14/2016, 12:04:33 PM
Parent: d6467d3650ae378a0c0509253c2ab80b74c89e7b

Files changed

index.jschanged
modules/compose.jsadded
style.cssadded
index.jsView
@@ -4,8 +4,10 @@
44 var combine = require('depject')
55 var fs = require('fs')
66 var path = require('path')
77
8+document.head.appendChild(h('style', fs.readFileSync('./style.css', 'utf8')))
9+
810 var modules = fs.readdirSync(path.join(__dirname, 'modules'))
911 .map(function (e) { return require('./modules/'+e) })
1012
1113 var renderers = []
modules/compose.jsView
@@ -1,0 +1,18 @@
1+var h = require('hyperscript')
2+//this decorator expects to be the first
3+exports.message_compose = function (el, meta, sbot) {
4+ if(el) return el
5+
6+ meta = meta || {}
7+ var ta = h('pre.editable.fixed', 'HELLO')
8+ ta.setAttribute('contenteditable', '')
9+
10+ return h('div', h('div.column', ta,
11+ h('button', 'publish', {onclick: function () {
12+ meta.text = ta.innerText || ta.textContent
13+ alert(JSON.stringify(meta, null, 2))
14+ }})))
15+}
16+
17+
18+
style.cssView
@@ -1,0 +1,103 @@
1+
2+
3+.screen {
4+ position: absolute;
5+ top: 0px; bottom: 0px;
6+ background: red;
7+}
8+
9+.column {
10+ display: flex;
11+ flex-direction: column;
12+// background: yellow;
13+ margin: 10px;
14+}
15+
16+.row {
17+ display: flex;
18+ flex-direction: row;
19+}
20+
21+.stretch {
22+ flex-basis: 0;
23+// flex-grow: 1;
24+// flex-shrink: 1;
25+}
26+
27+
28+.fixed {
29+ flex-grow: 1;
30+ flex-shrink: 1;
31+}
32+
33+.scroll-y {
34+ overflow-y: auto;
35+}
36+
37+.scroll-x {
38+ overflow-x: auto;
39+}
40+
41+.button {
42+ border: 2px; margin: 3px;
43+ max-width: 50px;
44+ overflow-x: hidden;
45+}
46+
47+
48+img {
49+ max-width: 600px;
50+ display: block;
51+// overflow-x: auto;
52+}
53+
54+pre {
55+ max-width: 650px;
56+ overflow-x: auto;
57+}
58+
59+.content {
60+ width: 800px;
61+}
62+
63+.content > div {
64+ overflow-x: show;
65+ margin-left: auto;
66+ margin-right: auto;
67+}
68+
69+.content > div > * {
70+ max-width: 600px;
71+}
72+
73+.tabs > .row {
74+ flex-grow: 0; flex-shrink: 0;
75+ margin: 10px;
76+}
77+
78+.tabs > .row > * {
79+ max-width: 50px;
80+ overflow-x: hidden;
81+ margin-right: 5px;
82+}
83+
84+.tabs > .row > .selected {
85+ max-width: 200px;
86+ background: yellow;
87+}
88+
89+.message {
90+ border: 1px solid black;
91+ padding: 5px;
92+ background: white;
93+ display: block;
94+ flex-basis: 0;
95+}
96+
97+.message > .title > .message_meta {
98+ margin-right: 5px;
99+}
100+.message > .title > .avatar {
101+ margin-right: 5px;
102+}
103+

Built with git-ssb-web