国内市场双十一活动仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.4 KiB

3 months ago
3 months ago
3 months ago
3 months ago
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  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. * {
  10. margin: 0;
  11. padding: 0;
  12. box-sizing: border-box;
  13. }
  14. body {
  15. font-family: "Microsoft Yahei", sans-serif;
  16. }
  17. /* 落地页 */
  18. .landing-page {
  19. width: 375px;
  20. height: auto;
  21. margin: 0 auto;
  22. overflow-y: auto;
  23. overflow-x: hidden;
  24. }
  25. .landing-page img {
  26. width: 100%;
  27. height: auto;
  28. display: block;
  29. }
  30. /* 弹窗 */
  31. .popup {
  32. display: none;
  33. position: fixed;
  34. top: 0;
  35. left: 0;
  36. width: 100%;
  37. height: 100%;
  38. background: rgba(0, 0, 0, 0.7);
  39. justify-content: center;
  40. align-items: center;
  41. z-index: 999;
  42. }
  43. .popup.show {
  44. display: flex;
  45. }
  46. .popup-content {
  47. width: 320px;
  48. text-align: center;
  49. }
  50. .popup-content img {
  51. width: 100%;
  52. height: auto;
  53. margin-bottom: 15px;
  54. }
  55. .popup-content img#closeBtn {
  56. width: 60%;
  57. margin-bottom: 5px;
  58. }
  59. </style>
  60. </head>
  61. <body>
  62. <!-- 落地页 -->
  63. <div class="landing-page">
  64. <img src=./assent/8折页面.png />
  65. </div>
  66. <!-- 弹窗样式 -->
  67. <div class="popup" id="popup">
  68. <div class="popup-content">
  69. <img src="./assent/弹窗样式2.png"/>
  70. <img src="./assent/开心收下.png" id="closeBtn"/>
  71. </div>
  72. </div>
  73. <script>
  74. // 获取弹窗元素(修正变量未定义问题)
  75. const popup = document.getElementById("popup");
  76. const closeBtn = document.getElementById("closeBtn");
  77. // 显示弹窗
  78. window.onload = function () {
  79. setTimeout(function () {
  80. popup.classList.add("show");
  81. }, 500);
  82. };
  83. // 点击"开心收下"按钮关闭弹窗
  84. closeBtn.addEventListener('click', function() {
  85. popup.classList.remove("show");
  86. });
  87. // 点击弹窗空白处(背景)关闭弹窗
  88. popup.addEventListener('click', function(e) {
  89. if (e.target === popup) {
  90. popup.classList.remove("show");
  91. }
  92. });
  93. </script>
  94. </body>
  95. </html>