index.html 2.8 KB

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