index.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>three.js - documentation</title>
  6. <style>
  7. @font-face {
  8. font-family: 'inconsolata';
  9. src: url('files/inconsolata.woff') format('woff');
  10. font-weight: normal;
  11. font-style: normal;
  12. }
  13. html {
  14. height: 100%;
  15. }
  16. body {
  17. margin: 0;
  18. padding: 0;
  19. height: 100%;
  20. color: #555;
  21. font-family: 'inconsolata';
  22. font-size: 15px;
  23. overflow: hidden;
  24. }
  25. a {
  26. color: #2194CE;
  27. }
  28. #panel {
  29. position: fixed;
  30. width: 260px;
  31. height: 100%;
  32. overflow: auto;
  33. }
  34. #panel h1 {
  35. color: #333;
  36. font-size: 25px;
  37. font-weight: normal;
  38. margin-top: 25px;
  39. margin-left: 20px;
  40. }
  41. #panel h2 {
  42. color: #454545;
  43. font-size: 18px;
  44. font-weight: normal;
  45. margin-top: 20px;
  46. margin-left: 20px;
  47. }
  48. #panel h3 {
  49. color: #666;
  50. font-size: 16px;
  51. font-weight: normal;
  52. margin-top: 20px;
  53. margin-left: 20px;
  54. }
  55. #panel ul {
  56. list-style-type: none;
  57. padding: 0px;
  58. margin-left: 20px;
  59. }
  60. #viewer {
  61. border: 0px;
  62. margin-left: 260px;
  63. width: -webkit-calc(100% - 260px);
  64. width: -moz-calc(100% - 260px);
  65. width: calc(100% - 260px);
  66. height: 100%;
  67. overflow: auto;
  68. }
  69. </style>
  70. </head>
  71. <body>
  72. <div id="panel"></div>
  73. <iframe id="viewer"></iframe>
  74. <script src="list.js"></script>
  75. <script>
  76. var REVISION = '51';
  77. var panel = document.getElementById( 'panel' );
  78. var viewer = document.getElementById( 'viewer' );
  79. var html = '<h1>three.js<span style="font-size: 50%; vertical-align: super;"> r' + REVISION + '</span></h1>';
  80. for ( var section in list ) {
  81. html += '<h2>' + section + '</h2>';
  82. html += '<ul>';
  83. for ( var category in list[ section ] ) {
  84. html += '<h3>' + category + '</h3>';
  85. html += '<ul>';
  86. for ( var i = 0; i < list[ section ][ category ].length; i ++ ) {
  87. var page = list[ section ][ category ][ i ];
  88. html += '<li><a href="javascript:goTo(\'' + section + '\', \'' + category + '\', \'' + page[ 0 ] + '\')">' + page[ 0 ] + '</a></li>';
  89. }
  90. html += '</ul>';
  91. }
  92. html += '</ul>';
  93. }
  94. panel.innerHTML += html;
  95. // Page loading
  96. function goTo( section, category, name ) {
  97. var path = pages[ section ][ category ][ name ];
  98. window.document.title = 'three.js - documentation - ' + section + ': ' + name;
  99. window.location.hash = section + '/' + category + '/' + name;
  100. section = section.toLowerCase();
  101. viewer.src = section + '/' + path + '.html';
  102. }
  103. function goToHash() {
  104. var hash = window.location.hash.substring( 1 ).split('/');
  105. goTo( hash[0], hash[1], hash[2] );
  106. }
  107. window.addEventListener( 'hashchange', goToHash, false );
  108. if ( window.location.hash.length > 0 ) goToHash();
  109. </script>
  110. </body>
  111. </html>