index.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Babylon.js Playground</title>
  5. <meta charset='utf-8' />
  6. <meta name="viewport" content="width=device-width, user-scalable=no">
  7. <meta name="description" content="Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes">
  8. <meta name="keywords" content="Babylon.js,WebGL,3D">
  9. <meta name="google-site-verification" content="wcRjktXhF6DAjmhneKS7UatweBIkEF6QfqsNhAYbUgg" />
  10. <link rel="shortcut icon" href="https://www.babylonjs.com/favicon.ico">
  11. <link rel="stylesheet"
  12. href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" />
  13. <link rel="stylesheet" href="/css/index.css" />
  14. <link rel="stylesheet" href="/css/index_mobile.css" />
  15. </head>
  16. <body>
  17. <!-- Big screens -->
  18. <div class="navbar navBar1280 languageJS">
  19. <div class="categoryTitle">
  20. <img class="logo" src="/css/img/logo_v4.svg">
  21. <div class="version">Playground <span class="versionSub" id="mainTitle1280"></span></div>
  22. </div>
  23. <div class="category languageJS" id="JStoTSbar">
  24. <div class="buttonJStoTS languageTS" id="toTSbutton1280">TS</div>
  25. <div class="buttonJStoTS languageJS" id="toJSbutton1280">JS</div>
  26. <div class="buttonPG run removeOnDiff" id="runButton1280" title="Run&#10;(Alt+Enter)"><img
  27. src="/css/img/playButton.svg"></div>
  28. <div class="buttonPG removeOnDiff" id="saveButton1280" title="Save&#10;(Ctrl+S)"><img
  29. src="/css/img/saveButton.svg"></div>
  30. <div class="buttonPG removeOnPhone removeOnDiff" id="zipButton1280"
  31. title="Download ZIP&#10;(Ctrl+Shift+S)"><img src="/css/img/downloadButton.svg"></div>
  32. <div class="buttonPG removeOnDiff" id="newButton1280" title="Create new"><img
  33. src="/css/img/newButton.svg"></div>
  34. <div class="buttonPG removeOnPhone removeOnDiff" id="clearButton1280" title="Clear"><img
  35. src="/css/img/clearButton.svg"></div>
  36. <div class="buttonPG removeOnPhone removeOnDiff" id="diffButton1280" title="Compare"><img
  37. src="/css/img/diffButton.svg"></div>
  38. <div class="buttonPG removeOnPhone displayOnDiff" id="previousButton1280"
  39. title="Previous difference&#10;(Shift+Alt+F5)"><img src="/css/img/previousButton.svg"></div>
  40. <div class="buttonPG removeOnPhone displayOnDiff" id="nextButton1280"
  41. title="Next difference&#10;(Alt+F5)"><img src="/css/img/nextButton.svg"></div>
  42. <div class="buttonPG removeOnPhone displayOnDiff" id="exitButton1280" title="Exit&#10;(Esc)"><img
  43. src="/css/img/exitButton.svg"></div>
  44. <div class="buttonPG select removeOnDiff" id="menuButton1280" title="Options"><img
  45. src="/css/img/optionsButton.svg">
  46. <div class="toDisplay languageJS">
  47. <div class="option subSelect">Theme <i class="fa fa-chevron-right" aria-hidden="true"></i>
  48. <div class="toDisplaySub languageJS">
  49. <div class="option selected" id="darkTheme1280">Dark</div>
  50. <div class="option" id="lightTheme1280">Light</div>
  51. </div>
  52. </div>
  53. <div class="option subSelect">Font size <i class="fa fa-chevron-right" aria-hidden="true"></i>
  54. <div class="toDisplaySub displayFontSize languageJS">
  55. <div class="option">12</div>
  56. <div class="option selected">14</div>
  57. <div class="option">16</div>
  58. <div class="option">18</div>
  59. <div class="option">20</div>
  60. <div class="option">22</div>
  61. </div>
  62. </div>
  63. <div class="option noSubSelect" id="safemodeToggle1280">Safe mode
  64. <i class="fa fa-square" aria-hidden="true"></i>
  65. </div>
  66. <div class="option checked noSubSelect" id="editorButton1280">Editor
  67. <i class="fa fa-check-square" aria-hidden="true"></i>
  68. </div>
  69. <div class="option noSubSelect" id="fullscreenButton1280">Fullscreen</div>
  70. <div class="option noSubSelect" id="editorFullscreenButton1280">Editor Fullscreen</div>
  71. <div class="option noSubSelect" id="formatButton1280">Format code</div>
  72. <div class="option noSubSelect" id="minimapToggle1280">Minimap
  73. <i class="fa fa-square" aria-hidden="true"></i>
  74. </div>
  75. <div class="option subSelect" id="qrCodeHover1280">QR Code Link <i class="fa fa-chevron-right"
  76. aria-hidden="true"></i>
  77. <div class="toDisplaySub qrCodeImage">
  78. <div class="option" id="qrCodeImage1280">[QR Code Image]</div>
  79. </div>
  80. </div>
  81. <div class="option uncheck noSubSelect" id="debugButton1280">Inspector</div>
  82. <div class="option nosubselect" id="metadataButton1280">Metadata</div>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="category right">
  87. <div class="buttonPG select removeOnDiff" title="Select Babylon.js version">
  88. <span id="currentVersion1280"></span>
  89. <div class="toDisplay currentVersionDisplay" style="display: none"></div>
  90. </div>
  91. <div class="buttonPG select removeOnDiff" title="Examples"><img class="examplesButton"
  92. src="/css/img/examplesButton.svg"></div>
  93. </div>
  94. </div>
  95. <!-- Mid-size screens -->
  96. <div class="navbar navBar1024 languageJS">
  97. <div class="categoryTitle">
  98. <img class="logo" src="/css/img/logo_v4.svg">
  99. <div class="version"><span class="versionSub" id="mainTitle1024"></span></div>
  100. </div>
  101. <div class="category languageJS" id="JStoTSbar">
  102. <div class="buttonJStoTS languageTS" id="toTSbutton1024">TS</div>
  103. <div class="buttonJStoTS languageJS" id="toJSbutton1024">JS</div>
  104. <div class="buttonSpaceKiller"></div>
  105. <div class="buttonPG run removeOnDiff" id="runButton1024" title="Run&#10;(Alt+Enter)"><img
  106. src="/css/img/playButton.svg"></div>
  107. <div class="buttonPG removeOnDiff" id="saveButton1024" title="Save&#10;(Ctrl+S)"><img
  108. src="/css/img/saveButton.svg"></div>
  109. <div class="buttonPG removeOnPhone removeOnDiff" id="zipButton1024"
  110. title="Download ZIP&#10;(Ctrl+Shift+S)"><img src="/css/img/downloadButton.svg"></div>
  111. <div class="buttonPG removeOnDiff" id="newButton1024" title="Create new"><img
  112. src="/css/img/newButton.svg"></div>
  113. <div class="buttonPG removeOnPhone removeOnDiff" id="clearButton1024" title="Clear"><img
  114. src="/css/img/clearButton.svg"></div>
  115. <div class="buttonPG removeOnPhone removeOnDiff" id="diffButton1024" title="Compare"><img
  116. src="/css/img/diffButton.svg"></div>
  117. <div class="buttonPG removeOnPhone displayOnDiff" id="previousButton1024"><img
  118. src="/css/img/previousButton.svg"></div>
  119. <div class="buttonPG removeOnPhone displayOnDiff" id="nextButton1024"><img
  120. src="/css/img/nextButton.svg">
  121. </div>
  122. <div class="buttonPG removeOnPhone displayOnDiff" id="exitButton1024"><img
  123. src="/css/img/exitButton.svg">
  124. </div>
  125. <div class="buttonPG select removeOnDiff" id="menuButton1024" title="Options"><img
  126. src="/css/img/optionsButton.svg">
  127. <div class="toDisplay">
  128. <div class="option subSelect">Theme <i class="fa fa-chevron-right" aria-hidden="true"></i>
  129. <div class="toDisplaySub">
  130. <div class="option selected" id="darkTheme1024">Dark</div>
  131. <div class="option" id="lightTheme1024">Light</div>
  132. </div>
  133. </div>
  134. <div class="option subSelect">Font size <i class="fa fa-chevron-right" aria-hidden="true"></i>
  135. <div class="toDisplaySub displayFontSize">
  136. <div class="option">12</div>
  137. <div class="option selected">14</div>
  138. <div class="option">16</div>
  139. <div class="option">18</div>
  140. <div class="option">20</div>
  141. <div class="option">22</div>
  142. </div>
  143. </div>
  144. <div class="option noSubSelect" id="safemodeToggle1024">Safe mode
  145. <i class="fa fa-square" aria-hidden="true"></i>
  146. </div>
  147. <div class="option checked noSubSelect" id="editorButton1024">Editor
  148. <i class="fa fa-check-square" aria-hidden="true"></i>
  149. </div>
  150. <div class="option noSubSelect" id="fullscreenButton1024">Fullscreen</div>
  151. <div class="option noSubSelect" id="editorFullscreenButton1024">Editor Fullscreen</div>
  152. <div class="option noSubSelect" id="formatButton1024">Format code</div>
  153. <div class="option noSubSelect" id="minimapToggle1024">Minimap
  154. <i class="fa fa-square" aria-hidden="true"></i>
  155. </div>
  156. <div class="option subSelect" id="qrCodeHover1024">QR Code Link <i class="fa fa-chevron-right"
  157. aria-hidden="true"></i>
  158. <div class="toDisplaySub qrCodeImage">
  159. <div class="option" id="qrCodeImage1024">[QR Code Image]</div>
  160. </div>
  161. </div>
  162. <div class="option uncheck noSubSelect" id="debugButton1024">Inspector</div>
  163. <div class="option noSubSelect" id="metadataButton1024">Metadata</div>
  164. </div>
  165. </div>
  166. </div>
  167. <div class="category right">
  168. <div class="buttonPG select removeOnDiff" title="Select Babylon.js version">
  169. <span id="currentVersion1024"></span>
  170. <div class="toDisplay currentVersionDisplay" style="display: none">
  171. </div>
  172. </div>
  173. <div class="buttonPG select removeOnDiff" title="Examples"><img class="examplesButton"
  174. src="/css/img/examplesButton.svg"></div>
  175. </div>
  176. </div>
  177. <!-- Mobile -->
  178. <div class="navbar navBarMobile languageJS">
  179. <div class="category languageJS" id="JStoTSbar">
  180. <div class="buttonPG select" id="menuButtonMobile"><img src="/css/img/hamburgerButton.svg">
  181. <div class="toDisplay">
  182. <div class="option noSubSelect languageTS" id="toTSbuttonMobile">TypeScript</div>
  183. <div class="option noSubSelect languageJS" id="toJSbuttonMobile">JavaScript</div>
  184. <div class="option noSubSelect run removeOnDiff" id="runButtonMobile"><img
  185. src="/css/img/playButton.svg">Run</div>
  186. <div class="option noSubSelect removeOnDiff" id="saveButtonMobile"><img
  187. src="/css/img/saveButton.svg">Save</div>
  188. <div class="option noSubSelect removeOnDiff" id="zipButtonMobile"><img
  189. src="/css/img/downloadButton.svg">Download</div>
  190. <div class="option noSubSelect removeOnDiff" id="newButtonMobile"><img
  191. src="/css/img/newButton.svg">New</div>
  192. <div class="option noSubSelect removeOnDiff" id="clearButtonMobile"><img
  193. src="/css/img/clearButton.svg">Clear</div>
  194. <div class="option noSubSelect removeOnDiff" id="diffButtonMobile"><img
  195. src="/css/img/diffButton.svg">Diff</div>
  196. <div class="option noSubSelect displayOnDiff" id="previousButtonMobile"><img
  197. src="/css/img/previousButton.svg">Previous</div>
  198. <div class="option noSubSelect displayOnDiff" id="nextButtonMobile"><img
  199. src="/css/img/nextButton.svg">Next</div>
  200. <div class="option noSubSelect displayOnDiff" id="exitButtonMobile"><img
  201. src="/css/img/exitButton.svg">Exit</div>
  202. <div class="option noSubSelect removeOnDiff" id="debugButtonMobile"><img
  203. src="/css/img/inspectorButton.svg">Inspector</div>
  204. <div class="option subSelect removeOnDiff">
  205. <img src="/css/img/optionsButton.svg">
  206. <div id="currentVersionMobile"></div>
  207. <div class="toDisplaySub currentVersionDisplay">
  208. </div>
  209. </div>
  210. <div class="option subSelect removeOnDiff"><img src="/css/img/optionsButton.svg">Theme
  211. <div class="toDisplaySub">
  212. <div class="option selected" id="darkThemeMobile">Dark</div>
  213. <div class="option" id="lightThemeMobile">Light</div>
  214. </div>
  215. </div>
  216. <div class="option subSelect removeOnDiff"><img src="/css/img/optionsButton.svg">Font size
  217. <div class="toDisplaySub displayFontSize">
  218. <div class="option">8</div>
  219. <div class="option">10</div>
  220. <div class="option selected">12</div>
  221. <div class="option">14</div>
  222. <div class="option">16</div>
  223. <div class="option">18</div>
  224. <div class="option">20</div>
  225. <div class="option">22</div>
  226. </div>
  227. </div>
  228. <div style="display: none;" class="option noSubSelect" id="safemodeToggleMobile">Safe mode
  229. <i class="fa fa-square" aria-hidden="true"></i>
  230. </div>
  231. <div style="display: none;" class="option checked noSubSelect" id="editorButtonMobile">Editor
  232. <i class="fa fa-check-square" aria-hidden="true"></i>
  233. </div>
  234. <div style="display: none;" class="option nosubselect" id="fullscreenButtonMobile"
  235. style="display: none">Fullscreen</div>
  236. <div style="display: none;" class="option nosubselect" id="editorFullscreenButtonMobile"
  237. style="display: none">Editor
  238. Fullscreen</div>
  239. <div class="option nosubselect removeOnDiff" id="formatButtonMobile"><img
  240. src="/css/img/optionsButton.svg">Format
  241. code</div>
  242. <div style="display: none;" class="option nosubselect" id="minimapToggleMobile">Minimap
  243. <i class="fa fa-square" aria-hidden="true"></i>
  244. </div>
  245. <!-- <div class="option subSelect" id="qrCodeHoverMobile"><img src="/css/img/optionsButton.svg">QR Code Link
  246. <div class="toDisplaySub qrCodeImage">
  247. <div class="option" id="qrCodeImageMobile">[QR Code Image]</div>
  248. </div>
  249. </div> -->
  250. <div class="option nosubselect removeOnDiff" id="metadataButtonMobile"><img
  251. src="/css/img/metadataButton.svg">Metadata</div>
  252. <div class="option nosubselect removeOnDiff"><img class="examplesButton"
  253. src="/css/img/examplesButton.svg">Examples</div>
  254. <div class="option subSelect removeOnDiff"><img src="/css/img/examplesButton.svg">Links / Tools
  255. <div class="toDisplaySub displayFooterLinks">
  256. <div class="option link">
  257. <a target='_new' href="https://forum.babylonjs.com/">Forum</a>
  258. </div>
  259. <div class="option link">
  260. <a target='_new' href="https://sandbox.babylonjs.com/">Sandbox</a>
  261. </div>
  262. <div class="option link">
  263. <a target='_new' href="https://doc.babylonjs.com">Documentation</a>
  264. </div>
  265. <div class="option link">
  266. <a target='_new' href="https://doc.babylonjs.com/playground">Search</a>
  267. </div>
  268. </div>
  269. </div>
  270. </div>
  271. </div>
  272. <div class="categoryTitle">
  273. <img class="logo" src="/css/img/logo_v4.svg">
  274. <div class="version"><span class="versionSub" id="mainTitleMobile"></span></div>
  275. </div>
  276. </div>
  277. <div id="switchWrapper" class="languageJS removeOnDiff">
  278. <img id="switchWrapperCode" src="/css/img/codeButton.svg">
  279. <img id="switchWrapperCanvas" src="/css/img/canvas3Dbutton.svg">
  280. </div>
  281. </div>
  282. <!-- Common things -->
  283. <div class="wrapper">
  284. <div id="jsEditor"></div>
  285. <div id="diffView" class="diff-view"></div>
  286. <div id="canvasZone">
  287. <canvas touch-action="none" id="renderCanvas"></canvas>
  288. </div>
  289. </div>
  290. <div id="exampleList" class="javascript">
  291. <div id="exampleBanner" class="languageJS">
  292. <h1>Examples<img id="examplesButtonClose" src="/css/img/clearButton.svg"></h1>
  293. </div>
  294. <div class="horizontalSeparator"></div>
  295. <input id="filterBar" type="text" placeholder="Filter examples...">
  296. <img id="filterBarClear" src="/css/img/clear_button.png">
  297. </div>
  298. <div class="fpsLabel languageJS" id="fpsLabel"></div>
  299. <div id="errorZone">
  300. </div>
  301. <div class="navbarBottom">
  302. <div id="statusBar"></div>
  303. <div class="links">
  304. <div class='link'>
  305. <a target='_new' href="https://forum.babylonjs.com/">Forum</a>
  306. </div>
  307. <div class='link'>
  308. <a target='_new' href="https://www.babylonjs.com/sandbox">Sandbox</a>
  309. </div>
  310. <div class='link'>
  311. <a target='_new' href="https://doc.babylonjs.com">Documentation</a>
  312. </div>
  313. <div class='link'>
  314. <a target='_new' href="https://doc.babylonjs.com/playground">Search</a>
  315. </div>
  316. </div>
  317. </div>
  318. <div id="saveLayer" class="save-layer">
  319. <div class="save-form languageJS ">
  320. <img id="saveFormButtonClose" src="/css/img/clearButton.svg">
  321. <label for="saveFormTitle">TITLE</label>
  322. <div class="separator"></div>
  323. <input type="text" maxlength="120" id="saveFormTitle" class="save-form-title">
  324. <label for="saveFormDescription">DESCRIPTION</label>
  325. <div class="separator"></div>
  326. <textarea id="saveFormDescription" rows="4" cols="10"></textarea>
  327. <label for="saveFormTags">TAGS (separated by comma)</label>
  328. <div class="separator"></div>
  329. <textarea id="saveFormTags" rows="4" cols="10"></textarea>
  330. <div class="save-form-buttons" id="saveFormButtons">
  331. <div id="saveFormButtonOk">OK</div>
  332. <div id="saveFormButtonCancel">Cancel</div>
  333. </div>
  334. </div>
  335. </div>
  336. <div id="diffLayer" class="save-layer">
  337. <div class="save-form diff-form">
  338. <label for="diffFormSource">COMPARISON SOURCE</label>
  339. <div class="separator"></div>
  340. <input type="text" maxlength="120" id="diffFormSource"
  341. placeholder="leave blank to use current snippet, or use snippet ID" class="save-form-title">
  342. <label for="diffFormCompareTo">COMPARE TO</label>
  343. <div class="separator"></div>
  344. <input type="text" maxlength="120" id="diffFormCompareTo" placeholder="snippet ID"
  345. class="save-form-title">
  346. <div class="save-form-buttons" id="diffFormButtons">
  347. <div id="diffFormButtonOk">OK</div>
  348. <div id="diffFormButtonCancel">Cancel</div>
  349. </div>
  350. </div>
  351. </div>
  352. <div id="waitDiv">
  353. <div id="logo-part">
  354. <img src="/css/img/v4.svg" id="waitLogo" />
  355. <img src="/css/img/spinner.svg" id="waitSpinner" />
  356. </div>
  357. </div>
  358. <!-- Pep -->
  359. <script src="/js/libs/pep.min.js"></script>
  360. <!-- For canvas/code separator -->
  361. <script src="/js/libs/split.js"></script>
  362. <!-- DatGUI -->
  363. <script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.2/dat.gui.min.js"></script>
  364. <!-- jszip -->
  365. <script src="/js/libs/jszip.min.js"></script>
  366. <script src="/js/libs/fileSaver.js"></script>
  367. <!-- Babylon.js -->
  368. <script src="https://preview.babylonjs.com/babylon.js"></script>
  369. <script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>
  370. <script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
  371. <script src="https://preview.babylonjs.com/nodeEditor/babylon.nodeEditor.js"></script>
  372. <script src="https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js"></script>
  373. <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js">
  374. </script>
  375. <script src="https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js"></script>
  376. <script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.min.js"></script>
  377. <script src="https://preview.babylonjs.com/serializers/babylonjs.serializers.min.js"></script>
  378. <!-- Dependencies -->
  379. <script src="https://preview.babylonjs.com/ammo.js"></script>
  380. <script src="https://preview.babylonjs.com/earcut.min.js"></script>
  381. <script src="https://preview.babylonjs.com/recast.js"></script>
  382. <script src="https://cdnjs.cloudflare.com/ajax/libs/cannon.js/0.6.2/cannon.min.js"></script>
  383. <script src="https://cdnjs.cloudflare.com/ajax/libs/oimo/1.0.9/oimo.min.js"></script>
  384. <script src="https://preview.babylonjs.com/libktx.js"></script>
  385. <!-- Extensions -->
  386. <script
  387. src="https://rawcdn.githack.com/BabylonJS/Extensions/f43ab677b4bca0a6ab77132d3f785be300382760/ClonerSystem/src/babylonx.cloner.js"
  388. >
  389. </script>
  390. <script
  391. src="https://rawcdn.githack.com/BabylonJS/Extensions/785013ec55b210d12263c91f3f0a2ae70cf0bc8a/CompoundShader/src/babylonx.CompoundShader.js"
  392. ></script>
  393. <!-- Scene Manager -->
  394. <script
  395. src="https://rawcdn.githack.com/MackeyK24/MackeyK24.github.io/14fda491c50cfca6d3e2f6cbc5e6afe22cc455d6/toolkit/babylon.manager.js">
  396. </script>
  397. <script
  398. src="https://rawcdn.githack.com/MackeyK24/MackeyK24.github.io/14fda491c50cfca6d3e2f6cbc5e6afe22cc455d6/toolkit/babylon.navmesh.js">
  399. </script>
  400. <!-- Monaco -->
  401. <script src="/node_modules/monaco-editor/dev/vs/loader.js"></script>
  402. <!-- jQuery -->
  403. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  404. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
  405. <!-- Main scripts -->
  406. <script src="/js/config_versions.js"></script>
  407. <script src="/js/examples.js"></script>
  408. <script src="/js/main.js"></script>
  409. <script src="/js/menuPG.js"></script>
  410. <script src="/js/monacoCreator.js"></script>
  411. <script src="/js/settingsPG.js"></script>
  412. <script src="/js/utils.js"></script>
  413. <script src="/js/zipTool.js"></script>
  414. <script src="/js/index.js"></script>
  415. </body>
  416. </html>