index.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Auth Service</title>
  7. <link rel="stylesheet" href="css/main.css">
  8. <link rel="icon" href="img/favicon.png" type="image/png">
  9. </head>
  10. <body>
  11. <div class="container">
  12. <div class="header">
  13. <h1>Auth Service</h1>
  14. <button class="theme-toggle" id="themeToggle" onclick="toggleTheme()" title="Switch theme">
  15. <svg class="theme-icon sun-icon" viewBox="0 0 24 24" fill="currentColor">
  16. <path d="M12 2.25a.75.75 0 01.75.75v2.25a.75.75 0 01-1.5 0V3a.75.75 0 01.75-.75zM7.5 12a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM18.894 6.166a.75.75 0 00-1.06-1.06l-1.591 1.59a.75.75 0 101.06 1.061l1.591-1.59zM21.75 12a.75.75 0 01-.75.75h-2.25a.75.75 0 010-1.5H21a.75.75 0 01.75.75zM17.834 18.894a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 10-1.061 1.06l1.59 1.591zM12 18a.75.75 0 01.75.75V21a.75.75 0 01-1.5 0v-2.25A.75.75 0 0112 18zM7.758 17.303a.75.75 0 00-1.061-1.06l-1.591 1.59a.75.75 0 001.06 1.061l1.591-1.59zM6 12a.75.75 0 01-.75.75H3a.75.75 0 010-1.5h2.25A.75.75 0 016 12zM6.697 7.757a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 00-1.061 1.06l1.59 1.591z"/>
  17. </svg>
  18. <svg class="theme-icon moon-icon" viewBox="0 0 24 24" fill="currentColor">
  19. <path d="M9.528 1.718a.75.75 0 01.162.819A8.97 8.97 0 009 6a9 9 0 009 9 8.97 8.97 0 003.463-.69.75.75 0 01.981.98 10.503 10.503 0 01-9.694 6.46c-5.799 0-10.5-4.701-10.5-10.5 0-4.368 2.667-8.112 6.46-9.694a.75.75 0 01.818.162z"/>
  20. </svg>
  21. </button>
  22. </div>
  23. <div id="authSection">
  24. <div class="tab-container">
  25. <div class="tab active" onclick="switchTab('login')">Login</div>
  26. <div class="tab" onclick="switchTab('register')">Register</div>
  27. </div>
  28. <div class="form-container">
  29. <form class="form active" id="loginForm">
  30. <div class="form-group">
  31. <label for="loginUsername">Username</label>
  32. <input type="text" id="loginUsername" name="username" required>
  33. </div>
  34. <div class="form-group">
  35. <label for="loginPassword">Password</label>
  36. <input type="password" id="loginPassword" name="password" required>
  37. </div>
  38. <button type="submit" class="submit-btn" id="loginBtn">Sign In</button>
  39. <div class="forgot-password-link">
  40. <a href="#" id="forgotPasswordLink">Forgot password</a>
  41. </div>
  42. <div id="loginMessage" class="message" style="display: none;"></div>
  43. </form>
  44. <form class="form" id="registerForm">
  45. <div class="form-group">
  46. <label for="registerUsername">Username</label>
  47. <input type="text" id="registerUsername" name="username" required>
  48. </div>
  49. <div class="form-group">
  50. <label for="registerEmail">Email (optional)</label>
  51. <input type="text" id="registerEmail" name="email">
  52. </div>
  53. <div class="form-group">
  54. <label for="registerPassword">Password</label>
  55. <input type="password" id="registerPassword" name="password" required>
  56. </div>
  57. <button type="submit" class="submit-btn" id="registerBtn">Create Account</button>
  58. <div id="registerMessage" class="message" style="display: none;"></div>
  59. </form>
  60. </div>
  61. </div>
  62. <div id="resetPasswordSection" style="display: none;">
  63. <div class="header">
  64. <h1>Reset Password</h1>
  65. <p>Enter your new password below</p>
  66. </div>
  67. <div class="form-container">
  68. <form class="form active" id="resetPasswordForm">
  69. <div class="form-group">
  70. <label for="resetNewPassword">New Password</label>
  71. <input type="password" id="resetNewPassword" name="newPassword" required>
  72. </div>
  73. <div class="form-group">
  74. <label for="resetConfirmPassword">Confirm New Password</label>
  75. <input type="password" id="resetConfirmPassword" name="confirmPassword" required>
  76. </div>
  77. <button type="submit" class="submit-btn" id="resetPasswordBtn">Reset Password</button>
  78. <div id="resetPasswordMessage" class="message" style="display: none;"></div>
  79. </form>
  80. </div>
  81. </div>
  82. <div id="userSection" class="user-info">
  83. <div class="user-details">
  84. <p><strong>Username:</strong> <span id="currentUsername"></span></p>
  85. <p><strong>Email:</strong> <span id="currentEmail"></span></p>
  86. <p><strong>User ID:</strong> <span id="currentUserId"></span></p>
  87. <p><strong>Roles:</strong> <span id="currentRoles"></span></p>
  88. </div>
  89. <div class="action-buttons">
  90. <button class="action-btn-circular" id="showEditProfileBtn" onclick="toggleEditProfileForm()" title="Edit Profile">
  91. <svg class="action-icon" width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
  92. <path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>
  93. </svg>
  94. </button>
  95. <button class="action-btn-circular admin-btn-circular" id="adminPanelBtn" onclick="openAdminPanel()" style="display: none;" title="Admin Panel">
  96. <svg class="action-icon" width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
  97. <path d="M12 1L3 5V11C3 16.55 6.84 21.74 12 23C17.16 21.74 21 16.55 21 11V5L12 1ZM12 7C13.1 7 14 7.9 14 9S13.1 11 12 11 10 10.1 10 9 10.9 7 12 7ZM18 15C16 13 12 13 12 13S8 13 6 15V13.5C6 11 9 10 12 10S18 11 18 13.5V15Z"/>
  98. </svg>
  99. </button>
  100. </div>
  101. <div class="change-password-section" id="editProfileSection" style="display: none;">
  102. <h3>Edit Profile</h3>
  103. <form id="editProfileForm">
  104. <div class="profile-section">
  105. <h4>Email Address</h4>
  106. <div class="form-group">
  107. <label for="editEmail">Email</label>
  108. <input type="email" id="editEmail" name="email" placeholder="Enter your email address">
  109. </div>
  110. </div>
  111. <div class="profile-section">
  112. <h4>Change Password</h4>
  113. <div class="form-group">
  114. <label for="newPassword">New Password</label>
  115. <input type="password" id="newPassword" name="newPassword" placeholder="Leave empty to keep current password">
  116. </div>
  117. <div class="form-group">
  118. <label for="confirmPassword">Confirm New Password</label>
  119. <input type="password" id="confirmPassword" name="confirmPassword" placeholder="Confirm your new password">
  120. </div>
  121. </div>
  122. <div class="security-section">
  123. <h4>Security Verification</h4>
  124. <div class="form-group">
  125. <label for="currentPassword">Current Password</label>
  126. <input type="password" id="currentPassword" name="currentPassword" required placeholder="Enter current password to verify changes">
  127. </div>
  128. </div>
  129. <div class="form-buttons">
  130. <button type="submit" class="submit-btn" id="editProfileBtn">Update Profile</button>
  131. </div>
  132. <div id="editProfileMessage" class="message" style="display: none;"></div>
  133. </form>
  134. </div>
  135. <button class="logout-btn" onclick="logout()">Logout</button>
  136. </div>
  137. </div>
  138. <script src="js/main.js"></script>
  139. </body>
  140. </html>