editor.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <!DOCTYPE html>
  2. <style>
  3. html {
  4. box-sizing: border-box;
  5. }
  6. *, *:before, *:after {
  7. box-sizing: inherit;
  8. }
  9. body {
  10. margin: 0;
  11. font-family: sans-serif;
  12. overflow: hidden;
  13. height: 100vh;
  14. }
  15. a {
  16. text-decoration: none;
  17. color: inherit;
  18. }
  19. iframe {
  20. display: block;
  21. border: none;
  22. }
  23. .frame {
  24. min-width: 100vw;
  25. min-height: 100vh;
  26. max-width: 100vw;
  27. max-height: 100vh;
  28. display: flex;
  29. flex-direction: column;
  30. background: #444;
  31. color: #AAA;
  32. }
  33. .tabs {
  34. flex: 0 0 auto;
  35. display: flex;
  36. justify-content: space-between;
  37. align-items: center;
  38. background: #666;
  39. }
  40. .panes {
  41. display: flex;
  42. flex: 1 1 auto;
  43. }
  44. .panes>div {
  45. display: none;
  46. flex: 1 1 50%;
  47. position: relative;
  48. overflow: hidden;
  49. /*
  50. this calc is to get things to work in safari.
  51. but firefox and chrome will let chidren of
  52. the panes go 100% size but not safarai
  53. */
  54. height: calc(100vh - 2.5em - 5px - 1px);
  55. }
  56. .panes>div.other {
  57. display: block
  58. }
  59. .editor {
  60. g-overflow: auto;
  61. }
  62. .result {
  63. overflow: auto;
  64. }
  65. .result>iframe {
  66. width: 100%;
  67. height: 100%;
  68. background: white;
  69. }
  70. .other>div,
  71. .other>div>div {
  72. display: flex;
  73. justify-content: center;
  74. align-items: center;
  75. align-content: center;
  76. font-size: xx-large;
  77. }
  78. .other>div {
  79. height: 100%;
  80. flex-direction: column;
  81. }
  82. .other .loading {
  83. height: 2em;
  84. width: 2em;
  85. animation: rotate 0.8s infinite linear;
  86. border: 0.4em solid #fff;
  87. border-right-color: transparent;
  88. border-radius: 50%;
  89. }
  90. @keyframes rotate {
  91. 0% { transform: rotate(0deg); }
  92. 100% { transform: rotate(360deg); }
  93. }
  94. .tabs>div {
  95. padding: 0.125em;
  96. }
  97. .panebuttons>button {
  98. padding: 0.5em;
  99. border: none;
  100. background: #AAA;
  101. border-bottom: 5px solid black;
  102. margin: 0.25em;
  103. width: 5em;
  104. }
  105. .panebuttons>button:focus {
  106. outline: none;
  107. }
  108. .panelogo {
  109. font-size: medium;
  110. }
  111. .panelogo>*>* {
  112. vertical-align: middle;
  113. display: inline-block;
  114. color: #CCC;
  115. }
  116. .show {
  117. background: #FFF !important;
  118. border-bottom: none !important;
  119. border-top: 5px solid #666 !important;
  120. }
  121. .button-result {
  122. margin-left: 2em !important;
  123. }
  124. .panebuttons>.button-fullscreen {
  125. background-image: url(editor-fullscreen-icon.svg);
  126. background-size: 80% 80%;
  127. background-position: center center;
  128. background-repeat: no-repeat no-repeat;
  129. }
  130. .fullscreen .panebuttons>.button-fullscreen {
  131. background-image: url(editor-unfullscreen-icon.svg) !important;
  132. }
  133. @media ( max-width: 740px ) {
  134. .panelogo>div>a:nth-child(1) {
  135. display: none;
  136. }
  137. }
  138. @media ( max-width: 590px ) {
  139. .tabs {
  140. display: none;
  141. }
  142. .panes>div {
  143. display: none !important;
  144. height: auto;
  145. }
  146. .panes>.result {
  147. display: block !important;
  148. }
  149. }
  150. </style>
  151. <body>
  152. <div class="frame">
  153. <div class="tabs">
  154. <div class="panebuttons">
  155. <button class="button-js">JS</button>
  156. <button class="button-html">HTML</button>
  157. <button class="button-css">CSS</button>
  158. <button class="button-codepen">Codepen</button>
  159. <button class="button-jsfiddle">JSFiddle</button>
  160. <button class="button-result">Result</button>
  161. <button class="button-run">Run</button>
  162. <button class="button-fullscreen">&nbsp;</button>
  163. </div>
  164. <div class="panelogo">
  165. <div><a href="/">threejsfundamentals&nbsp;</a><a href="/"><img src="/threejs/lessons/resources/threejsfundamentals-icon-256.png" width="32" height="32"/></a></div>
  166. </div>
  167. </div>
  168. <div class="panes">
  169. <div class="js"></div>
  170. <div class="html"></div>
  171. <div class="css"></div>
  172. <div class="result"><iframe></iframe></div>
  173. <div class="other">
  174. <div>
  175. <div><a href="/">threejsfundamentals&nbsp;</a><a href="/"><img src="/threejs/lessons/resources/threejsfundamentals-icon-256.png" width="64" height="64"/></a></div>
  176. <div class="loading">
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. </div>
  182. </body>
  183. <script src="/monaco-editor/min/vs/loader.js"></script>
  184. <script src="editor.js"></script>