Sfoglia il codice sorgente

Finished integration

David Catuhe 6 anni fa
parent
commit
fe1d35ee1c

File diff suppressed because it is too large
+ 1 - 0
sandbox/Assets/BabylonIdentity.svg


+ 1 - 35
sandbox/Assets/Icon_Down.svg

@@ -1,35 +1 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
-<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 800 800" style="enable-background:new 0 0 800 800;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:#FFFFFF;}
-	.st1{fill:#F2F2F2;}
-	.st2{fill:#3B789A;}
-	.st3{fill:none;}
-	.st4{opacity:0.5;fill:#2C5A74;}
-	.st5{clip-path:url(#SVGID_2_);}
-	.st6{clip-path:url(#SVGID_4_);}
-	.st7{fill:#2C5A74;}
-	.st8{clip-path:url(#SVGID_8_);}
-	.st9{clip-path:url(#SVGID_10_);}
-	.st10{clip-path:url(#SVGID_14_);}
-	.st11{clip-path:url(#SVGID_16_);}
-	.st12{clip-path:url(#SVGID_20_);}
-	.st13{clip-path:url(#SVGID_22_);}
-	.st14{opacity:0.3;fill:#00DC00;}
-	.st15{fill:#00DC00;}
-	.st16{opacity:0.3;fill:#FF0000;}
-	.st17{fill:#FF0000;}
-	.st18{fill:none;stroke:#FF0000;stroke-miterlimit:10;}
-</style>
-<g id="Layer_3">
-</g>
-<g id="Layer_1">
-	<g>
-		<path class="st0" d="M601,277.6l19.8,19.8L400,518.2L179.2,297.4l19.8-19.8l201,201L601,277.6z"/>
-	</g>
-</g>
-<g id="Redliner:_Redlines">
-</g>
-</svg>
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70 70"><defs><style>.cls-1{fill:#fff;}.cls-2{fill:none;}</style></defs><title>DownArrowIcon</title><g id="Layer_2" data-name="Layer 2"><g id="Redlines"><path class="cls-1" d="M23.14,30.07l1.42-1.42L34.85,38.94,45.14,28.65l1.41,1.42L34.85,41.78Z"/><rect class="cls-2" width="70" height="70"/></g></g></svg>

+ 1 - 35
sandbox/Assets/Icon_Pause.svg

@@ -1,35 +1 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
-<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 800 800" style="enable-background:new 0 0 800 800;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:#FFFFFF;}
-	.st1{fill:#F2F2F2;}
-	.st2{fill:#3B789A;}
-	.st3{fill:none;}
-	.st4{opacity:0.5;fill:#2C5A74;}
-	.st5{clip-path:url(#SVGID_2_);}
-	.st6{clip-path:url(#SVGID_4_);}
-	.st7{fill:#2C5A74;}
-	.st8{clip-path:url(#SVGID_8_);}
-	.st9{clip-path:url(#SVGID_10_);}
-	.st10{clip-path:url(#SVGID_14_);}
-	.st11{clip-path:url(#SVGID_16_);}
-	.st12{clip-path:url(#SVGID_20_);}
-	.st13{clip-path:url(#SVGID_22_);}
-	.st14{opacity:0.3;fill:#00DC00;}
-	.st15{fill:#00DC00;}
-	.st16{opacity:0.3;fill:#FF0000;}
-	.st17{fill:#FF0000;}
-	.st18{fill:none;stroke:#FF0000;stroke-miterlimit:10;}
-</style>
-<g id="Layer_3">
-</g>
-<g id="Layer_1">
-	<g>
-		<path class="st0" d="M314.1,228.3h28.6v343.5h-28.6V228.3z M485.9,228.3v343.5h-28.6V228.3H485.9z"/>
-	</g>
-</g>
-<g id="Redliner:_Redlines">
-</g>
-</svg>
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70 70"><defs><style>.cls-1{fill:none;}.cls-2{fill:#fff;}</style></defs><title>PauseIcon</title><g id="Layer_2" data-name="Layer 2"><g id="Redlines"><rect class="cls-1" width="70" height="70"/><path class="cls-2" d="M28.83,44.37v-20h2v20Zm10-20h2v20h-2Z"/></g></g></svg>

+ 1 - 35
sandbox/Assets/Icon_Play.svg

@@ -1,35 +1 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
-<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 800 800" style="enable-background:new 0 0 800 800;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:#FFFFFF;}
-	.st1{fill:#F2F2F2;}
-	.st2{fill:#3B789A;}
-	.st3{fill:none;}
-	.st4{opacity:0.5;fill:#2C5A74;}
-	.st5{clip-path:url(#SVGID_2_);}
-	.st6{clip-path:url(#SVGID_4_);}
-	.st7{fill:#2C5A74;}
-	.st8{clip-path:url(#SVGID_8_);}
-	.st9{clip-path:url(#SVGID_10_);}
-	.st10{clip-path:url(#SVGID_14_);}
-	.st11{clip-path:url(#SVGID_16_);}
-	.st12{clip-path:url(#SVGID_20_);}
-	.st13{clip-path:url(#SVGID_22_);}
-	.st14{opacity:0.3;fill:#00DC00;}
-	.st15{fill:#00DC00;}
-	.st16{opacity:0.3;fill:#FF0000;}
-	.st17{fill:#FF0000;}
-	.st18{fill:none;stroke:#FF0000;stroke-miterlimit:10;}
-</style>
-<g id="Layer_3">
-</g>
-<g id="Layer_1">
-	<g>
-		<path class="st0" d="M569.5,404.1L288.3,601V207.2L569.5,404.1z M316.4,546.9l204.1-142.8L316.4,261.3V546.9z"/>
-	</g>
-</g>
-<g id="Redliner:_Redlines">
-</g>
-</svg>
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70 70"><defs><style>.cls-1{fill:none;}.cls-2{fill:#fff;}</style></defs><title>PlayIcon</title><g id="Layer_2" data-name="Layer 2"><g id="Redlines"><rect class="cls-1" width="70" height="70"/><path class="cls-2" d="M28.83,25.13l16,10-16,10Zm2,3.61V41.52l10.22-6.39Z"/></g></g></svg>

+ 1 - 35
sandbox/Assets/Icon_Up.svg

@@ -1,35 +1 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
-<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 800 800" style="enable-background:new 0 0 800 800;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:#FFFFFF;}
-	.st1{fill:#F2F2F2;}
-	.st2{fill:#3B789A;}
-	.st3{fill:none;}
-	.st4{opacity:0.5;fill:#2C5A74;}
-	.st5{clip-path:url(#SVGID_2_);}
-	.st6{clip-path:url(#SVGID_4_);}
-	.st7{fill:#2C5A74;}
-	.st8{clip-path:url(#SVGID_8_);}
-	.st9{clip-path:url(#SVGID_10_);}
-	.st10{clip-path:url(#SVGID_14_);}
-	.st11{clip-path:url(#SVGID_16_);}
-	.st12{clip-path:url(#SVGID_20_);}
-	.st13{clip-path:url(#SVGID_22_);}
-	.st14{opacity:0.3;fill:#00DC00;}
-	.st15{fill:#00DC00;}
-	.st16{opacity:0.3;fill:#FF0000;}
-	.st17{fill:#FF0000;}
-	.st18{fill:none;stroke:#FF0000;stroke-miterlimit:10;}
-</style>
-<g id="Layer_3">
-</g>
-<g id="Layer_1">
-	<g>
-		<path class="st0" d="M604.6,511.8L400,307.5L195.4,511.8l-19.8-19.8L400,267.5l224.3,224.6L604.6,511.8z"/>
-	</g>
-</g>
-<g id="Redliner:_Redlines">
-</g>
-</svg>
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70 70"><defs><style>.cls-1{fill:#fff;}.cls-2{fill:none;}</style></defs><title>UpArrowIcon</title><g id="Layer_2" data-name="Layer 2"><g id="Redlines"><path class="cls-1" d="M34.85,29.78,24.56,40.06l-1.42-1.41L34.85,26.94l11.7,11.71-1.42,1.41Z"/><rect class="cls-2" width="70" height="70"/></g></g></svg>

+ 2 - 0
sandbox/animation.js

@@ -18,11 +18,13 @@ function displayDropdownContent(display) {
         dropdownContent.style.display = "flex";
         chevronDown.style.display = "inline";
         chevronUp.style.display = "none";
+        dropdownBtn.classList.add("open");
     }
     else {
         dropdownContent.style.display = "none";
         chevronDown.style.display = "none";
         chevronUp.style.display = "inline";
+        dropdownBtn.classList.remove("open");
     }
 }
 dropdownBtn.addEventListener("click", function() {

+ 2 - 0
sandbox/environment.js

@@ -26,9 +26,11 @@ var defaultSkyboxIndex = readLocaStorageValue("defaultSkyboxId", 0);
 function displayDropdownContentEnv(display) {
     if (display) {
         dropdownContentEnv.classList.remove("hidden");
+        btnEnvironment.classList.add("open");
     }
     else {
         dropdownContentEnv.classList.add("hidden");
+        btnEnvironment.classList.remove("open");
     }
 }
 

+ 19 - 15
sandbox/index-local.html

@@ -4,6 +4,7 @@
 <head>
     <title>BabylonJS - Sandbox</title>
     <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
+    <link rel="stylesheet" href="https://use.typekit.net/cta4xsb.css">
     <link href="index.css" rel="stylesheet" />
     <link href="index-media.css" rel="stylesheet" />
     <script src="../dist/preview%20release/ammo.js"></script>
@@ -20,38 +21,41 @@
             <canvas id="renderCanvas" touch-action="none"></canvas>
         </div>
         <div id="footer" class="footer">
+            <div class="footerLeft">
+                <img id="playImg" src="Assets/BabylonIdentity.svg">
+            </div>
             <div id="animationBar">
+                <div class="row">
+                    <button id="playBtn" class="pause">
+                        <img id="playImg" src="Assets/Icon_Play.svg">
+                        <img id="pauseImg" src="Assets/Icon_Pause.svg">
+                    </button>
+                    <input id="slider" type="range" min="0" max="100" value="0" step="any">
+                </div>
                 <div class="dropdown">
                     <div id="dropdownBtn">
                         <img src="Assets/Icon_Up.svg" id="chevronUp">
                         <img src="Assets/Icon_Down.svg" id="chevronDown">
-                        <span id="dropdownLabel"></span>
+                        <div id="dropdownLabel"></div>
                     </div>
                     <div id="dropdownContent">
                     </div>
                 </div>
-                <div class="row">
-                    <button id="playBtn" class="pause">
-                        <img id="playImg" src="Assets/Icon_Play.svg">
-                        <img id="pauseImg" src="Assets/Icon_Pause.svg">
-                    </button>
-                    <input id="slider" type="range" min="0" max="100" value="0" step="any">
-                </div>
             </div>
             <div class="footerRight">
-                <a href="javascript:void(null);" id="btnInspector" class="hidden"><img src="./Assets/Icon_EditModel.svg"
-                        alt="Display inspector" title="Display inspector" /></a>
-                <a href="javascript:void(null);" id="btnEnvironment" class="hidden"><img src="./Assets/IBLicon.svg"
-                        alt="Select environment" title="Select environment" />
-                </a>
-                <div id="dropdownContent-env" class="hidden">
-                </div>
                 <a href="javascript:void(null);">
                     <div class="custom-upload"
                         title="Open your scene from your hard drive (.babylon, .gltf, .glb, .obj)">
                         <input type="file" id="files" multiple />
                     </div>
                 </a>
+                <a href="javascript:void(null);" id="btnEnvironment" class="hidden"><img src="./Assets/IBLicon.svg"
+                        alt="Select environment" title="Select environment" />
+                </a>
+                <a href="javascript:void(null);" id="btnInspector" class="hidden"><img src="./Assets/Icon_EditModel.svg"
+                        alt="Display inspector" title="Display inspector" /></a>
+                <div id="dropdownContent-env" class="hidden">
+                </div>
             </div>
         </div>
         <img id="logo" src='./Assets/Logo_Fullscreen.svg' />

+ 80 - 38
sandbox/index.css

@@ -1,13 +1,9 @@
-@font-face {
-    font-family: "babylon-font";
-    src: url("./Assets/font.woff") format('woff');
-}
-
-html {
+html {
     --background: #2A2342;
     --footer-background: #201936;
     --footer-height: 70px;
     --button-hover-color: #BB464B;
+    --button-hover-hover: #e0684b;
     --button-hover-background:  #162D3A;
 }
 
@@ -17,9 +13,10 @@ html, body, #root {
     padding: 0;
     margin: 0;
     overflow: hidden;
-    font-family: 'babylon-font';
     font-size: 20px;
     background: var(--background);
+    font-family: "acumin-pro-condensed";
+    font-weight: normal;
 }
 
 .hidden {
@@ -64,14 +61,24 @@ a:visited {
     padding: 0;
     background-color:var(--footer-background);
     font-size: 0;
+    display: grid;
+    grid-template-rows: 100%;
+    grid-template-columns: 201px 1fr 210px
+}
+
+.footerLeft {
+    display: grid;
+    grid-column: 1;
+    grid-row: 1;
+    padding-left: 40px;
+    align-content: center; 
 }
 
 .footerRight {
-    display: block;
-    float: right;
-    bottom: 0;
-    right: 0px;
-    top: 0px;
+    display: flex;
+    flex-direction: row-reverse;
+    grid-column: 3;
+    grid-row: 1;
 }
 
 .footerRight a {
@@ -197,16 +204,14 @@ a:visited {
 
 /* animation bar */
 #animationBar {
-    position: absolute;
-    bottom: 0px;
     display: none;
     align-items: center;
     color: white;
-    width: calc(100% - var(--footer-height) * 3);
     min-height: 30px;
-    font-size: 14px;
     height: var(--footer-height);
-    background-color: var(--footer-background);
+    background-color: var(--footer-background);    
+    grid-column: 2;
+    grid-row: 1;
 }
 
 .row {
@@ -222,10 +227,9 @@ a:visited {
     margin: 0px;
 }
 
-#animationBar img {
-    width: 36px;
-    height: 36px;
-    margin: 10px;
+#playBtn img {
+    width: var(--footer-height);
+    height: var(--footer-height);
 }
 
 .dropdown {
@@ -234,11 +238,18 @@ a:visited {
     width: 200px;
 }
 
-#dropdownBtn,
 #playBtn {
     display: flex;
     align-items: center;
     height: var(--footer-height);
+    width: var(--footer-height);
+}
+
+#dropdownBtn {
+    display: flex;
+    height: var(--footer-height);
+    width: 200px;
+    font-size: 20px;
 }
 
 #playBtn {
@@ -263,24 +274,28 @@ a:visited {
     position: absolute;
     bottom: var(--footer-height);
     right: 0px;
-    border-bottom: 1px solid white; 
 }
 
 #dropdownContent-env div  {
-    background-color: var(--footer-background);
+    background-color: var(--button-hover-color);
     overflow: hidden;
     text-overflow: ellipsis;
     white-space: nowrap;
-    padding: 10px 15px;
-    font-size: 16px;
+    font-size: 20px;
     width: calc(2 * var(--footer-height));
     color: white;
     cursor: pointer;
+    height: 40px;
     box-sizing: border-box;
+    padding: 0;
+    margin: 0;
+    display: grid;
+    align-content: center;
+    justify-content: center;
 }
 
 #dropdownContent-env div:hover {
-    background-color: var(--button-hover-color); 
+    background-color: var(--button-hover-hover); 
     transition: all 0.3s ease;
 }
 #dropdownContent-env div:active {
@@ -288,18 +303,24 @@ a:visited {
     transition: all 0.3s ease;
 }
 
-#dropdownLabel,
+#btnEnvironment.open {
+    background-color:var(--button-hover-color); 
+}
+
+#dropdownLabel {
+    align-self: center;
+    justify-self: center;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
+
 #dropdownContent a  {
     overflow: hidden;
     text-overflow: ellipsis;
     white-space: nowrap;
     padding: 10px 15px 10px 46px;
 }
-#dropdownLabel {
-    cursor: pointer;
-    width: 200px;
-    padding: 0px 15px 2px 5px;
-}
 
 #dropdownBtn:hover {
     cursor: pointer;
@@ -307,12 +328,24 @@ a:visited {
     transition: all 0.3s ease;
 }
 
+#dropdownBtn.open {
+    background-color:var(--button-hover-color); 
+}
+
 #dropdownContent a {
     max-width: 1000px;
     transition: color 0.5s;
+    height: 40px;
+    font-size: 20px;
+    box-sizing: border-box;
+    padding: 0;
+    margin: 0;
+    display: grid;
+    align-content: center;
+    justify-content: center;
 }
 #dropdownContent a:hover {
-    background-color: var(--button-hover-color); 
+    background-color: var(--button-hover-hover); 
     transition: all 0.3s ease;
 }
 #dropdownContent a:active {
@@ -320,12 +353,11 @@ a:visited {
     transition: all 0.3s ease;
 }
 
-#dropdownContent {
-    background-color: var(--footer-background);
+#dropdownContent {    
+    background-color: var(--button-hover-color);
     display: none;
     position: absolute;
     bottom: var(--footer-height);
-    border-bottom: 1px solid white; 
     z-index: 1;
     min-width: 135px;
     width: 200px;
@@ -339,16 +371,26 @@ a:visited {
 }
 
 #chevronUp {
-    display: inline;
     margin-right: 0px;
     margin-left: 0px;
+    height: var(--footer-height);
+    width: var(--footer-height);
 }
 #chevronDown {
     display: none;
     margin-right: 0px;
     margin-left: 0px;
+    height: var(--footer-height);
+    width: var(--footer-height);
+}
+
+#dropdownLabel {
+    cursor: pointer;
+    width: 200px;
+    padding: 0px 15px 2px 5px;
 }
 
+
 #playBtn.play #pauseImg,
 #playBtn.pause #playImg{
     display: none;

+ 19 - 16
sandbox/index.html

@@ -7,7 +7,7 @@
     <meta name="keywords"
         content="Babylon.js, Babylon, BabylonJS, glTF, glb, obj, viewer, online viewer, 3D model viewer, 3D, webgl" />
     <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
-
+    <link rel="stylesheet" href="https://use.typekit.net/cta4xsb.css">
     <link rel="shortcut icon" href="https://www.babylonjs.com/img/favicon/favicon.ico">
     <link rel="apple-touch-icon" sizes="57x57" href="https://www.babylonjs.com/img/favicon/apple-icon-57x57.png">
     <link rel="apple-touch-icon" sizes="60x60" href="https://www.babylonjs.com/img/favicon/apple-icon-60x60.png">
@@ -53,38 +53,41 @@
             <canvas id="renderCanvas" touch-action="none"></canvas>
         </div>
         <div id="footer" class="footer">
+            <div class="footerLeft">
+                <img id="playImg" src="Assets/BabylonIdentity.svg">
+            </div>
             <div id="animationBar">
+                <div class="row">
+                    <button id="playBtn" class="pause">
+                        <img id="playImg" src="Assets/Icon_Play.svg">
+                        <img id="pauseImg" src="Assets/Icon_Pause.svg">
+                    </button>
+                    <input id="slider" type="range" min="0" max="100" value="0" step="any">
+                </div>
                 <div class="dropdown">
                     <div id="dropdownBtn">
                         <img src="Assets/Icon_Up.svg" id="chevronUp">
                         <img src="Assets/Icon_Down.svg" id="chevronDown">
-                        <span id="dropdownLabel"></span>
+                        <div id="dropdownLabel"></div>
                     </div>
                     <div id="dropdownContent">
                     </div>
                 </div>
-                <div class="row">
-                    <button id="playBtn" class="pause">
-                        <img id="playImg" src="Assets/Icon_Play.svg">
-                        <img id="pauseImg" src="Assets/Icon_Pause.svg">
-                    </button>
-                    <input id="slider" type="range" min="0" max="100" value="0" step="any">
-                </div>
             </div>
             <div class="footerRight">
-                <a href="javascript:void(null);" id="btnInspector" class="hidden"><img src="./Assets/Icon_EditModel.svg"
-                        alt="Display inspector" title="Display inspector" /></a>
-                <a href="javascript:void(null);" id="btnEnvironment" class="hidden"><img src="./Assets/IBLicon.svg"
-                        alt="Select environment" title="Select environment" />
-                </a>
-                <div id="dropdownContent-env" class="hidden">
-                </div>
                 <a href="javascript:void(null);">
                     <div class="custom-upload"
                         title="Open your scene from your hard drive (.babylon, .gltf, .glb, .obj)">
                         <input type="file" id="files" multiple />
                     </div>
                 </a>
+                <a href="javascript:void(null);" id="btnEnvironment" class="hidden"><img src="./Assets/IBLicon.svg"
+                        alt="Select environment" title="Select environment" />
+                </a>
+                <a href="javascript:void(null);" id="btnInspector" class="hidden"><img src="./Assets/Icon_EditModel.svg"
+                        alt="Display inspector" title="Display inspector" /></a>
+                <div id="dropdownContent-env" class="hidden">
+                </div>
             </div>
         </div>
         <img id="logo" src='./Assets/Logo_Fullscreen.svg' />