Feedv1
This commit is contained in:
27
script.js
27
script.js
@@ -1,5 +1,7 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const loginForm = document.querySelector('.login-form');
|
||||
const loginContainer = document.querySelector('.login-container');
|
||||
const feedView = document.getElementById('feed-view');
|
||||
const emailInput = document.getElementById('email');
|
||||
const passwordInput = document.getElementById('password');
|
||||
const confirmPasswordInput = document.getElementById('confirm-password');
|
||||
@@ -73,10 +75,30 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
resetButton();
|
||||
if (!message.includes('Success')) {
|
||||
resetButton();
|
||||
}
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
function navigateToFeed() {
|
||||
if (loginContainer && feedView) {
|
||||
// Fade out login
|
||||
loginContainer.style.opacity = '0';
|
||||
|
||||
setTimeout(() => {
|
||||
loginContainer.classList.add('hidden');
|
||||
loginContainer.style.display = 'none'; // Ensure it's gone
|
||||
|
||||
// Show Feed
|
||||
feedView.classList.remove('hidden');
|
||||
// Trigger reflow
|
||||
void feedView.offsetWidth;
|
||||
feedView.classList.add('fade-in');
|
||||
}, 600); // Wait for transition
|
||||
}
|
||||
}
|
||||
|
||||
if (loginForm) {
|
||||
loginForm.addEventListener('submit', (e) => {
|
||||
e.preventDefault();
|
||||
@@ -96,7 +118,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
if (user) {
|
||||
console.log('Login Successful:', user);
|
||||
showFeedback(true, 'Success!');
|
||||
// Here you would redirect to the app
|
||||
setTimeout(navigateToFeed, 1000);
|
||||
} else {
|
||||
console.warn('Login Failed: Invalid credentials');
|
||||
showFeedback(false, 'Incorrect details');
|
||||
@@ -127,6 +149,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
setTimeout(() => {
|
||||
isLoginMode = true;
|
||||
updateUI();
|
||||
setTimeout(navigateToFeed, 1000);
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user