Last active
August 29, 2015 14:07
-
-
Save hrumhrumble/25779284c31fe144ffb1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DEMO - fun-box.ru | |
showProgress = -> | |
counter = -> | |
count = $(".pace-progress").attr("data-progress") | |
countDone = 99 | |
bug = $('.pace-progress').find('.bug') | |
if bug.length < 1 | |
$('.pace-progress').append(" | |
<div class='bug'> | |
<div class='bug_img'></div> | |
<div class='loader'> | |
<div class='inner'></div> | |
</div> | |
<div class='dots'></div> | |
</div> | |
") | |
if count < countDone | |
$('.loader .inner').css('top', -68 + (count*0.68)+'px') | |
switch count < countDone | |
when (count > 15 and count < 30) | |
$('.pace-progress .dots').addClass('p30 dot_mini') | |
when (count > 30 and count < 45) | |
$('.pace-progress .dots').removeClass('p30 dot_mini') | |
$('.pace-progress .dots').addClass('p45 dot_middle') | |
when (count > 46 and count < 60) | |
$('.pace-progress .dots').removeClass('p45 dot_middle') | |
$('.pace-progress .dots').addClass('p60 dot_big') | |
when (count > 61 and count < 75) | |
$('.pace-progress .dots').removeClass('p60') | |
$('.pace-progress .dots').addClass('p75') | |
when (count > 76 and count < 90) | |
$('.pace-progress .dots').removeClass('p75 dot_big') | |
$('.pace-progress .dots').addClass('p90 dot_middle') | |
when (count > 90 and count < 99) | |
$('.pace-progress .dots').removeClass('p90 dot_middle') | |
$('.pace-progress .dots').addClass('p99 dot_mini') | |
return | |
else | |
return false | |
setInterval counter, 100 | |
showProgress() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment