diff --git a/src/badges.ts b/src/badges.ts index 94fc068..311ab2d 100644 --- a/src/badges.ts +++ b/src/badges.ts @@ -1,3 +1,9 @@ +/* +TODO: +This should be replaced with just copying the images folder. +But the build system has to be rewritten for that, and not just use neuroglancer's +*/ + import edits10 from './images/badges/edits10.png'; import edits100 from './images/badges/edits100.png'; import edits1000000 from './images/badges/edits1000000.png'; diff --git a/src/components/ExtensionBar.vue b/src/components/ExtensionBar.vue index 6c82479..b68dec2 100644 --- a/src/components/ExtensionBar.vue +++ b/src/components/ExtensionBar.vue @@ -47,6 +47,25 @@ function logout(session: loginSession) { login.logout(session); } +function openUserProfile() { + showUserProfile.value = true; + const badgeEls = document.querySelectorAll('.nge-user-profile-badge'); + let i = 0; + const delay = 300; + for (const badgeEl of badgeEls) { + badgeEl.classList.add('animate-hide'); + setTimeout(function() { + badgeEl.classList.remove('animate-hide'); + badgeEl.classList.add('animate-fade-in'); + //reset animation + (badgeEl as HTMLElement).style.animation = 'none'; + (badgeEl as HTMLElement).offsetHeight; + (badgeEl as HTMLElement).style.animation = ''; + }, i * delay); + i++; + } +} +