Index.cshtml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. @{
  2. ViewBag.Title = "Our Own BabylonJS";
  3. ViewBag.BabylonJSFolder = "..\\..\\..\\";
  4. }
  5. <style>
  6. #loadingInfos {
  7. color: #888888;
  8. cursor: default;
  9. font-size: 30px;
  10. height: 60px;
  11. left: 0;
  12. margin-top: -30px;
  13. padding-top: 10px;
  14. position: absolute;
  15. text-align: center;
  16. bottom: 0;
  17. transition: transform 0.25s ease-in-out 0s;
  18. width: calc(100% - 10px);
  19. z-index: 3;
  20. border: 5px dotted gray;
  21. pointer-events: none;
  22. }
  23. #loadingInfos .content {
  24. position: relative;
  25. top: 50%;
  26. }
  27. .loadingInfos {
  28. transform: translateX(120%);
  29. -webkit-transform: translate(120%);
  30. }
  31. </style>
  32. <div id="loadingInfos"><div class="content">Drag and drop your .babylon files inside, with associated assets</div></div>
  33. <script type="text/javascript">
  34. $(document).ready(function () {
  35. var loading = new OURBABYLON.Loading(OURBABYLON.canvas.parentElement);
  36. var loadingInfos = document.getElementById("loadingInfos");
  37. loadingInfos.style.height = (OURBABYLON.canvas.height-20)+"px";
  38. window.addEventListener('resize', function () {
  39. loadingInfos.style.height = (OURBABYLON.canvas.height - 20) + "px";
  40. });
  41. var filesInput = new BABYLON.FilesInput(OURBABYLON.engine, OURBABYLON.currentScene, OURBABYLON.canvas, function (sceneFile, babylonScene) {
  42. OURBABYLON.sceneInitialization(babylonScene, true);
  43. loading.hide();
  44. }, $.proxy(loading.onProgress, loading), null, null, function () {
  45. loading.show();
  46. loadingInfos.className = "loadingInfos";
  47. });
  48. filesInput.monitorElementForDragNDrop(OURBABYLON.canvas);
  49. });
  50. </script>