-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
118 lines (108 loc) · 2.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Bitter:400,700|Open+Sans:400,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="container"></div>
<script type="text/javascript" src="DOM.Barf.js"></script>
<script type="text/javascript">
var _s = DOM.Barf;
_s.h1 = _s.toSpit("h1");
_s.h2 = _s.toSpit("h2");
_s.h3 = _s.toSpit("h3");
_s.h4 = _s.toSpit("h4");
_s.span = _s.toSpit("span");
var layout = {
sidebarWidth: 200,
headerHeight: 50,
footerHeight: 50,
};
/* css styles */
document.head.innerHTML += _s.ToRaw([
_s.title(null, "DOM.Barf Home Page"),
/* Main Stylesheet */
_s.style(null, [
_s.ToCss("*", {
margin: "0",
padding: "0",
fontFamily: "'Bitter', serif",
}),
_s.ToCss("html", {
margin: "0",
height: "100%",
}),
_s.ToCss("body", {
position: "relative",
height: "100%",
width: "100%",
}),
_s.ToCss("h1, h2, h3, h4", {
fontFamily: "'Open Sans', sans-serif",
padding: "5px",
}),
_s.ToCss("p", {
padding: "7px",
}),
_s.ToCss("a",{
color: "#67A99D",
textDecoration: "none",
}),
_s.ToCss("#container", {
position: "absolute",
height: "100%",
width: "100%",
}),
_s.ToCss("#content", {
position: "relative",
height: "100%",
width: "100%",
}),
_s.ToCss("#header", {
position: "absolute",
top: "0",
left: layout.sidebarWidth + "px",
right: 0,
height: layout.headerHeight + "px",
backgroundColor: "#D1A19F",
}),
_s.ToCss("#sidebar", {
position: "relative",
width: layout.sidebarWidth + "px",
height: "100%",
backgroundColor: "#99959C",
float: "left",
}),
_s.ToCss("#main-content", {
position: "relative",
left: layout.sidebarWidth/2 + "px",
top: layout.headerHeight + "px",
width: (window.innerWidth - layout.sidebarWidth) + "px",
padding: "20px 10px",
}),
]),
]);
var content = document.getElementById("container");
content.innerHTML += _s.div({id: "content"}, [
_s.div({id: "header"}, [
_s.h1({style: {textAlign: "center", padding: "3px", fontSize: "32px",}}, "DOM.Barf"),
]),
_s.div({id: "sidebar"}, [
]),
_s.div({id: "main-content"}, [
_s.h1(null, "Github Page"),
_s.p(null, [
_s.a({href: "https://github.com/benzap/DOM.Barf"}, "here"),
]),
]),
]);
var create_defaultButton = function(attrs, children) {
var attrs = attrs || {};
return _s.ToDOMNode(
_s.button(_s.Merge({value: "Test Button"}, attrs), children)
)
}
console.log(create_defaultButton({value: "New button"}, "test"));
</script>
</body>
</html>