-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
167 lines (113 loc) · 6 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!doctype html>
<html lang=en >
<head>
<meta charset=utf-8 >
<title>📈 Jaanga SP500</title>
<meta name=viewport content='width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no' >
<meta name=description content='A variety of tools to browse and view all S&P 500 symbols all at once.' >
<meta name=keywords content='Three.js,WebGL,CSS,HTML,JavaScript,GitHub,FOSS' >
<meta name=date content='2017-03-26' >
</head>
<body>
<script src=https://cdn.rawgit.com/showdownjs/showdown/master/dist/showdown.min.js ></script>
<script src=tootoo-7.js ></script>
<script>
// Copyright © 2017 PushMe PullYou authors. MIT license
// https://github.com/showdownjs/showdown
let user = {
user : 'jaanga',
subText : 'Your S&P 500 happy place',
repo : 'sp500',
branch : 'gh-pages',
folder : '',
noIndex : true
};
init();
function init() {
let css, container, contents, hamburger, menu;
const b = '<br>';
css = document.body.appendChild( document.createElement('style') );
css.innerHTML =
'html, body { font: 12pt monospace; height: 100%; margin: 0; }' +
'a { color: crimson; text-decoration: none; }' +
'a:hover { text-decoration: underline; }' +
'button, input[type=button] { background-color: #ccc; border: 2px #fff solid; color: #322; }' +
'pre, blockquote { background-color: #eee; padding: 10px; }' +
'summary { outline: none; }' +
'summary h3 { display: inline; }' +
'.popUp { background-color: white; border: 1px solid red; left: 180px; opacity: 1.0; padding: 5px; position: absolute; width: 120px; z-index: 10; }' +
'#bars { color: crimson; cursor: pointer; font-size: 24pt; text-decoration: none; }' +
'#container { height: 100%; left: 0; position: absolute; transition: left 1s; width: 100%; }' +
// let each type of contents decide its best width and placement
'#contents { border: 0px #ccc solid; height: 100%; left: 325px; position: absolute; width: ' + ( window.innerWidth - 325 ) + 'px; }' +
'#editButton { background-color: #555; color: #fff; opacity: 0.5; padding: 8px; position: fixed; right: 20px; top: 20px; }' +
'#editButton:hover { cursor: pointer; opacity: 1; }' +
'#editButton a { text-decoration: none; color: #fff; }' +
'#hamburger { background-color: #eee; left: 325px; position: absolute; top: 20px; z-index: 1 }' +
'#hamburger h2 { margin: 0;}' +
'#menu { background-color: #eee; border: 1px #ccc solid; box-sizing:border-box; height: 100%; overflow-y: auto; padding: 0 10px; position: fixed; width: 325px; }' +
'#menu h2, #menu h4 {margin: 0; }' +
'#menuBreadcrumbs h2, #menuBreadcrumbs h3 { font-size: 14pt; margin: 0; }' +
'#nextFile { color: #888; font-size: 36pt; opacity: 0.5; padding: 8px; position: fixed; right: 20px; top: ' + (0.5 * window.innerHeight ) + 'px; }' +
'#nextFile:hover { cursor: pointer; opacity: 1; }' +
'#nextFile a { text-decoration: none; color: #888; }' +
'#previousFile { color: #888; font-size: 36pt; opacity: 0.5; padding: 8px; position: fixed; margin-left: 350px; top: ' + (0.5 * window.innerHeight ) + 'px; }' +
'#previousFile:hover { cursor: pointer; opacity: 1; }' +
'#previousFile a { text-decoration: none; color: #888; }' +
'';
container = document.body.appendChild( document.createElement( 'div' ) );
container.id = 'container';
container.innerHTML =
'<div id=menu >' +
'<h2>' +
'<a href=https://' + user.user + '.github.io/ title="' + user.subText + '" > ❦ </a>' + b +
'<a href="" title="Click here to refresh this page" >' + document.title + '</a>' +
// ' ~ <a href="https://github.com/pushme-pullyou/pushme-pullyou.github.io/tree/master/tootoo/" onmouseover=popHelp.style.display=""; onmouseout=popHelp.style.display="none"; > ⓘ </a>' +
' ~ <a href="https://github.com/' + user.user + '/' + user.repo + '" onmouseover=popHelp.style.display=""; onmouseout=popHelp.style.display="none"; > ⓘ </a>' +
'</h2>' +
'<div class=popUp id=popHelp style=display:none; ><div>Hi there!</div>Click the i-in-circle, info icon for latest updates.</div>' +
'<p><small>' + document.head.querySelector( "[name=description]" ).content + '</small></p>' +
'<details open>' +
'<summary><h3 id=menuTitle >Menu</h3></summary>' +
'<div id=menuBreadcrumbs ></div>' + b +
'<div id=menuItems ></div>' + b +
'</details>' +
'<details>' +
'<summary><h3>Current File Info</h3></summary>' +
'<div id=menuFileData ></div>' + b +
'<div id=menuInfo ></div>' + b +
'</details>' +
TOO.menuSettings +
'<details>' +
'<summary><h3>About</h3></summary>' +
'<p>Copyright © ' + ( new Date() ).getFullYear() + ' ' + user.user + ' authors. ' +
'<a href=http://github.com/' + user.user + '/' + user.repo + ' >MIT license</a>.</p>' +
'<p>Click the \'i in a circle\' icon for more <a href=index.html#readme.md title="Click here for help and information" >help</a>.</p>' +
'</details>' +
'<hr>' +
'<center><a href=javascript:menu.scrollTop=0; style=text-decoration:none; onmouseover=pop2.style.display=""; onmouseout=pop2.style.display="none"; ><h1> ❦ <h1></a></center>' +
'<div class=popUp id=pop2 style=display:none;bottom:20px; >' + user.user + ' - ' + user.subText + '.<br>Click here to return to the top of the page</div>' +
'</div>' +
'<div id=hamburger onclick=container.style.left=container.style.left===""?"-325px":""; >' +
'<div id=bars title="Click this hamburger to slide the menu" > ☰ </div>' +
'</div>' +
'<div id=contents ></div>' +
'';
window.addEventListener( 'resize', onWindowResize, false );
onWindowResize();
if ( location.hash ) {
path = location.hash.slice( 1 ).split( '/');
TOO.file = path.pop();
TOO.path = path.join();
//console.log( 'TOO.path', TOO.path );
//console.log( 'TOO.file', TOO.file );
}
TOO.init( user );
}
function onWindowResize() {
if ( window.self !== window.top || window.innerWidth < 500 ) { container.style.left = '-325px'; }
contents.style.width = window.innerWidth - 350;
}
</script>
</body>
</html>