index.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!DOCTYPE html>
  2. <html lang="en">
  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,maximum-scale=1.0,user-scalable=no,viewport-fit=cover">
  7. <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  8. <title></title>
  9. <script>
  10. (function() {
  11. function adapt(designWidth, rem2px){
  12. var d = window.document.createElement('div');
  13. d.style.width = '1rem';
  14. d.style.display = "none";
  15. var head = window.document.getElementsByTagName('head')[0];
  16. head.appendChild(d);
  17. var defaultFontSize = parseFloat(window.getComputedStyle(d, null).getPropertyValue('width'));
  18. d.remove();
  19. document.documentElement.style.fontSize = window.innerWidth / designWidth * rem2px / defaultFontSize * 100 + '%';
  20. var st = document.createElement('style');
  21. var portrait = "@media screen and (min-width: "+window.innerWidth+"px) {html{font-size:"+ ((window.innerWidth/(designWidth/rem2px)/defaultFontSize)*100) +"%;}}";
  22. var landscape = "@media screen and (min-width: "+window.innerHeight+"px) {html{font-size:"+ ((window.innerHeight/(designWidth/rem2px)/defaultFontSize)*100) +"%;}}"
  23. st.innerHTML = portrait + landscape;
  24. head.appendChild(st);
  25. return defaultFontSize
  26. };
  27. var defaultFontSize = adapt(750, 100);
  28. })();
  29. </script>
  30. </head>
  31. <body>
  32. <noscript>
  33. <strong>We're sorry but ox-new doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  34. </noscript>
  35. <div id="app"></div>
  36. <!-- built files will be auto injected -->
  37. </body>
  38. </html>