diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2016-08-03 22:20:08 -0500 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2016-08-26 17:32:11 -0500 |
commit | 12784559316fc2c3860641bee9c6f8e2bc12c4ba (patch) | |
tree | 94cdef2a1ae60a18b9dd8b34e9e00bfc8cb06208 /app/assets/javascripts/logo.js | |
parent | c288916db124f1a0aaf5fe3eff53335f23d11921 (diff) | |
download | gitlab-ce-12784559316fc2c3860641bee9c6f8e2bc12c4ba.tar.gz |
Change logo animation to CSS
Diffstat (limited to 'app/assets/javascripts/logo.js')
-rw-r--r-- | app/assets/javascripts/logo.js | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/app/assets/javascripts/logo.js b/app/assets/javascripts/logo.js index 218f24fe908..e5d4fd44c96 100644 --- a/app/assets/javascripts/logo.js +++ b/app/assets/javascripts/logo.js @@ -1,50 +1,12 @@ (function() { - var clearHighlights, currentTimer, defaultClass, delay, firstPiece, pieceIndex, pieces, start, stop, work; - Turbolinks.enableProgressBar(); - defaultClass = 'tanuki-shape'; - - pieces = ['path#tanuki-right-cheek', 'path#tanuki-right-eye, path#tanuki-right-ear', 'path#tanuki-nose', 'path#tanuki-left-eye, path#tanuki-left-ear', 'path#tanuki-left-cheek']; - - pieceIndex = 0; - - firstPiece = pieces[0]; - - currentTimer = null; - - delay = 150; - - clearHighlights = function() { - return $("." + defaultClass + ".highlight").attr('class', defaultClass); - }; - start = function() { - clearHighlights(); - pieceIndex = 0; - if (pieces[0] !== firstPiece) { - pieces.reverse(); - } - if (currentTimer) { - clearInterval(currentTimer); - } - return currentTimer = setInterval(work, delay); + $('.tanuki-logo').addClass('animate'); }; stop = function() { - clearInterval(currentTimer); - return clearHighlights(); - }; - - work = function() { - clearHighlights(); - $(pieces[pieceIndex]).attr('class', defaultClass + " highlight"); - if (pieceIndex === pieces.length - 1) { - pieceIndex = 0; - return pieces.reverse(); - } else { - return pieceIndex++; - } + $('.tanuki-logo').removeClass('animate'); }; $(document).on('page:fetch', start); |