index.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!DOCTYPE html>
  2. <html lang="">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  7. <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  8. <title><%= htmlWebpackPlugin.options.title %></title>
  9. <script>
  10. var inputContent = {
  11. open:false,
  12. el:'',
  13. time:'',
  14. before_type:'',
  15. };
  16. (function (win,doc) {
  17. win.screen_conf = {
  18. width:0, // 页面可见宽度
  19. height:0, // 页面可见高度
  20. fontSize:0, // 页面单位大小
  21. proportion:0, // 比例
  22. multiple:100, // 倍数
  23. ref:1920, // 参照,
  24. startHeight: window.innerHeight,
  25. maxWidth:999999999
  26. };
  27. doc.onblur = function(){
  28. window.scroll(0,0);
  29. doc.scrollIntoView && doc.scrollIntoView();
  30. };
  31. // 定义 宽度和高度变量
  32. win.handle_size = function () {
  33. // 设置被修改的数据问题
  34. screen_conf.width = win.innerWidth;
  35. screen_conf.height = win.innerHeight;
  36. if(window.orientation==0){
  37. doc.documentElement.style.width = screen_conf.width + 'px';
  38. doc.documentElement.style.minHeight = screen_conf.height + 'px';
  39. }
  40. screen_conf.width = screen_conf.width >= win.screen_conf.maxWidth?win.screen_conf.maxWidth:screen_conf.width;
  41. screen_conf.proportion = screen_conf.width / screen_conf.ref;
  42. screen_conf.fontSize = screen_conf.proportion * screen_conf.multiple;
  43. doc.documentElement.style.fontSize = screen_conf.fontSize+'px';
  44. for (var i=0,count = observer_size.length;i<count;i++) {
  45. typeof observer_size[i] === 'function'&&observer_size[i](screen_conf);
  46. }
  47. };
  48. // 定义观察者函数
  49. win.observer_size = [];
  50. win.handle_size(0,20);
  51. window.addEventListener('resize',win.handle_size);
  52. })(window,document);
  53. </script>
  54. </head>
  55. <body>
  56. <noscript>
  57. <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  58. </noscript>
  59. <div id="app"></div>
  60. <!-- built files will be auto injected -->
  61. </body>
  62. </html>