index.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="UTF-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>SHIXUN</title>
  9. <!-- 导入字体图标 -->
  10. <link rel="stylesheet" href="./font_mw3z7ts489g/iconfont.css">
  11. <style>
  12. * {
  13. margin: 0;
  14. padding: 0;
  15. box-sizing: border-box;
  16. /* 字体无法选中 */
  17. user-select: none;
  18. }
  19. body {
  20. width: 100%;
  21. height: 100vh;
  22. display: flex;
  23. justify-content: center;
  24. align-items: center;
  25. font-size: 12px;
  26. background-color: #ecf0f3;
  27. color: #a0a5a8;
  28. }
  29. .shell {
  30. position: relative;
  31. width: 1000px;
  32. min-width: 1000px;
  33. min-height: 600px;
  34. height: 600px;
  35. padding: 25px;
  36. background-color: #ecf0f3;
  37. box-shadow: 10px 10px 10px #d1d9e6, -10px -10px 10px #f9f9f9;
  38. border-radius: 12px;
  39. overflow: hidden;
  40. }
  41. /* 设置响应式 */
  42. @media (max-width: 1200px) {
  43. .shell {
  44. transform: scale(0.7);
  45. }
  46. }
  47. @media (max-width: 1000px) {
  48. .shell {
  49. transform: scale(0.6);
  50. }
  51. }
  52. @media (max-width: 800px) {
  53. .shell {
  54. transform: scale(0.5);
  55. }
  56. }
  57. @media (max-width: 600px) {
  58. .shell {
  59. transform: scale(0.4);
  60. }
  61. }
  62. .container {
  63. display: flex;
  64. justify-content: center;
  65. align-items: center;
  66. position: absolute;
  67. top: 0;
  68. width: 600px;
  69. height: 100%;
  70. padding: 25px;
  71. background-color: #ecf0f3;
  72. transition: 1.25s;
  73. }
  74. .form {
  75. display: flex;
  76. justify-content: center;
  77. align-items: center;
  78. flex-direction: column;
  79. width: 100%;
  80. height: 100%;
  81. }
  82. .iconfont {
  83. margin: 0 5px;
  84. border: rgba(0, 0, 0, 0.5) 2px solid;
  85. border-radius: 50%;
  86. font-size: 25px;
  87. padding: 3px;
  88. opacity: 0.5;
  89. transition: 0.1s;
  90. }
  91. .iconfont:hover {
  92. opacity: 1;
  93. transition: 0.15s;
  94. cursor: pointer;
  95. }
  96. .form_input {
  97. width: 350px;
  98. height: 40px;
  99. margin: 4px 0;
  100. padding-left: 25px;
  101. font-size: 13px;
  102. letter-spacing: 0.15px;
  103. border: none;
  104. outline: none;
  105. background-color: #ecf0f3;
  106. transition: 0.25s ease;
  107. border-radius: 8px;
  108. box-shadow: inset 2px 2px 4px #d1d9e6, inset -2px -2px 4px #f9f9f9;
  109. }
  110. .form_input:focus {
  111. box-shadow: inset 4px 4px 4px #d1d9e6, inset -4px -4px 4px #f9f9f9;
  112. }
  113. .form_span {
  114. margin-top: 30px;
  115. margin-bottom: 12px;
  116. }
  117. .form_link {
  118. color: #181818;
  119. font-size: 15px;
  120. margin-top: 25px;
  121. border-bottom: 1px solid #a0a5a8;
  122. line-height: 2;
  123. }
  124. .title {
  125. font-size: 34px;
  126. font-weight: 700;
  127. line-height: 3;
  128. color: #181818;
  129. letter-spacing: 10px;
  130. }
  131. .description {
  132. font-size: 14px;
  133. letter-spacing: 0.25px;
  134. text-align: center;
  135. line-height: 1.6;
  136. }
  137. .button {
  138. width: 180px;
  139. height: 50px;
  140. border-radius: 25px;
  141. margin-top: 50px;
  142. font-weight: 700;
  143. font-size: 14px;
  144. letter-spacing: 1.15px;
  145. background-color: #4B70E2;
  146. color: #f9f9f9;
  147. box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #f9f9f9;
  148. border: none;
  149. outline: none;
  150. }
  151. .a-container {
  152. z-index: 100;
  153. left: calc(100% - 600px);
  154. }
  155. .b-container {
  156. left: calc(100% - 600px);
  157. z-index: 0;
  158. }
  159. .switch {
  160. display: flex;
  161. justify-content: center;
  162. align-items: center;
  163. position: absolute;
  164. top: 0;
  165. left: 0;
  166. height: 100%;
  167. width: 400px;
  168. padding: 50px;
  169. z-index: 200;
  170. transition: 1.25s;
  171. background-color: #ecf0f3;
  172. overflow: hidden;
  173. box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #d1d9e6;
  174. }
  175. .switch_circle {
  176. position: absolute;
  177. width: 500px;
  178. height: 500px;
  179. border-radius: 50%;
  180. background-color: #ecf0f3;
  181. box-shadow: inset 8px 8px 12px #b8bec7, inset -8px -8px 12px #fff;
  182. bottom: -60%;
  183. left: -60%;
  184. transition: 1.25s;
  185. }
  186. .switch_circle-t {
  187. top: -30%;
  188. left: 60%;
  189. width: 300px;
  190. height: 300px;
  191. }
  192. .switch_container {
  193. display: flex;
  194. justify-content: center;
  195. align-items: center;
  196. flex-direction: column;
  197. position: absolute;
  198. width: 400px;
  199. padding: 50px 55px;
  200. transition: 1.25s;
  201. }
  202. .switch_button {
  203. cursor: pointer;
  204. }
  205. .switch_button:hover,
  206. .submit:hover {
  207. box-shadow: 6px 6px 10px #d1d9e6, -6px -6px 10px #f9f9f9;
  208. transform: scale(0.985);
  209. transition: 0.25s;
  210. }
  211. .switch_button:active,
  212. .switch_button:focus {
  213. box-shadow: 2px 2px 6px #d1d9e6, -2px -2px 6px #f9f9f9;
  214. transform: scale(0.97);
  215. transition: 0.25s;
  216. }
  217. .is-txr {
  218. left: calc(100% - 400px);
  219. transition: 1.25s;
  220. transform-origin: left;
  221. }
  222. .is-txl {
  223. left: 0;
  224. transition: 1.25s;
  225. transform-origin: right;
  226. }
  227. .is-z {
  228. z-index: 200;
  229. transition: 1.25s;
  230. }
  231. .is-hidden {
  232. visibility: hidden;
  233. opacity: 0;
  234. position: absolute;
  235. transition: 1.25s;
  236. }
  237. @keyframes is-gx {
  238. 0%,
  239. 10%,
  240. 100% {
  241. width: 400px;
  242. }
  243. 30%,
  244. 50% {
  245. width: 500px;
  246. }
  247. }
  248. </style>
  249. </head>
  250. <body>
  251. <div class="shell">
  252. <div class="container a-container" id="a-container">
  253. <form action="" method="" class="form" id="a-form">
  254. <h2 class="form_title title">Create new account</h2>
  255. <div class="form_icons">
  256. </div>
  257. <span class="form_span">It’s quick and easy. </span>
  258. <input type="text" class="form_input" placeholder="Name">
  259. <input type="text" class="form_input" placeholder="Email">
  260. <input type="text" class="form_input" placeholder="Password">
  261. <input type="text" class="form_input" placeholder="catptcha">
  262. <% //'A~Z' 65-90
  263. //'0~9' 48-57
  264. char[] c = {'0','1','2','3','4','5','6','7','8','9','Q','W','E','R','T','Y','U','I','O','P','A','S','D','F','G','H','J','K','L','Z','X','C','V','B','N','M'};
  265. int n;
  266. for(int i=0;i<4;i++){
  267. n = (int)(Math.random()*36);
  268. %>
  269. <%=c[n] %>
  270. <%
  271. }
  272. %>
  273. <br/>
  274. <button class="form_button button submit">SIGN UP</button>
  275. </form>
  276. </div>
  277. <div class="container b-container" id="b-container">
  278. <form action="" method="" class="form" id="b-form">
  279. <h2 class="form_title title">Log in</h2>
  280. <div class="form_icons">
  281. </div>
  282. <span class="form_span">Log in</span>
  283. <input type="text" class="form_input" placeholder="Email">
  284. <input type="text" class="form_input" placeholder="Password">
  285. <a class="form_link">forget your password?</a>
  286. <button class="form_button button submit">SIGN IN</button>
  287. </form>
  288. </div>
  289. <div class="switch" id="switch-cnt">
  290. <div class="switch_circle"></div>
  291. <div class="switch_circle switch_circle-t"></div>
  292. <div class="switch_container" id="switch-c1">
  293. <h2 class="switch_title title" style="letter-spacing: 0;">Welcome Back!</h2>
  294. <p class="switch_description description">Ready set?Let's Go!</p>
  295. <button class="switch_button button switch-btn">SIGN IN</button>
  296. </div>
  297. <div class="switch_container is-hidden" id="switch-c2">
  298. <h2 class="switch_title title" style="letter-spacing: 0;">Hello Friend!</h2>
  299. <p class="switch_description description">Crate a new account become on of us!</p>
  300. <button class="switch_button button switch-btn">SIGN UP</button>
  301. </div>
  302. </div>
  303. </div>
  304. </body>
  305. </html>
  306. <script>
  307. let switchCtn = document.querySelector("#switch-cnt");
  308. let switchC1 = document.querySelector("#switch-c1");
  309. let switchC2 = document.querySelector("#switch-c2");
  310. let switchCircle = document.querySelectorAll(".switch_circle");
  311. let switchBtn = document.querySelectorAll(".switch-btn");
  312. let aContainer = document.querySelector("#a-container");
  313. let bContainer = document.querySelector("#b-container");
  314. let allButtons = document.querySelectorAll(".submit");
  315. let getButtons = (e) => e.preventDefault()
  316. let changeForm = (e) => {
  317. // 修改类名
  318. switchCtn.classList.add("is-gx");
  319. setTimeout(function () {
  320. switchCtn.classList.remove("is-gx");
  321. }, 1500)
  322. switchCtn.classList.toggle("is-txr");
  323. switchCircle[0].classList.toggle("is-txr");
  324. switchCircle[1].classList.toggle("is-txr");
  325. switchC1.classList.toggle("is-hidden");
  326. switchC2.classList.toggle("is-hidden");
  327. aContainer.classList.toggle("is-txl");
  328. bContainer.classList.toggle("is-txl");
  329. bContainer.classList.toggle("is-z");
  330. }
  331. // 点击切换
  332. let shell = (e) => {
  333. for (var i = 0; i < allButtons.length; i++)
  334. allButtons[i].addEventListener("click", getButtons);
  335. for (var i = 0; i < switchBtn.length; i++)
  336. switchBtn[i].addEventListener("click", changeForm)
  337. }
  338. window.addEventListener("load", shell);
  339. </script>
  340. </body>
  341. </html>