Spaces:
Sleeping
Sleeping
| --- | |
| interface Props { | |
| isVisible?: boolean | |
| } | |
| const { isVisible = true } = Astro.props | |
| --- | |
| <div id="login-overlay" class={`login-overlay ${isVisible ? 'visible' : 'hidden'}`}> | |
| <div class="login-modal"> | |
| <div class="login-header"> | |
| <h2>Login to Track Progress</h2> | |
| <p>Enter your email and password to track completed tasks</p> | |
| </div> | |
| <form id="login-form" class="login-form"> | |
| <div class="form-field"> | |
| <label for="email">Email</label> | |
| <input type="email" id="email" name="email" required autocomplete="email"> | |
| </div> | |
| <div class="form-field"> | |
| <label for="password">Password</label> | |
| <input type="password" id="password" name="password" required autocomplete="current-password"> | |
| </div> | |
| <div class="form-actions"> | |
| <button type="submit" class="login-btn">Login</button> | |
| </div> | |
| </form> | |
| <div id="login-error" class="login-error hidden"> | |
| Invalid email or password | |
| </div> | |
| <div class="login-footer"> | |
| <p>Session expires after 1 week</p> | |
| </div> | |
| </div> | |
| </div> | |
| <style> | |
| .login-overlay { | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| bottom: 0; | |
| background-color: rgba(0, 0, 0, 0.9); | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| z-index: 9999; | |
| backdrop-filter: blur(8px); | |
| } | |
| .login-overlay.hidden { | |
| display: none; | |
| } | |
| .login-modal { | |
| background-color: #161b22; | |
| border: 1px solid #30363d; | |
| border-radius: 12px; | |
| padding: 2rem; | |
| width: 100%; | |
| max-width: 400px; | |
| box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); | |
| } | |
| .login-header { | |
| text-align: center; | |
| margin-bottom: 2rem; | |
| } | |
| .login-header h2 { | |
| color: #f0f6fc; | |
| font-size: 1.5rem; | |
| margin-bottom: 0.5rem; | |
| } | |
| .login-header p { | |
| color: #8b949e; | |
| font-size: 0.9rem; | |
| } | |
| .login-form { | |
| display: flex; | |
| flex-direction: column; | |
| gap: 1.5rem; | |
| } | |
| .form-field { | |
| display: flex; | |
| flex-direction: column; | |
| gap: 0.5rem; | |
| } | |
| .form-field label { | |
| color: #f0f6fc; | |
| font-weight: 500; | |
| font-size: 0.9rem; | |
| } | |
| .form-field input { | |
| background-color: #0d1117; | |
| border: 1px solid #30363d; | |
| border-radius: 6px; | |
| padding: 0.75rem; | |
| color: #f0f6fc; | |
| font-size: 1rem; | |
| transition: border-color 0.2s ease; | |
| } | |
| .form-field input:focus { | |
| outline: none; | |
| border-color: #58a6ff; | |
| box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1); | |
| } | |
| .login-btn { | |
| background-color: #238636; | |
| color: white; | |
| border: none; | |
| border-radius: 6px; | |
| padding: 0.75rem 1.5rem; | |
| font-size: 1rem; | |
| font-weight: 500; | |
| cursor: pointer; | |
| transition: background-color 0.2s ease; | |
| } | |
| .login-btn:hover { | |
| background-color: #2ea043; | |
| } | |
| .login-btn:disabled { | |
| background-color: #30363d; | |
| cursor: not-allowed; | |
| } | |
| .login-error { | |
| background-color: rgba(248, 81, 73, 0.1); | |
| border: 1px solid rgba(248, 81, 73, 0.3); | |
| border-radius: 6px; | |
| padding: 0.75rem; | |
| color: #f85149; | |
| font-size: 0.9rem; | |
| text-align: center; | |
| } | |
| .login-error.hidden { | |
| display: none; | |
| } | |
| .login-footer { | |
| text-align: center; | |
| margin-top: 1.5rem; | |
| } | |
| .login-footer p { | |
| color: #8b949e; | |
| font-size: 0.8rem; | |
| } | |
| </style> | |