Skip to content

Commit b697b0c

Browse files
committed
Added manual section to the documentation, and an introduction to Three.js
1 parent 774fa4a commit b697b0c

File tree

5 files changed

+409
-214
lines changed

5 files changed

+409
-214
lines changed

docs/index.html

+32-11
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@
5252
}
5353

5454
#panel h2 {
55+
color: #454545;
56+
font-size: 18px;
57+
font-weight: normal;
58+
59+
margin-top: 20px;
60+
margin-left: 20px;
61+
}
62+
63+
#panel h3 {
5564
color: #666;
5665
font-size: 16px;
5766
font-weight: normal;
@@ -91,17 +100,27 @@
91100

92101
var html = '<h1>three.js<span style="font-size: 50%; vertical-align: super;"> r' + REVISION + '</span></h1>';
93102

94-
for ( var category in list ) {
103+
for ( var section in list ) {
95104

96-
html += '<h2>' + category + '</h2>';
105+
html += '<h2>' + section + '</h2>';
97106

98107
html += '<ul>';
99108

100-
for ( var i = 0; i < list[ category ].length; i ++ ) {
109+
for ( var category in list[ section ] ) {
110+
111+
html += '<h3>' + category + '</h3>';
112+
113+
html += '<ul>';
114+
115+
for ( var i = 0; i < list[ section ][ category ].length; i ++ ) {
116+
117+
var page = list[ section ][ category ][ i ];
118+
119+
html += '<li><a href="javascript:goTo(\'' + section + '\', \'' + category + '\', \'' + page[ 0 ] + '\')">' + page[ 0 ] + '</a></li>';
101120

102-
var page = list[ category ][ i ];
121+
}
103122

104-
html += '<li><a href="javascript:goTo(\'' + page[ 0 ] + '\')">' + page[ 0 ] + '</a></li>';
123+
html += '</ul>';
105124

106125
}
107126

@@ -113,20 +132,22 @@
113132

114133
// Page loading
115134

116-
function goTo( name ) {
135+
function goTo( section, category, name ) {
117136

118-
var path = pages[ name ];
137+
var path = pages[ section ][ category ][ name ];
119138

120-
window.document.title = 'three.js - documentation - ' + name;
139+
window.document.title = 'three.js - documentation - ' + section + ': ' + name;
121140

122-
window.location.hash = name;
123-
viewer.src = 'api/' + path + '.html';
141+
window.location.hash = section + '/' + category + '/' + name;
142+
section = section.toLowerCase();
143+
viewer.src = section + '/' + path + '.html';
124144

125145
}
126146

127147
function goToHash() {
128148

129-
goTo( window.location.hash.substring( 1 ) );
149+
var hash = window.location.hash.substring( 1 ).split('/');
150+
goTo( hash[0], hash[1], hash[2] );
130151

131152
}
132153

0 commit comments

Comments
 (0)