Skip to content

Commit ee15228

Browse files
committed
initial UI skeleton
0 parents  commit ee15228

File tree

5 files changed

+103
-0
lines changed

5 files changed

+103
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
node_modules

demo.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
var adventureTime = require('./')
2+
3+
adventureTime()

index.html

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE HTML>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>dat adventure</title>
6+
<style type="text/css">
7+
.CodeMirror { font-size: 12px; height: 100% !important; }
8+
.CodeMirror-scroll { height: 100%; }
9+
.CodeMirror div.CodeMirror-selected { background: rgba(0,0,0,0.1); }
10+
.CodeMirror-focused div.CodeMirror-selected { background: rgba(0,0,255,0.1); }
11+
.CodeMirror .errorLine { background: rgba(255,0,0,0.25); }
12+
.container { }
13+
.editor {
14+
position: absolute;
15+
top: 50%;
16+
left: 25%;
17+
right: 0;
18+
bottom: 0;
19+
}
20+
.guide {
21+
background: #e2e2e2;
22+
position: absolute;
23+
top: 0;
24+
left: 0;
25+
right: 0;
26+
bottom: 50%;
27+
}
28+
.tree {
29+
position: absolute;
30+
top: 50%;
31+
left: 0;
32+
right: 75%;
33+
bottom: 0;
34+
}
35+
</style>
36+
</head>
37+
<body>
38+
<div class="container editor"></div>
39+
<div class="container tree"></div>
40+
<div class="container guide"></div>
41+
<script src="demo.js" type="text/javascript"></script>
42+
</body>
43+
</html>

index.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var treeView = require('tree-view')
2+
var edit = require('edit')
3+
var flatui = require('flatui')
4+
var defaultcss = require('defaultcss')
5+
6+
module.exports = function() {
7+
var editorDiv = document.querySelector('.editor')
8+
var treeDiv = document.querySelector('.tree')
9+
// insert the flatui stylesheet into the DOM if it doesnt already exist on the page
10+
defaultcss(flatui)
11+
// instantiate the editor
12+
edit({container: editorDiv})
13+
14+
var tree = treeView()
15+
tree.appendTo(treeDiv)
16+
17+
tree.directory('/', [{
18+
path: '/foo',
19+
type: 'directory'
20+
}, {
21+
path: '/bar',
22+
type: 'directory'
23+
}, {
24+
path: '/baz',
25+
type: 'file'
26+
}])
27+
}

package.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "adventure-time",
3+
"version": "1.0.0",
4+
"description": "a web UI for doing nodeschool adventures in the browser",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "beefy demo.js"
8+
},
9+
"author": "max ogden",
10+
"license": "BSD",
11+
"dependencies": {
12+
"defaultcss": "^1.1.0",
13+
"edit": "^1.0.0",
14+
"tree-view": "^2.1.3"
15+
},
16+
"devDependencies": {
17+
"beefy": "^2.1.1",
18+
"browserify": "^6.1.0"
19+
},
20+
"repository": {
21+
"type": "git",
22+
"url": "git://github.com/maxogden/adventure-time.git"
23+
},
24+
"bugs": {
25+
"url": "https://github.com/maxogden/adventure-time/issues"
26+
},
27+
"homepage": "https://github.com/maxogden/adventure-time"
28+
}

0 commit comments

Comments
 (0)