qa-nexus-commander / components /auth-modal.js
ccgenerative's picture
Can not login, what are the credentials. Can you please add below creds in any sample DB. username: sample@test.com / Test123#
f180d5e verified
Raw
History Blame Contribute Delete
3.27 kB
class AuthModal extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
.modal {
position: fixed;
inset: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
}
.modal-content {
background-color: white;
padding: 2rem;
border-radius: 0.5rem;
width: 100%;
max-width: 400px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
animation: modalFadeIn 0.3s ease-out forwards;
}
.tabs {
display: flex;
margin-bottom: 1.5rem;
border-bottom: 1px solid #e5e7eb;
}
.tab {
padding: 0.75rem 1rem;
cursor: pointer;
font-weight: 500;
color: #6b7280;
border-bottom: 2px solid transparent;
}
.tab.active {
color: #3b82f6;
border-bottom-color: #3b82f6;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
.form-group {
margin-bottom: 1rem;
}
label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
}
input {
width: 100%;
padding: 0.5rem 0.75rem;
border: 1px solid #d1d5db;
border-radius: 0.375rem;
}
button {
width: 100%;
padding: 0.75rem;
background-color: #3b82f6;
color: white;
border: none;
border-radius: 0.375rem;
font-weight: 500;
cursor: pointer;
}
button:hover {
background-color: #2563eb;
}
@keyframes modalFadeIn {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
</style>
<div id="login-modal" class="modal">
<div class="modal-content">
<div class="tabs">
<div class="tab active">Login</div>
</div>
<form id="login-form" class="tab-content active">
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" required>
</div>
<button type="submit">Sign In</button>
<div id="error-message" class="text-red-500 mt-2 text-sm hidden"></div>
</form>
</div>
</div>
`;
// Initialize Feather Icons in shadow DOM
const featherScript = document.createElement('script');
featherScript.src = 'https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js';
this.shadowRoot.appendChild(featherScript);
featherScript.onload = () => {
if (window.feather) {
window.feather.replace();
}
};
}
}
customElements.define('auth-modal', AuthModal);