|
25 | 25 | <link href="https://cdn.jsdelivr.net/npm/quasar@1.9.10/dist/quasar.min.css" rel="stylesheet" type="text/css">
|
26 | 26 | <link href="https://cdn.jsdelivr.net/npm/animate.css@^3.5.2/animate.min.css" rel="stylesheet">
|
27 | 27 |
|
28 |
| - <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" /> |
| 28 | + <!-- <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" /> --> |
29 | 29 | <link href="https://fonts.googleapis.com/css?family=Raleway:100,300,400,500,900" rel="stylesheet">
|
30 | 30 | <link href="https://fonts.googleapis.com/css?family=Oswald:700" rel="stylesheet">
|
31 | 31 |
|
32 | 32 | <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css">
|
33 | 33 | <link rel="stylesheet" type="text/css" href="/css/main.css">
|
| 34 | + |
| 35 | + <link |
| 36 | + rel="icon" |
| 37 | + sizes="any" |
| 38 | + href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='5' fill='grey'/%3E%3C/svg%3E" |
| 39 | + > |
34 | 40 | </head>
|
35 | 41 |
|
36 | 42 | <style>
|
|
92 | 98 | display: block;
|
93 | 99 | width: 100%;
|
94 | 100 | color:white;
|
95 |
| - font-size: 0.8rem; |
| 101 | + font-size: 0.9rem; |
96 | 102 | padding: 10px 36px;
|
97 | 103 | }
|
98 | 104 | #info > a {
|
|
112 | 118 | }
|
113 | 119 | </style>
|
114 | 120 |
|
115 |
| - <body"> |
| 121 | + <body> |
116 | 122 | <!-- navigation bar -->
|
117 | 123 | <nav class="navbar navbar-expand-lg fixed-top ">
|
118 | 124 |
|
|
190 | 196 |
|
191 | 197 | <div style="position:relative;display:flex;flex-direction:column;height:calc( 100% - 65px);margin-top:65px">
|
192 | 198 | <div id="info" style="flex:0 0 120px">
|
193 |
| - Welcome to the <a href="/" target="_blank">BrainWeb</a> visualiser for the OHBM 2020 Posters. Each square represents a poster. |
194 |
| - Green squares show in real-time active posters and the number indicates how many participants |
195 |
| - are connected. Many thanks to the |
| 199 | + Welcome to the <a href="/" target="_blank">BrainWeb</a> visualiser for the |
| 200 | + <a href="https://www.humanbrainmapping.org/i4a/pages/index.cfm?pageid=3958">OHBM 2020</a> posters. Each |
| 201 | + square represents a poster. Green squares show in real-time active posters and the number indicates how |
| 202 | + many participants are connected. Many thanks to the |
196 | 203 | <a href="https://datalad-datasets.github.io/ohbm2020-posters/" target="_blank">DataLad</a> team for setting
|
197 | 204 | up all the online tracking system and poster information!
|
198 | 205 | The <a href="/" target="_blank">BrainWeb</a> aims at providing a permanent space for meeting and hacking, available all year
|
|
210 | 217 | </body>
|
211 | 218 |
|
212 | 219 | <script src="https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.min.js"></script>
|
| 220 | + <link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/4.5.0/firebase-ui-auth.css" /> |
| 221 | + <script defer src="https://www.gstatic.com/firebasejs/ui/4.5.0/firebase-ui-auth.js"></script> |
| 222 | + <script defer src="https://www.gstatic.com/firebasejs/7.12.0/firebase-app.js"></script> |
| 223 | + <script defer src="https://www.gstatic.com/firebasejs/7.12.0/firebase-auth.js"></script> |
| 224 | + <script defer src="https://www.gstatic.com/firebasejs/7.12.0/firebase-database.js"></script> |
213 | 225 | <script>
|
214 | 226 | let posters;
|
215 | 227 |
|
| 228 | + function initApp() { |
| 229 | + firebase.auth().onAuthStateChanged((user) => { |
| 230 | + if (user) { |
| 231 | + const {displayName, email, emailVerified, photoURL, uid, phoneNumber, providerData} = user; |
| 232 | + user.getIdToken().then(function(accessToken) { |
| 233 | + document.querySelector("#userAvatar img").src = photoURL; |
| 234 | + document.querySelector("#userAvatar").style.display = "inline-block"; |
| 235 | + document.getElementById("loginStatus").innerHTML = `${displayName} (<a style="color:white" href="#" onclick="signOut()">Sign Out</a>)`; |
| 236 | + }); |
| 237 | + } else { |
| 238 | + document.querySelector("#userAvatar").style.display = "none"; |
| 239 | + document.querySelector("#userAvatar img").src = ""; |
| 240 | + document.getElementById("loginStatus").innerHTML = `<a style="color:white" href="#" onclick="signIn()">Sign In</a>`; |
| 241 | + } |
| 242 | + }, function(error) { |
| 243 | + console.log(error); |
| 244 | + }); |
| 245 | + } |
| 246 | + function signIn() { |
| 247 | + uiConfig.signInSuccessUrl = "/ohbm2020/"; |
| 248 | + uiAuth.start('#firebaseui-auth-container', uiConfig); |
| 249 | + } |
| 250 | + window.signIn = signIn; |
| 251 | + function signOut() { |
| 252 | + firebase.auth().signOut(); |
| 253 | + } |
| 254 | + window.signOut = signOut; |
| 255 | + function startFirebase() { |
| 256 | + uiAuth = new firebaseui.auth.AuthUI(firebase.auth()); |
| 257 | + window.addEventListener('load', function() { |
| 258 | + initApp(); |
| 259 | + }); |
| 260 | + } |
| 261 | + |
216 | 262 | async function getPosters() {
|
217 | 263 | let res = await fetch("posters.json");
|
218 | 264 | const data = await res.json();
|
|
272 | 318 |
|
273 | 319 | function websocketDump(dump) {
|
274 | 320 | for(key in dump) {
|
275 |
| - if({}.hasOwnProperty.call(dump, key)) { |
| 321 | + if(key !== "" && {}.hasOwnProperty.call(dump, key)) { |
276 | 322 | const el = document.getElementById(`${key}`);
|
277 |
| - el.classList.add("connected"); |
| 323 | + try { |
| 324 | + el.classList.add("connected"); |
| 325 | + } catch (e) { |
| 326 | + console.log(e); |
| 327 | + console.log(`key: [${key}]`, dump); |
| 328 | + } |
278 | 329 | el.innerText=dump[key];
|
279 | 330 | el.dataset.connected = dump[key];
|
280 | 331 | }
|
|
347 | 398 |
|
348 | 399 | main();
|
349 | 400 | </script>
|
| 401 | + <script defer src="/js/init-firebase.js"></script> |
350 | 402 | </html>
|
0 commit comments