login.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <!-- Standard Meta -->
  5. <meta charset="utf-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  8. <script src="https://unpkg.com/vue/dist/vue.js"></script>
  9. <script src="https://unpkg.com/vue-i18n/dist/vue-i18n.js"></script>
  10. <!-- Site Properties -->
  11. <title>Login</title>
  12. <script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
  13. <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js" integrity="sha256-t8GepnyPmw9t+foMh3mKNvcorqNHamSKtKRxxpUEgFI=" crossorigin="anonymous"></script>
  14. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css" integrity="sha256-9mbkOfVho3ZPXfM7W8sV2SndrGDuh7wuyLjtsWeTI1Q=" crossorigin="anonymous" />
  15. <style type="text/css">
  16. body {
  17. background-color: #e3eaed;
  18. }
  19. body>.grid {
  20. height: 100%;
  21. }
  22. .image {
  23. margin-top: -100px;
  24. }
  25. .column {
  26. max-width: 450px;
  27. }
  28. .background-top {
  29. width: 100%;
  30. height: 290px;
  31. background-color: #0079ad;
  32. border-bottom: 1px solid #fff;
  33. position: absolute;
  34. top: 0;
  35. left: 0;
  36. z-index: -100;
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <div class="background-top"> </div>
  42. <div class="ui middle aligned center aligned grid">
  43. <div class="column" id="login">
  44. <h2 class="ui teal image header">
  45. <img src="asset/cuhk.png" class="image" style="width:100%">
  46. </h2>
  47. <form class="ui large form" action="/chkLogin" method="GET">
  48. <div class="ui segment">
  49. <div class="field">
  50. <h3 class="ui header">Login to {{service-name}}</h3>
  51. <p style="text-align: left">
  52. Login with<br> Student: Student-ID@link.cuhk.edu.hk<br>Staff: alias@cuhk.edu.hk<br>
  53. </p>
  54. </div>
  55. <div class="field">
  56. <div class="ui left icon input">
  57. <i class="user icon"></i>
  58. <input type="text" name="email" placeholder="E-mail address">
  59. </div>
  60. </div>
  61. <div class="field">
  62. <div class="ui left icon input">
  63. <i class="lock icon"></i>
  64. <input type="password" name="password" placeholder="Password">
  65. </div>
  66. </div>
  67. <div class="ui fluid large blue submit button" v-html="$t('message.login')"></div>
  68. </div>
  69. <div class="ui error message"></div>
  70. </form>
  71. <div class="ui message">
  72. <img class="ui small image" src="asset/{{service-image}}">
  73. </div>
  74. <div class="ui dropdown">
  75. <div class="text">English (en-US)</div>
  76. <i class="dropdown icon"></i>
  77. <div class="menu">
  78. <div class="item">English (en-US)</div>
  79. <div class="item">中文 (zh-TW)</div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </body>
  85. <script>
  86. const messages = {
  87. en: {
  88. message: {
  89. login: 'login',
  90. }
  91. },
  92. tw: {
  93. message: {
  94. login: '登入',
  95. }
  96. },
  97. }
  98. const i18n = new VueI18n({
  99. locale: 'tw',
  100. messages,
  101. })
  102. new Vue({
  103. i18n
  104. }).$mount('#login')
  105. $(document)
  106. .ready(function() {
  107. $('.ui.form')
  108. .form({
  109. fields: {
  110. email: {
  111. identifier: 'email',
  112. rules: [{
  113. type: 'empty',
  114. prompt: 'Please enter your e-mail'
  115. }, {
  116. type: 'email',
  117. prompt: 'Please enter a valid e-mail'
  118. }]
  119. },
  120. password: {
  121. identifier: 'password',
  122. rules: [{
  123. type: 'empty',
  124. prompt: 'Please enter your password'
  125. }, {
  126. type: 'length[6]',
  127. prompt: 'Your password must be at least 6 characters'
  128. }]
  129. }
  130. }
  131. });
  132. });
  133. $('.ui.dropdown')
  134. .dropdown();
  135. </script>
  136. </html>