login.jsp 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  5. %>
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  7. <html>
  8. <head>
  9. <base href="<%=basePath%>">
  10. <title>My JSP 'index.jsp' starting page</title>
  11. <meta http-equiv="pragma" content="no-cache">
  12. <meta http-equiv="cache-control" content="no-cache">
  13. <meta http-equiv="expires" content="0">
  14. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  15. <meta http-equiv="description" content="This is my page">
  16. <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.0.min.js"></script>
  17. </head>
  18. <body>
  19. <STYLE>
  20. body{
  21. background: #ebebeb;
  22. font-family: "Helvetica Neue","Hiragino Sans GB","Microsoft YaHei","\9ED1\4F53",Arial,sans-serif;
  23. color: #222;
  24. font-size: 12px;
  25. }
  26. *{padding: 0px;margin: 0px;}
  27. .top_div{
  28. background: url("images/45.jpg");
  29. background-size: 100% 360px;
  30. width: 100%;
  31. height: 360px;
  32. }
  33. .ipt{
  34. border: 1px solid #d3d3d3;
  35. padding: 10px 10px;
  36. width: 290px;
  37. border-radius: 4px;
  38. padding-left: 35px;
  39. -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
  40. box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
  41. -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
  42. -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
  43. transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s
  44. }
  45. .ipt:focus{
  46. border-color: #66afe9;
  47. outline: 0;
  48. -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
  49. box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)
  50. }
  51. .u_logo{
  52. background: url("images/username.png") no-repeat;
  53. padding: 10px 10px;
  54. position: absolute;
  55. top: 43px;
  56. left: 40px;
  57. }
  58. .p_logo{
  59. background: url("images/password.png") no-repeat;
  60. padding: 10px 10px;
  61. position: absolute;
  62. top: 12px;
  63. left: 40px;
  64. }
  65. a{
  66. text-decoration: none;
  67. }
  68. .tou{
  69. background: url("images/tou.png") no-repeat;
  70. width: 97px;
  71. height: 92px;
  72. position: absolute;
  73. top: -87px;
  74. left: 140px;
  75. }
  76. .left_hand{
  77. background: url("images/left_hand.png") no-repeat;
  78. width: 32px;
  79. height: 37px;
  80. position: absolute;
  81. top: -38px;
  82. left: 150px;
  83. }
  84. .right_hand{
  85. background: url("images/right_hand.png") no-repeat;
  86. width: 32px;
  87. height: 37px;
  88. position: absolute;
  89. top: -38px;
  90. right: -64px;
  91. }
  92. .initial_left_hand{
  93. background: url("images/hand.png") no-repeat;
  94. width: 30px;
  95. height: 20px;
  96. position: absolute;
  97. top: -12px;
  98. left: 100px;
  99. }
  100. .initial_right_hand{
  101. background: url("images/hand.png") no-repeat;
  102. width: 30px;
  103. height: 20px;
  104. position: absolute;
  105. top: -12px;
  106. right: -112px;
  107. }
  108. .left_handing{
  109. background: url("images/left-handing.png") no-repeat;
  110. width: 30px;
  111. height: 20px;
  112. position: absolute;
  113. top: -24px;
  114. left: 139px;
  115. }
  116. .right_handinging{
  117. background: url("images/right_handing.png") no-repeat;
  118. width: 30px;
  119. height: 20px;
  120. position: absolute;
  121. top: -21px;
  122. left: 210px;
  123. }
  124. </STYLE>
  125. <SCRIPT type="text/javascript">
  126. $(function(){
  127. //得到焦点
  128. $("#password").focus(function(){
  129. $("#left_hand").animate({
  130. left: "150",
  131. top: " -38"
  132. },{step: function(){
  133. if(parseInt($("#left_hand").css("left"))>140){
  134. $("#left_hand").attr("class","left_hand");
  135. }
  136. }}, 2000);
  137. $("#right_hand").animate({
  138. right: "-64",
  139. top: "-38px"
  140. },{step: function(){
  141. if(parseInt($("#right_hand").css("right"))> -70){
  142. $("#right_hand").attr("class","right_hand");
  143. }
  144. }}, 2000);
  145. });
  146. //失去焦点
  147. $("#password").blur(function(){
  148. $("#left_hand").attr("class","initial_left_hand");
  149. $("#left_hand").attr("style","left:100px;top:-12px;");
  150. $("#right_hand").attr("class","initial_right_hand");
  151. $("#right_hand").attr("style","right:-112px;top:-12px");
  152. });
  153. });
  154. </SCRIPT>
  155. <BODY>
  156. <DIV class="top_div">
  157. <h1 align="center"><div style="margin-top:100px;"></div></h1></DIV>
  158. <DIV style="background: rgb(255, 255, 255); margin: -250px auto auto ; margin-left: 66%; border: 1px solid rgb(231, 231, 231); border-image: none; width: 400px; height: 200px; text-align: center;">
  159. <DIV style="width: 165px; height: 96px; position: absolute;">
  160. <DIV class="tou"></DIV>
  161. <DIV class="initial_left_hand" id="left_hand"></DIV>
  162. <DIV class="initial_right_hand" id="right_hand"></DIV></DIV>
  163. <form action="SportServlet?method=login" method="post" >
  164. <P style="padding: 30px 0px 10px; position: relative;"><SPAN
  165. class="u_logo"></SPAN> <INPUT class="ipt" name = "name" type="text" placeholder="请输入用户名或邮箱" value="">
  166. </P>
  167. <P style="position: relative;"><SPAN class="p_logo"></SPAN>
  168. <INPUT class="ipt" name="pass" type="password" placeholder="请输入密码" value="">
  169. </P>
  170. <p><font color="red">${requestScope.error}</font></p>
  171. <DIV style="height: 50px; line-height: 50px; margin-top: 30px; border-top-color: rgb(231, 231, 231); border-top-width: 1px; border-top-style: solid;">
  172. <P style="margin: 0px 35px 20px 45px;"><SPAN style="float: left;">
  173. <select type="option; text-align:center;"style="height:30px;" name="type">
  174. <option value="1">运动员</option>
  175. <option value="2">管理员</option>
  176. </select>
  177. <input style="background: rgb(0, 142, 173); padding: 7px 10px; border-radius: 4px; border: 1px solid rgb(26, 117, 152); border-image: none; color: rgb(255, 255, 255); font-weight: bold;"
  178. value="登录" type="submit"/>
  179. </SPAN> </P></DIV></DIV>
  180. <div style="text-align:center;">
  181. </form>
  182. </div></BODY></HTML>