-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.html
235 lines (210 loc) · 10.4 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HNN Textbook</title>
<link href="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400&display=swap" rel="stylesheet">
<link rel="stylesheet" href="content/assets/styles.css">
</head>
<body>
<div id="mySidebar" class="sidebar">
<p style="color:#e5a734">
Human Neocortical Neurosolver
</p>
<br>
<a href="00_preface.md">Preface</a>
<div class="sidebar-list">
<a id="sidebar-header" onclick="toggleSubmenu(event)">
1. Under the Hood
</a>
<div class="submenu">
<a href="01_cortical_column_structure.md">1.1 Cortical Column Structure</a>
<a href="primary_electric_currents.md">1.2 Calculation of Primary Electric Currents</a>
</div>
</div>
<div class="sidebar-list">
<a id="sidebar-header" onclick="toggleSubmenu(event)">
2 Simulating ERPs
</a>
<div class="submenu">
<a href="01_overview_of_erps.md">2.1 Review of ERPs</a>
</div>
</div>
</div>
<div id="main">
<div class="topbar">
<button class="openbtn" onclick="toggleNav()">
☰
</button>
<button class="theme-toggle">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path d="M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9l-90.3 62.3c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 2.8c4.5-3.1 10.2-3.7 15.2-1.6zM160 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"></path>
</svg>
</button>
<div class="dropdown">
<button id="dropdownButton" class="dropdown-button">
<span>
A
</span>
</button>
<div class="dropdown-content">
<button class="fontsize-btn" onclick="decreaseFontSize()">
A-
</button>
<button class="fontsize-btn" onclick="increaseFontSize()">
A+
</button>
</div>
</div>
<a href="" class="home-link">
<div class="home-icon-container">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
class="home-icon">
<path
d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"
/>
</svg>
</div>
</a>
<img id="topbar-logo" src="https://hnn.brown.edu/wp-content/uploads/hnn-medium.png"</img>
<!-- Right side of topbar-->
<div class="socials-container">
<div class="social-icons">
<a href="https://github.com/jonescompneurolab/hnn-core" target="_blank" aria-label="GitHub">
<img src="icons/github.png" alt="GitHub">
</a>
<a href="https://bsky.app/profile/hnnsolver.bsky.social" target="_blank" aria-label="BlueSky">
<img src="icons/bluesky.png" alt="BlueSky">
</a>
<a href="https://www.linkedin.com/company/human-neocortical-neurosolver/" target="_blank" aria-label="LinkedIn">
<img src="icons/linkedin.png" alt="LinkedIn">
</a>
</div>
</div>
</div>
<div id="content-wrapper">
<div id="content">
<h2 id="preface-introducing-the-human-neocortical-neurosolver">
Preface:
Introducing the Human Neocortical Neurosolver
</h2>
<p>
Human Neocortical Neurosolver (HNN) is a software tool developed by
Dr. Stephanie Jones at Brown University
</p>
</div>
</div>
</div>
<script>
let isSidebarOpen = true; // Sidebar is initially open
function toggleNav() {
const sidebar = document.getElementById("mySidebar");
const main = document.getElementById("main");
// Toggle sidebar state
if (isSidebarOpen) {
sidebar.style.width = "0";
main.style.marginLeft = "0";
} else {
sidebar.style.width = "350px"; // Adjust width as needed
main.style.marginLeft = "350px"; // Match margin to new width
}
// Toggle the sidebar state
isSidebarOpen = !isSidebarOpen;
}
// Open the sidebar on page load
window.onload = function() {
// Set initial styles for open state without animation
const sidebar = document.getElementById("mySidebar");
const main = document.getElementById("main");
sidebar.style.transition = "none";
main.style.transition = "none";
sidebar.style.width = "350px";
main.style.marginLeft = "350px";
// Re-enable transition for subsequent toggles
setTimeout(() => {
sidebar.style.transition = "width 0.5s";
main.style.transition = "margin-left 0.5s";
}, 10);
}
function increaseFontSize() {
event.stopPropagation(); // Prevent dropdown from closing
const content = document.getElementById("content");
const currentSize = window.getComputedStyle(content).fontSize;
content.style.fontSize = (parseFloat(currentSize) + 2) + "px";
}
function decreaseFontSize() {
event.stopPropagation(); // Prevent dropdown from closing
const content = document.getElementById("content");
const currentSize = window.getComputedStyle(content).fontSize;
content.style.fontSize = (parseFloat(currentSize) - 2) + "px";
}
// Dropdown for font buttons
function toggleDropdown() {
const dropdownContent = document.querySelector('.dropdown-content');
dropdownContent.style.display = dropdownContent.style.display === 'block' ? 'none' : 'block';
}
// Open/close dropdown on click of the button
document.getElementById('dropdownButton').onclick = function(event) {
event.stopPropagation(); // Prevent the click from triggering the window.onclick event
toggleDropdown();
};
// Close dropdown if clicking outside
window.onclick = function(event) {
const dropdownContent = document.querySelector('.dropdown-content');
if (!event.target.closest('.dropdown')) { // Close if click outside the dropdown
dropdownContent.style.display = 'none';
}
};
function toggleSubmenu(event) {
const submenu = event.target.nextElementSibling; // Get the submenu for the clicked header
// If the submenu exists, toggle it
if (submenu && submenu.classList.contains('submenu')) {
submenu.classList.toggle('open'); // Toggle the 'open' class to control visibility
}
};
// This function will add the full text to the title attribute for all anchor tags
document.querySelectorAll('.sidebar a').forEach(anchor => {
anchor.setAttribute('title', anchor.textContent);
});
// Toggle between light and dark themes
// ----------------------------------------
// Wait for the DOM to be fully loaded
document.addEventListener('DOMContentLoaded', () => {
const themeToggle = document.querySelector('.theme-toggle');
const sidebar = document.querySelector('.sidebar');
const sunSVG = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path d="M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9l-90.3 62.3c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 2.8c4.5-3.1 10.2-3.7 15.2-1.6zM160 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"></path>
</svg>
`;
const moonSVG = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
<path d="M223.5 32C100 32 0 132.3 0 256S100 480 223.5 480c60.6 0 115.5-24.2 155.8-63.4c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-9.8 1.7-19.8 2.6-30.1 2.6c-96.9 0-175.5-78.8-175.5-176c0-65.8 36-123.1 89.3-153.3c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-6.3-.5-12.6-.8-19-.8z"></path>
</svg>
`;
// Check the saved theme preference
const savedTheme = localStorage.getItem('theme');
if (savedTheme) {
document.body.classList.toggle('dark-mode', savedTheme === 'dark');
themeToggle.innerHTML = savedTheme === 'dark' ? moonSVG : sunSVG;
sidebar.classList.toggle('dark-mode', savedTheme === 'dark');
} else {
// Default to light theme if no saved preference
themeToggle.innerHTML = sunSVG;
}
// Add click event to toggle theme
themeToggle.addEventListener('click', () => {
const isDarkMode = document.body.classList.toggle('dark-mode');
themeToggle.innerHTML = isDarkMode ? moonSVG : sunSVG;
sidebar.classList.toggle('dark-mode', isDarkMode);
localStorage.setItem('theme', isDarkMode ? 'dark' : 'light');
});
});
</script>
</body>
</html>