login.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
  6. </head>
  7. <style type="text/css">
  8. body {
  9. margin: 0;
  10. overflow: hidden;
  11. width: 300px;
  12. }
  13. #root {
  14. overflow: hidden;
  15. margin-top: -45px;
  16. height: 350px;
  17. }
  18. .loading-bg {
  19. background: #fff;
  20. position: fixed;
  21. top: 0;
  22. left: 0;
  23. right: 0;
  24. bottom: 0;
  25. z-index: 1;
  26. opacity: 0.9;
  27. }
  28. .page-loading-warp {
  29. padding: 130px;
  30. display: flex;
  31. justify-content: center;
  32. align-items: center;
  33. position: absolute;
  34. top: 0;
  35. left: 0;
  36. position: fixed;
  37. z-index: 2;
  38. }
  39. .ant-spin {
  40. -webkit-box-sizing: border-box;
  41. box-sizing: border-box;
  42. margin: 0;
  43. padding: 0;
  44. color: rgba(0, 0, 0, 0.65);
  45. font-size: 14px;
  46. font-variant: tabular-nums;
  47. line-height: 1.5;
  48. list-style: none;
  49. -webkit-font-feature-settings: 'tnum';
  50. font-feature-settings: 'tnum';
  51. position: absolute;
  52. display: none;
  53. color: #1890ff;
  54. text-align: center;
  55. vertical-align: middle;
  56. opacity: 0;
  57. -webkit-transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
  58. transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
  59. transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
  60. transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86),
  61. -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
  62. }
  63. .ant-spin-spinning {
  64. position: static;
  65. display: inline-block;
  66. opacity: 1;
  67. }
  68. .ant-spin-dot {
  69. position: relative;
  70. display: inline-block;
  71. font-size: 20px;
  72. width: 20px;
  73. height: 20px;
  74. }
  75. .ant-spin-dot-item {
  76. position: absolute;
  77. display: block;
  78. width: 9px;
  79. height: 9px;
  80. background-color: #1890ff;
  81. border-radius: 100%;
  82. -webkit-transform: scale(0.75);
  83. -ms-transform: scale(0.75);
  84. transform: scale(0.75);
  85. -webkit-transform-origin: 50% 50%;
  86. -ms-transform-origin: 50% 50%;
  87. transform-origin: 50% 50%;
  88. opacity: 0.3;
  89. -webkit-animation: antSpinMove 1s infinite linear alternate;
  90. animation: antSpinMove 1s infinite linear alternate;
  91. }
  92. .ant-spin-dot-item:nth-child(1) {
  93. top: 0;
  94. left: 0;
  95. }
  96. .ant-spin-dot-item:nth-child(2) {
  97. top: 0;
  98. right: 0;
  99. -webkit-animation-delay: 0.4s;
  100. animation-delay: 0.4s;
  101. }
  102. .ant-spin-dot-item:nth-child(3) {
  103. right: 0;
  104. bottom: 0;
  105. -webkit-animation-delay: 0.8s;
  106. animation-delay: 0.8s;
  107. }
  108. .ant-spin-dot-item:nth-child(4) {
  109. bottom: 0;
  110. left: 0;
  111. -webkit-animation-delay: 1.2s;
  112. animation-delay: 1.2s;
  113. }
  114. .ant-spin-dot-spin {
  115. -webkit-transform: rotate(45deg);
  116. -ms-transform: rotate(45deg);
  117. transform: rotate(45deg);
  118. -webkit-animation: antRotate 1.2s infinite linear;
  119. animation: antRotate 1.2s infinite linear;
  120. }
  121. .ant-spin-lg .ant-spin-dot {
  122. font-size: 32px;
  123. width: 32px;
  124. height: 32px;
  125. }
  126. .ant-spin-lg .ant-spin-dot i {
  127. width: 14px;
  128. height: 14px;
  129. }
  130. @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  131. .ant-spin-blur {
  132. background: #fff;
  133. opacity: 0.5;
  134. }
  135. }
  136. @-webkit-keyframes antSpinMove {
  137. to {
  138. opacity: 1;
  139. }
  140. }
  141. @keyframes antSpinMove {
  142. to {
  143. opacity: 1;
  144. }
  145. }
  146. @-webkit-keyframes antRotate {
  147. to {
  148. -webkit-transform: rotate(405deg);
  149. transform: rotate(405deg);
  150. }
  151. }
  152. @keyframes antRotate {
  153. to {
  154. -webkit-transform: rotate(405deg);
  155. transform: rotate(405deg);
  156. }
  157. }
  158. </style>
  159. <body>
  160. <div id="root"></div>
  161. <div id="loading">
  162. <div class="loading-bg"></div>
  163. <div class="page-loading-warp">
  164. <div class="ant-spin ant-spin-lg ant-spin-spinning">
  165. <span class="ant-spin-dot ant-spin-dot-spin">
  166. <i class="ant-spin-dot-item"></i>
  167. <i class="ant-spin-dot-item"></i>
  168. <i class="ant-spin-dot-item"></i>
  169. <i class="ant-spin-dot-item"></i>
  170. </span>
  171. </div>
  172. </div>
  173. </div>
  174. </body>
  175. <script>
  176. function getQuery(name) {
  177. var reg = new RegExp(`(^|\\?|&)${name}=([^&]*)(&|$)`);
  178. var r = window.location.href.substr(1).match(reg);
  179. if (r != null) return unescape(r[2]);
  180. return null;
  181. }
  182. var code = getQuery('code');
  183. if (code) {
  184. window.parent.postMessage('code:' + code, '*');
  185. } else {
  186. document.getElementById('loading').style.display = 'none';
  187. }
  188. new WxLogin({
  189. id: 'root',
  190. appid: 'wx8fa48dfc3752f0ce',
  191. scope: 'snsapi_login',
  192. redirect_uri: encodeURIComponent('http://www.scigou.com'),
  193. });
  194. </script>
  195. </html>