password.ejs 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta content="width=device-width, initial-scale=1" name="viewport"/>
  6. <title>The Subline</title>
  7. <link rel="icon" type="img/png" href="/shared/images/logo.png">
  8. <link rel="stylesheet" href="/shared/shared.css">
  9. <link rel="stylesheet" href="/passwordResetPages/passwordReset.css">
  10. <link href="https://fonts.googleapis.com/css?family=Saira&display=swap" rel="stylesheet">
  11. </head>
  12. <body>
  13. <div class="header">
  14. <a class="headerStart" href="/" >
  15. <img src="/shared/images/logo.png" alt="Subline">
  16. <div class='headerLogo'>THE SUBLINE</div>
  17. </a>
  18. <div class="headerEnd">
  19. <a id="helpLink" class="headerHide" href="/help">HELP</a>
  20. <a id="privacyPolicyLink" class="headerHide" href="/privacy">PRIVACY POLICY</a>
  21. <a id="termsLink" class="headerHide" href="/terms">TERMS AND CONDITIONS</a>
  22. </div>
  23. </div>
  24. <% include ../shared/banner.ejs %>
  25. <h1 class="title">Reset Password</h1>
  26. <form class="form" action="/reset" method="post">
  27. <input name="password" type="password" class="formInput" placeholder="password">
  28. <input name="confirmPassword" type="password" class="formInput" placeholder="confirm password">
  29. <input name="code" type="hidden" value="<%=code%>">
  30. <input name="id" type="hidden" value="<%=id%>">
  31. <input class="button" type="submit" value="RESET PASSWORD">
  32. </form>
  33. <script>
  34. let locals = <%- JSON.stringify(locals) %>
  35. if(locals.banner !== undefined){
  36. let bannerElem = document.getElementById("banner");
  37. bannerElem.children[0].style.background = locals.banner.color;
  38. bannerElem.children[1].innerText = locals.banner.message;
  39. bannerElem.style.display = "flex";
  40. switch(banner.type){
  41. case "error":
  42. bannerElem.children[0].innerHTML = `
  43. <svg width="50" height="50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  44. <circle cx="12" cy="12" r="10"></circle>
  45. <line x1="15" y1="9" x2="9" y2="15"></line>
  46. <line x1="9" y1="9" x2="15" y2="15"></line>
  47. </svg>
  48. `;
  49. break;
  50. case "success":
  51. bannerElem.children[0].innerHTML = `
  52. <svg width="50" height="50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  53. <circle cx="12" cy="12" r="10"></circle>
  54. <line x1="12" y1="8" x2="12" y2="12"></line>
  55. <line x1="12" y1="16" x2="12.01" y2="16"></line>
  56. </svg>
  57. `;
  58. break;
  59. default:
  60. bannerElem.children[0].innerHTML = `
  61. <svg width="50" height="50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  62. <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
  63. <polyline points="22 4 12 14.01 9 11.01"></polyline>
  64. </svg>
  65. `;
  66. }
  67. let timer = setTimeout(()=>{
  68. bannerElem.style.display = "none"
  69. }, 7000);
  70. bannerElem.children[2].onclick = ()=>{
  71. bannerElem.style.display = "none";
  72. clearTimeout(timer);
  73. }
  74. }
  75. </script>
  76. </body>
  77. </html>