From bfc38772a4a3c8baa6fe505bd36f99cc15381516 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期二, 21 十二月 2021 13:17:05 +0800 Subject: [PATCH] # --- static/css/index.css | 9 +++- static/js/app.js | 19 +++++---- static/js/data/Asrs.js | 1 views/index0.html | 27 +++++++------ static/js/utils.js | 14 +++++++ 5 files changed, 45 insertions(+), 25 deletions(-) diff --git a/static/css/index.css b/static/css/index.css index 53f0b8c..4317dcc 100644 --- a/static/css/index.css +++ b/static/css/index.css @@ -38,6 +38,10 @@ .ship-info-box .speed { font-size:12px; color:#00ff00; + transition:all 1000ms; +} +.ship-info-box .speed.pointernone.hide { + opacity: 0; } .ship-info-box .speed span { color:#fff; @@ -53,7 +57,7 @@ text-align:center; margin-top:10px; } -.ship-info-box .btn .btn-back { +.ship-info-box .btn #btn-lock { transition:all 300ms; position:absolute; top:0; @@ -100,7 +104,7 @@ .ship-info-box .btn.show { cursor:pointer; } -.ship-info-box .btn.show .btn-back { +.ship-info-box .btn.show #btn-lock { transform:scale(1,1); } .ship-info-box .btn.show .btn-word { @@ -145,7 +149,6 @@ width:80px; transform:translate(0,0); } - diff --git a/static/js/app.js b/static/js/app.js index 04ed3c5..ff2244a 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -253,6 +253,8 @@ this.controls.addEventListener( 'unlock', function () { console.log("涓婂笣瑙嗚"); object.initCamera(); + addClass(document.getElementById("ship-info-btn"), "show"); + document.getElementById("ship-type-ul").style.transform = 'translateY(-40px)'; } ); document.addEventListener( 'keydown', onKeyDown ); document.addEventListener( 'keyup', onKeyUp ); @@ -289,14 +291,6 @@ } } this.prevTime = time; - } - this.lockControl = function () { - this.camera.position.y = 100; - this.camera.lookAt(0,100,0); - this.controls.getObject().position.x =0; - this.controls.getObject().position.y =100; - this.controls.getObject().position.z =580; - this.controls.lock(); } this.removeObject = function (nameorid) { for (let i = 0; i < this.objects.length; i++) { @@ -401,7 +395,14 @@ this.backgroundType = !this.backgroundType; this.initBackground(); } - + this.lockControl = function () { + this.camera.position.y = 100; + this.camera.lookAt(0,100,0); + this.controls.getObject().position.x =0; + this.controls.getObject().position.y =100; + this.controls.getObject().position.z =580; + this.controls.lock(); + } }, }; diff --git a/static/js/data/Asrs.js b/static/js/data/Asrs.js index b39954f..93ffe5b 100644 --- a/static/js/data/Asrs.js +++ b/static/js/data/Asrs.js @@ -28,7 +28,6 @@ data: {}, // async: false, success: function (res) { - console.log(res) Store3DData = res; } }) diff --git a/static/js/utils.js b/static/js/utils.js index e1638e2..32ea2c2 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -61,3 +61,17 @@ } return false; } + +function fullScreen() { + var docElm = document.documentElement; + if (docElm.requestFullscreen) { + docElm.requestFullscreen(); + } else if (docElm.mozRequestFullScreen) { + docElm.mozRequestFullScreen(); + } else if (docElm.webkitRequestFullScreen) { + docElm.webkitRequestFullScreen(); + } else if (docElm.msRequestFullscreen) { + document.body.msRequestFullscreen(); + } +} + diff --git a/views/index0.html b/views/index0.html index 03d54a4..dee13e4 100644 --- a/views/index0.html +++ b/views/index0.html @@ -46,15 +46,12 @@ <ul id="ship-type-ul"> <li>鍒濆鍖�</li> <li>寰呮満鈥�</li> - <li>鍙互寮�濮嬪父瑙勬帹杩�</li> - <li>鍖�閫熻埅琛�</li> - <li>鏇茬巼寮曟搸鍑嗗灏辩华</li> - <li>璺冭縼</li> + <li>鎮ㄧ幇鍦ㄥ彲浠ヨ嚜鐢辩Щ鍔ㄨ瑙�</li> </ul> </div> <div class="speed pointernone"><span id="speed">0</span> <i id="speed-unit">%</i></div> <div id="ship-info-btn" class="btn" data-type="1"> - <div class="btn-back"></div> + <div id="btn-lock"></div> <div class="btn-word">鍚姩</div> <div class="line line1"></div> <div class="line line2"></div> @@ -75,6 +72,12 @@ var player = new APP.Player(); player.start(); + document.getElementById("btn-lock").addEventListener('click', function () { + player.lockControl(); + removeClass(document.getElementById("ship-info-btn"), "show"); + document.getElementById("ship-type-ul").style.transform = 'translateY(-60px)'; + }, false); + </script> <script> var percent = 0; @@ -82,7 +85,7 @@ var speedDom = document.getElementById("speed"); var timer = setInterval(function () { if (percent < 99.95) { - percent += 0.05; + percent += 0.15; speedDom.innerText = percent.toFixed(2); } else { if (!hasClass(shipInfoBtn, "show")) { @@ -93,19 +96,19 @@ }, 1); $(document).on('click','.btn-word', function () { + fullScreen() $("#mask").fadeOut(3000, function () { - $("#menu").addClass("show"); setTimeout(function () { $("#ship-type-ul").css("transform", "translateY(-40px)"); - $("#ship-info-btn .btn-word").text("璧疯埅"); + $("#ship-info-btn .btn-word").text("浣撻獙涓壃绔嬪簱"); $("#ship-info-btn").data("type", 2).addClass("show"); - $("#ship-info-box,#logo").css("z-index", "10"); - $("#menu li").css("transition", "all 200ms !important"); - }, 2000); + $("#ship-info-btn #btn-lock").css("z-index", "10"); + }, 1000); }); $("#logo").addClass("show"); $("#ship-info-btn").removeClass("show"); - // $('.pointernone').hide(); + $('.speed.pointernone').addClass("hide"); + $("#ship-type-ul").css("transform", "translateY(-20px)"); }); </script> -- Gitblit v1.9.1