Surveyjunkie.com Forgot Password [ 2024 ]
/* header with brand */ .brand-header padding: 2rem 2rem 0.75rem 2rem; text-align: center; border-bottom: 1px solid #f0f2f5;
.input-icon svg position: absolute; left: 1rem; width: 20px; height: 20px; color: #9aaec9; pointer-events: none;
// Allow "Enter" key inside email input to trigger reset emailInput.addEventListener('keypress', (e) => if (e.key === 'Enter') e.preventDefault(); handleResetPassword(); );
msgDiv.innerHTML = `$iconHtml <span>$text</span>`; messageContainer.appendChild(msgDiv); surveyjunkie.com forgot password
// Simulate API call to SurveyJunkie password reset endpoint // Because this is a frontend demo, we mimic success/error based on realistic validations. async function requestPasswordReset(email) // Mimic network delay (like real AJAX) return new Promise((resolve) => setTimeout(() => // For demo: we simulate that any well-formed email gets a "reset link sent" response. // But if the email looks suspiciously like "fail@example.com" we can simulate a "not registered" error. // to showcase both flows, but respecting SurveyJunkie style: they usually say "if account exists, we send email" // However typical recovery flow: "If there's an account associated with this email, you'll receive a reset link." // We'll follow that pattern: always show success message for valid emails, but also special case for error simulation // But we can also provide realistic edge: if email is 'error@test.com' -> show generic "something went wrong" // But better to behave like SurveyJunkie's user-friendly approach: they never reveal if email exists or not to avoid enumeration. // But to be safe, we return a success message for any valid email format, but we also show an informative message. if (email.toLowerCase() === 'noaccount@example.com') // Just to illustrate different scenario: still "If account exists" approach, but we will respect standard. resolve( success: true, message: `If an account exists for $email, you’ll receive password reset instructions shortly.` ); else if (email.toLowerCase() === 'faildemo@surveyjunkie.com') // simulate server error (rare case) resolve( success: false, message: 'Unable to process your request. Please try again later or contact support.' ); else // Standard recovery flow (SurveyJunkie style) resolve( success: true, message: `Great! We've sent a password reset link to $email. Check your inbox (and spam folder) – the link expires in 1 hour.` ); , 850); );
.back-link a:hover color: #FFB800; text-decoration: underline;
body background: linear-gradient(145deg, #e9eff5 0%, #dee6ef 100%); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; /* header with brand */
// Helper to show messages (success / error / info) function showMessage(type, text, autoClear = true) messageContainer.innerHTML = ''; // clear previous const msgDiv = document.createElement('div'); msgDiv.className = `message-box $type`;
if (autoClear && type !== 'error') // For success messages, keep them visible but allow new action to replace. // But we can set a timeout to fade? Not necessary for demo, but nice: setTimeout(() => if (messageContainer.firstChild === msgDiv) // remove only if it's still the same message msgDiv.style.transition = 'opacity 0.3s'; msgDiv.style.opacity = '0'; setTimeout(() => if (msgDiv.parentNode) msgDiv.remove(); , 300); , 5000); else if (type === 'error') // auto clear after 6 secs for error too setTimeout(() => if (msgDiv.parentNode) msgDiv.style.transition = 'opacity 0.3s'; msgDiv.style.opacity = '0'; setTimeout(() => msgDiv.remove(), 300); , 6000);
/* hidden helper */ .hidden display: none; // to showcase both flows, but respecting SurveyJunkie
.logo span:last-child background: transparent; font-weight: 600;
.input-icon position: relative; display: flex; align-items: center;