index.html 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!doctype html>
  2. <html lang="">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <link rel="icon" href="/favicon.ico" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>博物中国</title>
  8. <style>
  9. html,
  10. body {
  11. height: 100%;
  12. margin: 0;
  13. }
  14. .app-frame-shell {
  15. box-sizing: border-box;
  16. /* 大写 PX:避免 postcss-px-to-viewport 把壳层宽度换算成 vw */
  17. max-width: 640PX;
  18. height: 100%;
  19. min-height: 100%;
  20. margin: 0 auto;
  21. }
  22. .app-frame-shell iframe {
  23. display: block;
  24. border: 0;
  25. width: 100%;
  26. height: 100%;
  27. vertical-align: top;
  28. }
  29. </style>
  30. </head>
  31. <body>
  32. <div class="app-frame-shell">
  33. <iframe id="app-frame" title="博物中国"></iframe>
  34. </div>
  35. <script>
  36. (function () {
  37. var iframe = document.getElementById("app-frame");
  38. var hash = window.location.hash;
  39. if (!hash || hash === "#") {
  40. hash = "#/";
  41. }
  42. iframe.src = "./app.html" + hash;
  43. })();
  44. </script>
  45. </body>
  46. </html>