password.ejs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <html lang="en">
  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="/passwordResetPages/style.css">
  9. <link href="https://fonts.googleapis.com/css?family=Saira&display=swap" rel="stylesheet">
  10. </head>
  11. <body>
  12. <% include ../shared/banner.ejs %>
  13. <form action="/reset" method="post">
  14. <h1>RESET PASSWORD:</h1>
  15. <input name="password" type="password" placeholder="NEW PASSWORD">
  16. <input name="confirmPassword" type="password" placeholder="CONFIRM PASSWORD">
  17. <input name="code" type="hidden" value="<%=code%>">
  18. <input name="id" type="hidden" value="<%=id%>">
  19. <input type="submit" value="RESET PASSWORD">
  20. <a href="/login">CANCEL</a>
  21. </form>
  22. <script>
  23. let locals = <%- JSON.stringify(locals) %>
  24. if(locals.banner !== undefined){
  25. let bannerElem = document.getElementById("banner");
  26. bannerElem.children[0].style.background = locals.banner.color;
  27. bannerElem.children[1].innerText = locals.banner.message;
  28. bannerElem.style.display = "flex";
  29. switch(locals.banner.type){
  30. case "error":
  31. bannerElem.children[0].innerHTML = `
  32. <svg width="50" height="50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  33. <circle cx="12" cy="12" r="10"></circle>
  34. <line x1="15" y1="9" x2="9" y2="15"></line>
  35. <line x1="9" y1="9" x2="15" y2="15"></line>
  36. </svg>
  37. `;
  38. break;
  39. case "success":
  40. bannerElem.children[0].innerHTML = `
  41. <svg width="50" height="50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  42. <circle cx="12" cy="12" r="10"></circle>
  43. <line x1="12" y1="8" x2="12" y2="12"></line>
  44. <line x1="12" y1="16" x2="12.01" y2="16"></line>
  45. </svg>
  46. `;
  47. break;
  48. default:
  49. bannerElem.children[0].innerHTML = `
  50. <svg width="50" height="50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  51. <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
  52. <polyline points="22 4 12 14.01 9 11.01"></polyline>
  53. </svg>
  54. `;
  55. }
  56. let timer = setTimeout(()=>{
  57. bannerElem.style.display = "none"
  58. }, 7000);
  59. bannerElem.children[2].onclick = ()=>{
  60. bannerElem.style.display = "none";
  61. clearTimeout(timer);
  62. }
  63. }
  64. </script>
  65. </body>
  66. </html>