Permalink
Browse files

toggle: added cool toggle flash

  • Loading branch information...
dg committed Feb 12, 2019
1 parent 9527a62 commit fa1557e2d9282988b3ea535543a2a62e6e368903
Showing with 18 additions and 0 deletions.
  1. +10 −0 src/Tracy/assets/Toggle/toggle.css
  2. +8 −0 src/Tracy/assets/Toggle/toggle.js
@@ -26,3 +26,13 @@
.tracy-toggle.tracy-collapsed:after {
content: "\A0\25BA";
}

.tracy-flash {
animation: tracy-flash .2s ease;
}

@keyframes tracy-flash {
0% {
background: #c0c0c033;
}
}
@@ -14,6 +14,13 @@
Toggle.toggle(el);
}
});

document.documentElement.addEventListener('animationend', function (e) {
if (e.animationName === 'tracy-flash') {
e.target.classList.toggle('tracy-flash', false);
}
});

Toggle.init = function() {};
}

@@ -48,6 +55,7 @@

el.classList.toggle('tracy-collapsed', !show);
dest.classList.toggle('tracy-collapsed', !show);
dest.classList.toggle('tracy-flash', show);

if (typeof window.Event === 'function') {
var toggleEvent = new Event('tracy-toggle', {bubbles: true});

0 comments on commit fa1557e

Please sign in to comment.