loading.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>ELAB</title>
  5. <link rel="stylesheet" type="text/css" href="progress/src/normalize.css">
  6. <link rel="stylesheet" type="text/css" href="progress/style.css?v-1.043543">
  7. <link rel="stylesheet" type="text/css" href="progress/number-pb.css">
  8. <link rel="stylesheet" href="css/animate.css" />
  9. <!--<link href='http://fonts.googleapis.com/css?family=Quicksand' rel='stylesheet' type='text/css'>-->
  10. <meta name="viewport" content="width=device-width, initial-scale=1">
  11. <style type="text/css">
  12. html,body{
  13. width: 100%;
  14. height: 100%;
  15. }
  16. .container{
  17. width: 100%;
  18. height: 100%;
  19. align-items:center;
  20. }
  21. .samp-cell{
  22. width: 100%;
  23. text-align: center;
  24. vertical-align: middle;
  25. }
  26. .logo{
  27. margin-top: -10%;
  28. margin-bottom: 3.5%;
  29. }
  30. .progress-num{
  31. margin: 0 auto;
  32. line-height: 100%;
  33. }
  34. .sample-pb{
  35. margin: 0 auto;
  36. }
  37. .number-pb{
  38. margin: 0 auto;
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <div class="container" id="sample-pb">
  44. <div class="samp-cell">
  45. <p class="progress-num" id="progress-num">0</p>
  46. <img class="logo" src="progress/img/LOGO.png" />
  47. <section class="sample-pb">
  48. <div class="number-pb">
  49. <div class="number-pb-shown"></div>
  50. <div class="number-pb-num">0%</div>
  51. </div>
  52. </section>
  53. </div>
  54. <div id="hidden" class="hidden">
  55. <img src="https://dm.static.elab-plus.com/图-1.jpg.1539678713888" class="hidden_img"></img>
  56. <img src="https://dm.static.elab-plus.com/1.jpg.1540437352665" class="hidden_img"></img>
  57. <img src="https://dm.static.elab-plus.com/图-3.jpg.1539678694474" class="hidden_img"></img>
  58. <!--<img src="http://yun-image.elab-plus.com/images/index/1_objects.png" class="hidden_img"></img>
  59. <img src="http://yun-image.elab-plus.com/images/index/1_objects@2x_1.png" class="hidden_img"></img>
  60. <img src="http://yun-image.elab-plus.com/images/index/1_objects@2x_2.png" class="hidden_img"></img>
  61. <img src="http://yun-image.elab-plus.com/images/index/1_objects@2x_3.png" class="hidden_img"></img>
  62. <img src="http://yun-image.elab-plus.com/images/index/1_objects@2x_4.png" class="hidden_img"></img>
  63. <img src="http://yun-image.elab-plus.com/images/index/1_objects@2x_5.png" class="hidden_img"></img>-->
  64. <img src="http://yun-image.elab-plus.com/images/1.png" class="hidden_img"></img>
  65. <img src="http://yun-image.elab-plus.com/images/BG@2x.jpg" class="hidden_img"></img>
  66. <img src="http://yun-image.elab-plus.com/images/bg01.png" class="hidden_img"></img>
  67. <img src="http://yun-image.elab-plus.com/images/bg02.png" class="hidden_img"></img>
  68. <img src="http://yun-image.elab-plus.com/images/bg03.png" class="hidden_img"></img>
  69. <img src="http://yun-image.elab-plus.com/images/Bitmap@2x.png" class="hidden_img"></img>
  70. <img src="http://yun-image.elab-plus.com/images/Bitmap@2x9.png" class="hidden_img"></img>
  71. <img src="http://yun-image.elab-plus.com/images/Group 2@2x01.png" class="hidden_img"></img>
  72. <img src="http://yun-image.elab-plus.com/images/Group 2@2x02.png" class="hidden_img"></img>
  73. <img src="http://yun-image.elab-plus.com/images/Group 2@2x03.png" class="hidden_img"></img>
  74. <img src="http://yun-image.elab-plus.com/images/Group 4@2x.png" class="hidden_img"></img>
  75. <img src="http://yun-image.elab-plus.com/images/Group 7@2x.png" class="hidden_img"></img>
  76. <img src="http://yun-image.elab-plus.com/images/Group@2x.png" class="hidden_img"></img>
  77. <img src="http://yun-image.elab-plus.com/images/Group@2x01.png" class="hidden_img"></img>
  78. <img src="http://yun-image.elab-plus.com/images/Group@2x02.png" class="hidden_img"></img>
  79. <img src="http://yun-image.elab-plus.com/images/Group@2x03.png" class="hidden_img"></img>
  80. <img src="http://yun-image.elab-plus.com/images/ic_clear@2x.png" class="hidden_img"></img>
  81. <img src="http://yun-image.elab-plus.com/images/Line.png" class="hidden_img"></img>
  82. <img src="http://yun-image.elab-plus.com/images/Line0.png" class="hidden_img"></img>
  83. <!--<img src="http://yun-image.elab-plus.com/images/LOGO.png" class="hidden_img"></img>-->
  84. <img src="http://yun-image.elab-plus.com/images/Main@2x.png" class="hidden_img"></img>
  85. <img src="http://yun-image.elab-plus.com/images/Main@2x01.png" class="hidden_img"></img>
  86. <img src="http://yun-image.elab-plus.com/images/Menu-icon.png" class="hidden_img"></img>
  87. <img src="http://yun-image.elab-plus.com/images/Menu-icon@2x.png" class="hidden_img"></img>
  88. <img src="http://yun-image.elab-plus.com/images/Works-icon@2x.png" class="hidden_img"></img>
  89. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_1.png" class="hidden_img"></img>
  90. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_2.png" class="hidden_img"></img>
  91. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_3.png" class="hidden_img"></img>
  92. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_4.png" class="hidden_img"></img>
  93. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_5.png" class="hidden_img"></img>
  94. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_6.png" class="hidden_img"></img>
  95. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x.png" class="hidden_img"></img>
  96. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_1.png" class="hidden_img"></img>
  97. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_2.png" class="hidden_img"></img>
  98. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_3.png" class="hidden_img"></img>
  99. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_4.png" class="hidden_img"></img>
  100. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_5.png" class="hidden_img"></img>
  101. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_6.png" class="hidden_img"></img>
  102. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_7.png" class="hidden_img"></img>
  103. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x.png" class="hidden_img"></img>
  104. <img src="http://yun-image.elab-plus.com/images/join/2_objects@2x_1.png" class="hidden_img"></img>
  105. <img src="http://yun-image.elab-plus.com/images/join/2_objects@2x.png" class="hidden_img"></img>
  106. <img src="http://yun-image.elab-plus.com/images/join/3_objects@2x_1.png" class="hidden_img"></img>
  107. <img src="http://yun-image.elab-plus.com/images/join/3_objects@2x.png" class="hidden_img"></img>
  108. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_1.png" class="hidden_img"></img>
  109. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_2.png" class="hidden_img"></img>
  110. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_3.png" class="hidden_img"></img>
  111. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_4.png" class="hidden_img"></img>
  112. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_5.png" class="hidden_img"></img>
  113. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_6.png" class="hidden_img"></img>
  114. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_7.png" class="hidden_img"></img>
  115. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_8.png" class="hidden_img"></img>
  116. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_9.png" class="hidden_img"></img>
  117. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_10.png" class="hidden_img"></img>
  118. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_11.png" class="hidden_img"></img>
  119. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_12.png" class="hidden_img"></img>
  120. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_13.png" class="hidden_img"></img>
  121. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_14.png" class="hidden_img"></img>
  122. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_15.png" class="hidden_img"></img>
  123. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x.png" class="hidden_img"></img>
  124. <img src="http://yun-image.elab-plus.com/images/do/2_objects@2x_1.png" class="hidden_img"></img>
  125. <img src="http://yun-image.elab-plus.com/images/do/2_objects@2x_2.png" class="hidden_img"></img>
  126. <img src="http://yun-image.elab-plus.com/images/do/2_objects@2x.png" class="hidden_img"></img>
  127. <img src="http://yun-image.elab-plus.com/images/do/3_objects@2x.png" class="hidden_img"></img>
  128. <img src="http://yun-image.elab-plus.com/images/do/4_objects@2x.png" class="hidden_img"></img>
  129. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_1.jpg" class="hidden_img"></img>
  130. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_2.jpg" class="hidden_img"></img>
  131. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_3.png" class="hidden_img"></img>
  132. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_4.png" class="hidden_img"></img>
  133. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x.jpg" class="hidden_img"></img>
  134. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_6.jpg" class="hidden_img"></img>
  135. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_7.jpg" class="hidden_img"></img>
  136. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_8.jpg" class="hidden_img"></img>
  137. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_9.png" class="hidden_img"></img>
  138. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_10.jpg" class="hidden_img"></img>
  139. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_11.jpg" class="hidden_img"></img>
  140. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_12.png" class="hidden_img"></img>
  141. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_13.png" class="hidden_img"></img>
  142. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_14.jpg" class="hidden_img"></img>
  143. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_15.jpg" class="hidden_img"></img>
  144. <img src="http://yun-image.elab-plus.com/images/projects/2_objects@2x.png" class="hidden_img"></img>
  145. <img src="https://dm.static.elab-plus.com/elabGuanWang/elab_what.png" class="hidden_img"></img>
  146. <img src="https://dm.static.elab-plus.com/elabGuanWang/elab_do.png" class="hidden_img"></img>
  147. <img src="https://dm.static.elab-plus.com/elabGuanWang/elab_news.png" class="hidden_img"></img>
  148. <img src="https://dm.static.elab-plus.com/elabGuanWang/elab_project.png" class="hidden_img"></img>
  149. <img src="https://dm.static.elab-plus.com/elabGuanWang/elab_join.png" class="hidden_img"></img>
  150. <img src="https://dm.static.elab-plus.com/elabGuanWang/Location@2x.png" class="hidden_img"></img>
  151. <img src="https://dm.static.elab-plus.com/elabGuanWang/Phone@2x.png" class="hidden_img"></img>
  152. <img src="https://dm.static.elab-plus.com/elabGuanWang/Email@2x.png" class="hidden_img"></img>
  153. </div>
  154. </div>
  155. <script src="progress/src/jquery.min.js"></script>
  156. <script>
  157. var $_h = $(window).height();
  158. $(".container").height($_h+'px');
  159. localStorage.setItem("loadComplete","0");
  160. var percent;
  161. var Count = $(".hidden_img").length; //图片数量
  162. var Imgs = new Array(Count);
  163. var ImgLoaded = 0;
  164. var Urls = new Array(Count);
  165. for(var i = 0; i < Count; i++) {
  166. var $tmp = $(".hidden_img").eq(i).attr("src");
  167. Urls[i] = $tmp;
  168. }
  169. //mock
  170. var time0 = new Date().getTime();
  171. mockloaded = function () {
  172. var cur = new Date();
  173. var t = (cur.getTime() - time0) / 1000;
  174. var s = t | 0;
  175. var res = 100;
  176. if (s >= 0 && s < 3) {
  177. res = 8 * t;
  178. }
  179. if (s >= 3 && s < 16) {
  180. res = 24 + 2 * (t - 3);
  181. }
  182. if (s >= 16 && s < 96) {
  183. res = 50 + 0.5 * (t - 16);
  184. }
  185. if (s >= 96 && s < 176) {
  186. res = 90 + 0.1 * (t - 96);
  187. }
  188. return res | 0;
  189. };
  190. function sleep(ms) {
  191. return new Promise(resolve => setTimeout(resolve, ms));
  192. }
  193. var mock = setInterval(function () {
  194. var mock = mockloaded();
  195. $("#progress-num").text(mock);
  196. $(".number-pb-shown").css("width", "" + mock + "%");
  197. },100);
  198. //预加载图片
  199. function preLoadImgs() {
  200. for(var i = 0; i < Imgs.length; i++) {
  201. Imgs[i] = new Image();
  202. downloadImage(i);
  203. }
  204. }
  205. //加载单个图片
  206. function downloadImage(i) {
  207. Imgs[i].src = Urls[i];
  208. Imgs[i].onLoad = validateImages(i);
  209. }
  210. function validateImages(i) {
  211. if(!Imgs[i].complete) {
  212. window.setTimeout('downloadImage(' + i + ')', 200);
  213. } else if(typeof Imgs[i].naturalWidth != "undefined" && Imgs[i].naturalWidth == 0) {
  214. window.setTimeout('downloadImage(' + i + ')', 200);
  215. } else {
  216. ImgLoaded++;
  217. percent = parseInt(ImgLoaded / Count * 100);
  218. if(percent >= 100) {
  219. percent = 100;
  220. $("#progress-num").text(percent);
  221. $(".number-pb-shown").css("width", "" + percent + "%");
  222. //加载完毕,关闭loading
  223. clearInterval(mock);
  224. // parent.hideLoading();
  225. localStorage.setItem("loadComplete","1");
  226. }
  227. }
  228. }
  229. preLoadImgs();
  230. </script>
  231. </div>
  232. </body>
  233. </html>