authorization_form.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <link rel="stylesheet" href="style.css" />
  6. <link rel="shortcut icon" href="img/icon.svg" type="image/svg">
  7. <title>Авторизация</title>
  8. <script src="main.js"></script>
  9. <script src="second.js"></script>
  10. <style>
  11. @import url('https://fonts.googleapis.com/css2?family=Abhaya+Libre:wght@400;500;600;700;800&display=swap');
  12. input[type="checkbox"] {
  13. display: none;
  14. }
  15. html {
  16. height: 100%;
  17. }
  18. body {
  19. background:
  20. url(img/pinkCircles.png) left bottom no-repeat,
  21. url(img/yellowCorner.png) right top no-repeat;
  22. margin-left: -10px;
  23. position:absolute;
  24. margin-right: 200px;
  25. position:absolute;
  26. }
  27. </style>
  28. </head>
  29. <body class="registration_form">
  30. <a href="main_unregistered.html"><input type="button" value="Отменить" class="button-back"></a>
  31. <p class="heads-form">Авторизация</p>
  32. <form class="form-position" name="form">
  33. <div class="element">
  34. <label class="lable">Почта</label><br>
  35. <input type="text" placeholder="User@mail.ru" class="input" tabIndex="1" onkeydown="return tab(this, event)" id="email">
  36. </div>
  37. <div class="element">
  38. <label class="lable">Пароль</label><br>
  39. <input type="password" placeholder="***********" class="input" tabIndex="2" id="password">
  40. </div>
  41. <label class="container">Запомните меня на этом компьютере
  42. <input type="checkbox">
  43. <span class="checkmark"></span>
  44. </label>
  45. <div class="button">
  46. <button onclick="fetchData()" class="button-text" id="avtoriz">Авторизоваться</button>
  47. <script>
  48. function fetchData(){
  49. // Make a GET request
  50. var emailInput = document.querySelector('input[id="email"]:valid');
  51. var passwordInput = document.querySelector('input[id="password"]:valid');
  52. if (emailInput.checkValidity() && passwordInput.checkValidity()) {
  53. var aurl = "https://iis.ngknn.ru/NGKNN/МамшеваЮС/12/api/User/Authorization?" + new URLSearchParams({
  54. Email: emailInput.value,
  55. Password: passwordInput.value
  56. });
  57. try {
  58. // Make a GET request
  59. let response = fetch(aurl);
  60. if (!response.ok) {
  61. throw new Error(`HTTP error! Status: ${response.status}`);
  62. }
  63. let data = response.json();
  64. console.log(data);
  65. } catch (e) {
  66. console.error('Fetch error: ' + e.message);
  67. }
  68. }
  69. }
  70. </script>
  71. </div>
  72. </form>
  73. <a href="registration_form.html" class="link"><p class="footer-form">Впервые у нас?</p></a>
  74. </body>