ccgenerative commited on
Commit
66e2393
·
verified ·
1 Parent(s): f180d5e

after sign in, not navigating to home page.

Browse files
Files changed (1) hide show
  1. script.js +7 -2
script.js CHANGED
@@ -2,16 +2,21 @@ document.addEventListener('DOMContentLoaded', function() {
2
  // Simulate login (in a real app, this would be handled by a backend)
3
  const loginForm = document.querySelector('#login-form');
4
  const dashboard = document.querySelector('#dashboard');
5
-
6
  if (loginForm) {
7
  loginForm.addEventListener('submit', function(e) {
8
  e.preventDefault();
9
  dashboard.classList.remove('hidden');
10
  document.querySelector('#login-modal').classList.add('hidden');
 
11
  });
12
  }
13
 
14
- // Testing type selection
 
 
 
 
 
15
  const testingTypeCards = document.querySelectorAll('.testing-type-card');
16
  const testingDashboard = document.querySelector('#testing-dashboard');
17
  const testingTypeTitle = document.querySelector('#testing-type-title');
 
2
  // Simulate login (in a real app, this would be handled by a backend)
3
  const loginForm = document.querySelector('#login-form');
4
  const dashboard = document.querySelector('#dashboard');
 
5
  if (loginForm) {
6
  loginForm.addEventListener('submit', function(e) {
7
  e.preventDefault();
8
  dashboard.classList.remove('hidden');
9
  document.querySelector('#login-modal').classList.add('hidden');
10
+ window.location.hash = '#dashboard';
11
  });
12
  }
13
 
14
+ // Check for hash on load
15
+ if (window.location.hash === '#dashboard') {
16
+ dashboard.classList.remove('hidden');
17
+ document.querySelector('#login-modal').classList.add('hidden');
18
+ }
19
+ // Testing type selection
20
  const testingTypeCards = document.querySelectorAll('.testing-type-card');
21
  const testingDashboard = document.querySelector('#testing-dashboard');
22
  const testingTypeTitle = document.querySelector('#testing-type-title');