chenguittiMaroua commited on
Commit
7ef985b
·
verified ·
1 Parent(s): 8bd3946

Update static/test.js

Browse files
Files changed (1) hide show
  1. static/test.js +13 -11
static/test.js CHANGED
@@ -19,7 +19,7 @@ function showSection(sectionId) {
19
  }
20
  }
21
 
22
- // Add a function to go back to cards view
23
  function showCards() {
24
  // Hide all tool sections
25
  document.querySelectorAll('.tool-section').forEach(section => {
@@ -33,19 +33,21 @@ function showCards() {
33
 
34
  // Initialize - show only cards on page load
35
  document.addEventListener('DOMContentLoaded', () => {
36
- showCards();
37
-
38
- // Your existing event listeners and other code...
39
- });
40
-
41
  // Hide all tool sections by default
42
- const sections = document.querySelectorAll('.tool-section');
43
- sections.forEach(section => {
44
  section.style.display = 'none';
45
  });
46
-
47
- // Show first section by default
48
- showSection('document-image-analysis');
 
 
 
 
 
 
 
 
49
 
50
  // Helper functions
51
  function preventDefaults(e) {
 
19
  }
20
  }
21
 
22
+ // Function to go back to cards view
23
  function showCards() {
24
  // Hide all tool sections
25
  document.querySelectorAll('.tool-section').forEach(section => {
 
33
 
34
  // Initialize - show only cards on page load
35
  document.addEventListener('DOMContentLoaded', () => {
 
 
 
 
 
36
  // Hide all tool sections by default
37
+ document.querySelectorAll('.tool-section').forEach(section => {
 
38
  section.style.display = 'none';
39
  });
40
+
41
+ // Show only the cards initially
42
+ showCards();
43
+
44
+ // Set up card click handlers
45
+ document.querySelectorAll('.card').forEach(card => {
46
+ card.addEventListener('click', function() {
47
+ const sectionId = this.getAttribute('onclick').match(/'([^']+)'/)[1];
48
+ showSection(sectionId);
49
+ });
50
+ });
51
 
52
  // Helper functions
53
  function preventDefaults(e) {