caustino commited on
Commit
8c9e659
·
verified ·
1 Parent(s): 0505d2d

Create script.js

Browse files
Files changed (1) hide show
  1. script.js +209 -0
script.js ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Timeline data
2
+ const timelineData = [
3
+ {
4
+ year: 1900,
5
+ title: "SSA begins tracking mortality data",
6
+ description: "Social Security Administration's Office of the Chief Actuary begins tracking historical death probabilities.",
7
+ category: "policy"
8
+ },
9
+ {
10
+ year: 1984,
11
+ title: "Social Security disability standards updated",
12
+ description: "Amendments mandate development of new disability standards for mental disorders.",
13
+ category: "policy"
14
+ },
15
+ {
16
+ year: 1991,
17
+ title: "Corpus callosum findings in ADHD",
18
+ description: "Hynd et al. identify smaller corpus callosum in children with ADHD.",
19
+ category: "neuroimaging"
20
+ },
21
+ {
22
+ year: 2002,
23
+ title: "Brain volume reductions in ADHD",
24
+ description: "Castellanos et al. find significant reductions in cerebral and cerebellar volumes in children with ADHD.",
25
+ category: "neuroimaging"
26
+ },
27
+ {
28
+ year: 2007,
29
+ title: "Cortical thickness delay in ADHD",
30
+ description: "Shaw et al. demonstrate children with ADHD reach peak cortical thickness ~3 years later.",
31
+ category: "neuroimaging"
32
+ },
33
+ {
34
+ year: 2017,
35
+ title: "Brain volume confirmation",
36
+ description: "Hoogman et al. confirm smaller brain volumes in ADHD through mega-analysis.",
37
+ category: "neuroimaging"
38
+ },
39
+ {
40
+ year: 2019,
41
+ title: "27 genome-wide significant risk loci",
42
+ description: "Demontis et al. identify genetic associations with ADHD.",
43
+ category: "genetics"
44
+ },
45
+ {
46
+ year: 2021,
47
+ title: "International Consensus Statement",
48
+ description: "Faraone et al. publish comprehensive review affirming ADHD as valid diagnosis.",
49
+ category: "treatment"
50
+ },
51
+ {
52
+ year: 2024,
53
+ title: "Brain connectivity findings",
54
+ description: "Norman et al. re-analyze fMRI data revealing altered connections in ADHD.",
55
+ category: "neuroimaging"
56
+ }
57
+ ];
58
+
59
+ // Researchers data
60
+ const researchersData = [
61
+ {
62
+ name: "Castellanos et al.",
63
+ contribution: "Longitudinal brain volume studies in ADHD",
64
+ category: "neuroimaging"
65
+ },
66
+ {
67
+ name: "Shaw et al.",
68
+ contribution: "Cortical maturation delay in ADHD",
69
+ category: "neuroimaging"
70
+ },
71
+ {
72
+ name: "Hoogman et al.",
73
+ contribution: "Mega-analyses of brain structure in ADHD",
74
+ category: "neuroimaging"
75
+ },
76
+ {
77
+ name: "Demontis et al.",
78
+ contribution: "Genome-wide association studies in ADHD",
79
+ category: "genetics"
80
+ },
81
+ {
82
+ name: "Faraone et al.",
83
+ contribution: "International consensus statements on ADHD",
84
+ category: "treatment"
85
+ }
86
+ ];
87
+
88
+ // Cases data
89
+ const casesData = [
90
+ {
91
+ name: "Caustin Lee McLaughlin",
92
+ description: "Case study illustrating genetic profile and disability claims process",
93
+ category: "policy"
94
+ },
95
+ {
96
+ name: "Shelley C. v. SSA",
97
+ description: "Landmark case reversing SSA's denial of ADHD disability benefits",
98
+ category: "policy"
99
+ }
100
+ ];
101
+
102
+ // Initialize the page
103
+ document.addEventListener('DOMContentLoaded', function() {
104
+ renderTimeline();
105
+ renderResearchers();
106
+ renderCases();
107
+ setupFilterButtons();
108
+ });
109
+
110
+ function renderTimeline() {
111
+ const container = document.getElementById('timeline-items');
112
+
113
+ timelineData.sort((a, b) => a.year - b.year).forEach(item => {
114
+ const itemElement = document.createElement('div');
115
+ itemElement.className = `timeline-item ${item.category}`;
116
+
117
+ itemElement.innerHTML = `
118
+ <div class="timeline-dot"></div>
119
+ <div class="bg-white p-6 rounded-lg shadow-md relative card-hover transition-all duration-300">
120
+ <div class="absolute -left-2 top-6 w-4 h-4 bg-indigo-600 transform rotate-45"></div>
121
+ <div class="flex items-center mb-2">
122
+ <span class="inline-block px-3 py-1 bg-indigo-100 text-indigo-800 rounded-full text-sm font-medium">${item.year}</span>
123
+ <span class="ml-2 px-2 py-1 bg-gray-100 text-gray-800 rounded-full text-xs font-medium">${item.category}</span>
124
+ </div>
125
+ <h3 class="text-xl font-semibold text-gray-800 mb-2">${item.title}</h3>
126
+ <p class="text-gray-600">${item.description}</p>
127
+ </div>
128
+ `;
129
+
130
+ container.appendChild(itemElement);
131
+ });
132
+ }
133
+
134
+ function renderResearchers() {
135
+ const container = document.getElementById('researchers-list');
136
+
137
+ researchersData.forEach(researcher => {
138
+ const itemElement = document.createElement('div');
139
+ itemElement.className = `researcher-item ${researcher.category} bg-gray-50 p-4 rounded-lg`;
140
+
141
+ itemElement.innerHTML = `
142
+ <h4 class="font-bold text-indigo-700">${researcher.name}</h4>
143
+ <p class="text-gray-600 text-sm">${researcher.contribution}</p>
144
+ <span class="inline-block mt-2 px-2 py-1 bg-indigo-100 text-indigo-800 rounded-full text-xs font-medium">${researcher.category}</span>
145
+ `;
146
+
147
+ container.appendChild(itemElement);
148
+ });
149
+ }
150
+
151
+ function renderCases() {
152
+ const container = document.getElementById('cases-list');
153
+
154
+ casesData.forEach(caseItem => {
155
+ const itemElement = document.createElement('div');
156
+ itemElement.className = `case-item ${caseItem.category} bg-gray-50 p-4 rounded-lg`;
157
+
158
+ itemElement.innerHTML = `
159
+ <h4 class="font-bold text-indigo-700">${caseItem.name}</h4>
160
+ <p class="text-gray-600 text-sm">${caseItem.description}</p>
161
+ <span class="inline-block mt-2 px-2 py-1 bg-indigo-100 text-indigo-800 rounded-full text-xs font-medium">${caseItem.category}</span>
162
+ `;
163
+
164
+ container.appendChild(itemElement);
165
+ });
166
+ }
167
+
168
+ function setupFilterButtons() {
169
+ const filterButtons = document.querySelectorAll('.filter-btn');
170
+
171
+ filterButtons.forEach(button => {
172
+ button.addEventListener('click', function() {
173
+ // Update active state
174
+ filterButtons.forEach(btn => btn.classList.remove('active', 'bg-indigo-600', 'text-white'));
175
+ filterButtons.forEach(btn => btn.classList.add('bg-gray-200', 'text-gray-700'));
176
+ this.classList.add('active', 'bg-indigo-600', 'text-white');
177
+ this.classList.remove('bg-gray-200', 'text-gray-700');
178
+
179
+ // Filter items
180
+ const category = this.dataset.category;
181
+ filterItems(category);
182
+ });
183
+ });
184
+ }
185
+
186
+ function filterItems(category) {
187
+ const timelineItems = document.querySelectorAll('.timeline-item');
188
+ const researcherItems = document.querySelectorAll('.researcher-item');
189
+ const caseItems = document.querySelectorAll('.case-item');
190
+
191
+ if (category === 'all') {
192
+ timelineItems.forEach(item => item.style.display = 'block');
193
+ researcherItems.forEach(item => item.style.display = 'block');
194
+ caseItems.forEach(item => item.style.display = 'block');
195
+ return;
196
+ }
197
+
198
+ timelineItems.forEach(item => {
199
+ item.style.display = item.classList.contains(category) ? 'block' : 'none';
200
+ });
201
+
202
+ researcherItems.forEach(item => {
203
+ item.style.display = item.classList.contains(category) ? 'block' : 'none';
204
+ });
205
+
206
+ caseItems.forEach(item => {
207
+ item.style.display = item.classList.contains(category) ? 'block' : 'none';
208
+ });
209
+ }