-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfaculty_map.html
315 lines (257 loc) · 7.55 KB
/
faculty_map.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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>CSSA Berkeley</title>
<meta name="viewport"content="width=device-width, initial-scale=1.0">
</head>
<link rel="stylesheet" href="css/styles.css">
<link rel="icon" href="images/cssa-img.png">
<link rel="shortcut icon" href="images/ico/favicon.ico">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lato&family=Rosario:wght@700&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rosario:wght@400;500&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;400;600&display=swap" rel="stylesheet">
<style type="text/css">
.node {
cursor: pointer;
}
.overlay{
background-color: black;
}
.node rect {
fill: #fff;
stroke: steelblue;
stroke-width: 1.5px;
}
.node text {
font-size:10px;
font-family:sans-serif;
}
.link {
fill: none;
stroke: #ccc;
stroke-width: 1.5px;
}
.templink {
fill: none;
stroke: red;
stroke-width: 3px;
}
.ghostCircle.show{
display:block;
}
.ghostCircle, .activeDrag .ghostCircle{
display: none;
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="dndTree.js"></script>
<body>
<nav style="background-color: #ECF1F5">
<li class="logo-index"> <a class="logo-link" href="index.html">
<img class="logo-img" src="images/graymodelogo.png">
</a> </li>
<ul class="nav-links">
<li>
<a href="about.html">About</a>
</li>
<li>
<a href="involvement.html">Involvement</a>
</li>
<li>
<a href="events.html">Events</a>
</li>
<li>
<a href="conference.html">Conference</a>
</li>
<li>
<a href="resources.html">Resources</a>
</li>
<li>
<a href="people.html">People</a>
</li>
</ul>
<div class="burger">
<div class="line1"></div>
<div class="line2"></div>
<div class="line3"></div>
</div>
</nav>
<br>
<br>
<br>
<h1>FACULTY MAP (IN PROGRESS)</h1>
<br>
<br>
<br>
<a href="resources.html">BACK TO RESOURCES </a>
<br>
<br>
<br>
<div id="faculty-map"></div>
<style type="text/css">
#faculty-map {
display: flex;
flex-wrap: wrap;
gap: 15px;
justify-content: center;
margin-top: 20px;
padding: 20px;
position: relative;
}
/* Bubble Styles */
.bubble {
width: 150px;
height: 150px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background-color: #5a9bd6;
color: white;
text-align: center;
cursor: pointer;
font-weight: bold;
font-size: 1.1em;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
transition: transform 0.3s, width 0.5s, height 0.5s;
}
/* Hover and Click Effects */
.bubble:hover {
transform: scale(1.1);
background-color: #407bbf;
}
.zoom-in {
animation: zoomInEffect 0.3s ease forwards;
}
/* Zoom-In Animation */
@keyframes zoomInEffect {
0% { transform: scale(0.5); opacity: 0; }
100% { transform: scale(1); opacity: 1; }
}
/* Responsive Design for Mobile */
@media (max-width: 600px) {
.bubble {
width: 90px;
height: 90px;
font-size: 0.9em;
}
}
</style>
<script>
const data = {
"Psychology": {
"Clinical Psych": ["Stephen Hinshaw"],
"Social Psych": ["Serena Chan", "Arianne Eason", "Christina Maslach", "Iris Mauss", "Sheldon Zedeck"],
"Developmental Psych": ["Ozlem Ayduk", "Silvia Bunge", "Arianne Eason", "Jan Engelmann"],
"Biological Psych": [],
"Organizational Psych": []
},
"Linguistics": {
"Linguistic Science": ["Prof. D", "Prof. E"],
"Quantitative": [],
"Sociolinguistics": []
},
"Computational Modeling": {
"Natural Language Processing": [],
"Machine Learning":[]
},
"Cognitive Neuroscience":{
"Circuit, Systems & Behavioral Neuroscience": [],
"Molecular and Cellular Neuroscience": [],
"Computational Neuroscience": [],
"Cognitive Neuroscience": []
},
"Society, Culture, Cognition": {
},
"Philosophy": {
"Logic": [],
"Epistemology": [],
"Metaphysics": [],
"Philosophy of Mind": [],
"Ethics": []
}
};
const facultyMap = document.getElementById('faculty-map');
let historyStack = []; // Track navigation history
// Function to create bubbles
function createBubble(text, onClick, onDoubleClick) {
const bubble = document.createElement('div');
bubble.className = 'bubble';
bubble.textContent = text;
bubble.onclick = onClick;
bubble.ondblclick = onDoubleClick; // Double-click event for back navigation
return bubble;
}
// Function to display bubbles at each level
function displayBubbles(levelData, container) {
container.innerHTML = '';
container.classList.add("zoom-in"); // Add zoom-in effect on navigation
setTimeout(() => {
if (Array.isArray(levelData)) {
// Handle array of items (e.g., professors in a subject)
levelData.forEach((item) => {
const bubble = createBubble(item, () => none, goBackOneLevel); /// replace onClick / this part with the faculty info etc
container.appendChild(bubble);
});
} else {
// Handle objects (e.g., subjects or faculty interests)
for (const key in levelData) {
const bubble = createBubble(
key,
() => {
// Single-click: navigate deeper
historyStack.push(levelData); // Save current level to history
displayBubbles(levelData[key], container);
},
goBackOneLevel
);
container.appendChild(bubble);
}
}
}, 300); // Delay to complete zoom-in transition
}
function arrangeBubblesInCircle() {
const bubbles = document.querySelectorAll('.bubble');
var number = bubbles.length
const radius = 120; // Radius of the circle from the center
const angleStep = (2 * Math.PI) / number; // Calculate angle between each bubble
bubbles.forEach((bubble, index) => {
const angle = index * angleStep; // Calculate angle for each bubble
const x = radius * Math.cos(angle); // X coordinate
const y = radius * Math.sin(angle); // Y coordinate
// Position each bubble using transform
bubble.style.transform = `translate(${x}px, ${y}px)`;
});
}
// Call the function to arrange the bubbles
// arrangeBubblesInCircle(); UNCOMMENT WHEN READY
// FIGURE OUT HOW TO MAKE THE BACK BUTTON WORK!!!!!!!!!!!!!!
// Function to go back one level
function goBackOneLevel() {
if (historyStack.length > 0) {
const previousLevel = historyStack.pop();
displayBubbles(previousLevel, facultyMap);
}
}
// Listen for the left key to go back one level
facultyMap.addEventListener('keypress', (event) => {
if (event.keyCode == '37') {
goBackOneLevel();
}
});
// Initialize map display
displayBubbles(data, facultyMap);
</script>
<br>
<br>
<br>
<!-- <div id="tree-container"></div> -->
</body>
</html>