cestca commited on
Commit
63486ed
·
verified ·
1 Parent(s): 2e92a32

merci, peux tu notifier les bases de données en cases à cocher afin de pouvoir en selectionner plusieurs, tu peux aussi ameliorer l'esthetique du site afin qu'il soit plus agreable à visualiser

Browse files
Files changed (3) hide show
  1. index.html +99 -44
  2. script.js +4 -4
  3. style.css +25 -8
index.html CHANGED
@@ -12,17 +12,16 @@
12
  <script src="components/navbar.js"></script>
13
  <script src="components/footer.js"></script>
14
  </head>
15
- <body class="min-h-screen flex flex-col">
16
- <custom-navbar></custom-navbar>
17
 
18
  <main class="flex-grow container mx-auto px-4 py-8">
19
  <div class="max-w-4xl mx-auto text-center mb-12">
20
  <h1 class="text-4xl md:text-5xl font-bold text-gray-900 mb-4">Explore Scientific Constellations</h1>
21
  <p class="text-xl text-gray-600">Discover the most influential medical research through our cosmic visualization</p>
22
  </div>
23
-
24
- <div class="bg-white rounded-xl shadow-lg p-6 mb-12">
25
- <div class="flex flex-col md:flex-row gap-4 mb-6">
26
  <div class="flex-grow relative">
27
  <input type="text" id="searchQuery" placeholder="Search for medical research..."
28
  class="w-full pl-12 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
@@ -32,62 +31,118 @@
32
  Search
33
  </button>
34
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
- <div class="grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6">
37
- <select id="databaseSelect" class="col-span-2 sm:col-span-1 p-3 border border-gray-300 rounded-lg">
38
- <option value="pubmed">PubMed</option>
39
- <option value="medline">MEDLINE</option>
40
- <option value="scholar">Google Scholar</option>
41
- <option value="scopus">Scopus</option>
42
- <option value="cochrane">Cochrane Library</option>
43
- </select>
44
-
45
- <select id="timeRange" class="p-3 border border-gray-300 rounded-lg">
46
- <option value="all">All Time</option>
47
- <option value="10">Last 10 Years</option>
48
- <option value="5">Last 5 Years</option>
49
- <option value="2">Last 2 Years</option>
50
- </select>
51
-
52
- <select id="sortBy" class="p-3 border border-gray-300 rounded-lg">
53
- <option value="relevance">Sort by Relevance</option>
54
- <option value="citations">Sort by Citations</option>
55
- <option value="date">Sort by Date</option>
56
- </select>
57
- </div>
58
- </div>
59
 
60
- <div id="loadingSpinner" class="hidden text-center py-12">
61
- <div class="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-purple-500 mx-auto mb-4"></div>
62
- <p class="text-gray-600">Discovering research constellations...</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  </div>
64
-
65
  <div id="resultsContainer" class="hidden">
66
- <div class="flex justify-between items-center mb-6">
67
- <h2 class="text-2xl font-semibold text-gray-900">Research Constellation</h2>
68
- <div id="resultCount" class="text-gray-600"></div>
69
  </div>
70
 
71
- <div class="bg-white rounded-xl shadow-lg p-4 h-[600px] relative overflow-hidden">
72
- <svg id="constellation" class="w-full h-full"></svg>
73
  <div id="tooltip" class="absolute hidden bg-white p-4 rounded-lg shadow-lg border border-gray-200 max-w-xs pointer-events-none"></div>
74
  </div>
75
 
76
  <div id="articleList" class="mt-8 grid gap-4"></div>
77
  </div>
78
-
79
- <div id="noResults" class="hidden text-center py-12">
80
- <i data-feather="alert-circle" class="mx-auto text-gray-400 w-12 h-12 mb-4"></i>
81
- <h3 class="text-xl font-medium text-gray-900 mb-2">No results found</h3>
82
- <p class="text-gray-600">Try different search terms or filters</p>
 
 
83
  </div>
84
- </main>
85
 
86
  <custom-footer></custom-footer>
87
-
88
  <script src="script.js"></script>
89
  <script>
90
  feather.replace();
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  </script>
92
  <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
93
  </body>
 
12
  <script src="components/navbar.js"></script>
13
  <script src="components/footer.js"></script>
14
  </head>
15
+ <body class="min-h-screen flex flex-col bg-gradient-to-b from-white to-gray-50">
16
+ <custom-navbar></custom-navbar>
17
 
18
  <main class="flex-grow container mx-auto px-4 py-8">
19
  <div class="max-w-4xl mx-auto text-center mb-12">
20
  <h1 class="text-4xl md:text-5xl font-bold text-gray-900 mb-4">Explore Scientific Constellations</h1>
21
  <p class="text-xl text-gray-600">Discover the most influential medical research through our cosmic visualization</p>
22
  </div>
23
+ <div class="bg-white rounded-xl shadow-lg p-8 mb-12">
24
+ <div class="flex flex-col md:flex-row gap-4 mb-6">
 
25
  <div class="flex-grow relative">
26
  <input type="text" id="searchQuery" placeholder="Search for medical research..."
27
  class="w-full pl-12 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
 
31
  Search
32
  </button>
33
  </div>
34
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
35
+ <div class="bg-gray-50 p-4 rounded-xl">
36
+ <h3 class="text-sm font-medium text-gray-700 mb-3">Databases</h3>
37
+ <div class="space-y-2">
38
+ <label class="flex items-center space-x-2 cursor-pointer">
39
+ <input type="checkbox" name="database" value="pubmed" checked class="rounded border-gray-300 text-purple-600 focus:ring-purple-500">
40
+ <span class="text-gray-700">PubMed</span>
41
+ </label>
42
+ <label class="flex items-center space-x-2 cursor-pointer">
43
+ <input type="checkbox" name="database" value="medline" class="rounded border-gray-300 text-purple-600 focus:ring-purple-500">
44
+ <span class="text-gray-700">MEDLINE</span>
45
+ </label>
46
+ <label class="flex items-center space-x-2 cursor-pointer">
47
+ <input type="checkbox" name="database" value="scholar" class="rounded border-gray-300 text-purple-600 focus:ring-purple-500">
48
+ <span class="text-gray-700">Google Scholar</span>
49
+ </label>
50
+ <label class="flex items-center space-x-2 cursor-pointer">
51
+ <input type="checkbox" name="database" value="scopus" class="rounded border-gray-300 text-purple-600 focus:ring-purple-500">
52
+ <span class="text-gray-700">Scopus</span>
53
+ </label>
54
+ <label class="flex items-center space-x-2 cursor-pointer">
55
+ <input type="checkbox" name="database" value="cochrane" class="rounded border-gray-300 text-purple-600 focus:ring-purple-500">
56
+ <span class="text-gray-700">Cochrane Library</span>
57
+ </label>
58
+ </div>
59
+ </div>
60
 
61
+ <div class="bg-gray-50 p-4 rounded-xl">
62
+ <h3 class="text-sm font-medium text-gray-700 mb-3">Time Range</h3>
63
+ <div class="space-y-2">
64
+ <label class="flex items-center space-x-2 cursor-pointer">
65
+ <input type="radio" name="timeRange" value="all" checked class="rounded-full border-gray-300 text-purple-600 focus:ring-purple-500">
66
+ <span class="text-gray-700">All Time</span>
67
+ </label>
68
+ <label class="flex items-center space-x-2 cursor-pointer">
69
+ <input type="radio" name="timeRange" value="10" class="rounded-full border-gray-300 text-purple-600 focus:ring-purple-500">
70
+ <span class="text-gray-700">Last 10 Years</span>
71
+ </label>
72
+ <label class="flex items-center space-x-2 cursor-pointer">
73
+ <input type="radio" name="timeRange" value="5" class="rounded-full border-gray-300 text-purple-600 focus:ring-purple-500">
74
+ <span class="text-gray-700">Last 5 Years</span>
75
+ </label>
76
+ <label class="flex items-center space-x-2 cursor-pointer">
77
+ <input type="radio" name="timeRange" value="2" class="rounded-full border-gray-300 text-purple-600 focus:ring-purple-500">
78
+ <span class="text-gray-700">Last 2 Years</span>
79
+ </label>
80
+ </div>
81
+ </div>
 
 
82
 
83
+ <div class="bg-gray-50 p-4 rounded-xl">
84
+ <h3 class="text-sm font-medium text-gray-700 mb-3">Sort By</h3>
85
+ <div class="space-y-2">
86
+ <label class="flex items-center space-x-2 cursor-pointer">
87
+ <input type="radio" name="sortBy" value="relevance" checked class="rounded-full border-gray-300 text-purple-600 focus:ring-purple-500">
88
+ <span class="text-gray-700">Relevance</span>
89
+ </label>
90
+ <label class="flex items-center space-x-2 cursor-pointer">
91
+ <input type="radio" name="sortBy" value="citations" class="rounded-full border-gray-300 text-purple-600 focus:ring-purple-500">
92
+ <span class="text-gray-700">Citations</span>
93
+ </label>
94
+ <label class="flex items-center space-x-2 cursor-pointer">
95
+ <input type="radio" name="sortBy" value="date" class="rounded-full border-gray-300 text-purple-600 focus:ring-purple-500">
96
+ <span class="text-gray-700">Date</span>
97
+ </label>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ <div id="loadingSpinner" class="hidden text-center py-16">
103
+ <div class="animate-spin rounded-full h-16 w-16 border-t-4 border-b-4 border-purple-500 mx-auto mb-6"></div>
104
+ <p class="text-gray-600 text-lg font-medium">Discovering research constellations...</p>
105
  </div>
 
106
  <div id="resultsContainer" class="hidden">
107
+ <div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-8 gap-4">
108
+ <h2 class="text-3xl font-bold text-gray-900">Research Constellation</h2>
109
+ <div id="resultCount" class="text-lg text-purple-600 font-medium"></div>
110
  </div>
111
 
112
+ <div class="bg-gradient-to-br from-purple-50 to-blue-50 rounded-xl shadow-lg p-6 h-[600px] relative overflow-hidden border border-gray-100">
113
+ <svg id="constellation" class="w-full h-full"></svg>
114
  <div id="tooltip" class="absolute hidden bg-white p-4 rounded-lg shadow-lg border border-gray-200 max-w-xs pointer-events-none"></div>
115
  </div>
116
 
117
  <div id="articleList" class="mt-8 grid gap-4"></div>
118
  </div>
119
+ <div id="noResults" class="hidden text-center py-16">
120
+ <i data-feather="alert-circle" class="mx-auto text-gray-400 w-16 h-16 mb-6"></i>
121
+ <h3 class="text-2xl font-bold text-gray-900 mb-3">No results found</h3>
122
+ <p class="text-gray-600 text-lg">Try different search terms or filters</p>
123
+ <button class="mt-6 px-6 py-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors font-medium">
124
+ Try Again
125
+ </button>
126
  </div>
127
+ </main>
128
 
129
  <custom-footer></custom-footer>
 
130
  <script src="script.js"></script>
131
  <script>
132
  feather.replace();
133
+
134
+ // Update database selection logic
135
+ document.addEventListener('DOMContentLoaded', function() {
136
+ const searchButton = document.getElementById('searchButton');
137
+
138
+ searchButton.addEventListener('click', function() {
139
+ const selectedDatabases = Array.from(document.querySelectorAll('input[name="database"]:checked'))
140
+ .map(el => el.value);
141
+
142
+ console.log('Selected databases:', selectedDatabases);
143
+ // Update your search logic to use selectedDatabases instead of single select
144
+ });
145
+ });
146
  </script>
147
  <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
148
  </body>
script.js CHANGED
@@ -1,10 +1,10 @@
1
  document.addEventListener('DOMContentLoaded', function() {
2
  const searchButton = document.getElementById('searchButton');
3
  const searchQuery = document.getElementById('searchQuery');
4
- const databaseSelect = document.getElementById('databaseSelect');
5
- const timeRange = document.getElementById('timeRange');
6
- const sortBy = document.getElementById('sortBy');
7
- const loadingSpinner = document.getElementById('loadingSpinner');
8
  const resultsContainer = document.getElementById('resultsContainer');
9
  const noResults = document.getElementById('noResults');
10
  const resultCount = document.getElementById('resultCount');
 
1
  document.addEventListener('DOMContentLoaded', function() {
2
  const searchButton = document.getElementById('searchButton');
3
  const searchQuery = document.getElementById('searchQuery');
4
+ const databaseCheckboxes = document.querySelectorAll('input[name="database"]');
5
+ const timeRange = document.querySelector('input[name="timeRange"]:checked').value;
6
+ const sortBy = document.querySelector('input[name="sortBy"]:checked').value;
7
+ const loadingSpinner = document.getElementById('loadingSpinner');
8
  const resultsContainer = document.getElementById('resultsContainer');
9
  const noResults = document.getElementById('noResults');
10
  const resultCount = document.getElementById('resultCount');
style.css CHANGED
@@ -5,30 +5,47 @@
5
  }
6
 
7
  .node:hover {
8
- transform: scale(1.1);
 
9
  }
10
 
11
  .link {
12
- stroke: #e2e8f0;
13
- stroke-opacity: 0.6;
 
 
 
 
 
14
  }
15
 
16
  .central-node {
17
  stroke: #7c3aed;
18
- stroke-width: 2px;
19
- filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.5));
 
20
  }
21
 
 
 
 
 
 
22
  /* Article card styles */
23
  .article-card {
24
- transition: transform 0.2s ease, box-shadow 0.2s ease;
 
25
  }
26
 
27
  .article-card:hover {
28
- transform: translateY(-4px);
29
- box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
 
30
  }
31
 
 
 
 
32
  /* Responsive adjustments */
33
  @media (max-width: 640px) {
34
  #constellation {
 
5
  }
6
 
7
  .node:hover {
8
+ transform: scale(1.15);
9
+ filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.3));
10
  }
11
 
12
  .link {
13
+ stroke: #d1d5db;
14
+ stroke-opacity: 0.8;
15
+ transition: stroke-opacity 0.3s ease;
16
+ }
17
+
18
+ .link:hover {
19
+ stroke-opacity: 1;
20
  }
21
 
22
  .central-node {
23
  stroke: #7c3aed;
24
+ stroke-width: 3px;
25
+ filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.6));
26
+ animation: pulse 2s infinite;
27
  }
28
 
29
+ @keyframes pulse {
30
+ 0% { transform: scale(1); }
31
+ 50% { transform: scale(1.05); }
32
+ 100% { transform: scale(1); }
33
+ }
34
  /* Article card styles */
35
  .article-card {
36
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
37
+ border: 1px solid rgba(224, 231, 255, 0.5);
38
  }
39
 
40
  .article-card:hover {
41
+ transform: translateY(-6px);
42
+ box-shadow: 0 20px 25px -5px rgba(124, 58, 237, 0.1), 0 10px 10px -5px rgba(124, 58, 237, 0.04);
43
+ border-color: rgba(124, 58, 237, 0.3);
44
  }
45
 
46
+ .article-card:first-child {
47
+ background: linear-gradient(to right, rgba(124, 58, 237, 0.05), transparent);
48
+ }
49
  /* Responsive adjustments */
50
  @media (max-width: 640px) {
51
  #constellation {