Skip to content

Commit

Permalink
Added some css-animated button throbbing during deployment.
Browse files Browse the repository at this point in the history
  • Loading branch information
zeke committed Jun 13, 2012
1 parent 840da12 commit ba7608d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -67,7 +67,7 @@
</fieldset> </fieldset>
<fieldset id="submitCreateFieldset" class="submit"> <fieldset id="submitCreateFieldset" class="submit">
<button type="submit" data-icon="&#x2191;" class="iconb">Deploy vCard to Heroku</button> <button type="submit" data-icon="&#x2191;" class="iconb">Deploy vCard to Heroku</button>
<span>or <a class="cancel" href="/cancel">Cancel</a></span> <span class="cancel">or <a class="cancel" href="/cancel">Cancel</a></span>
</fieldset> </fieldset>
</form> </form>
</section> </section>
Expand Down
13 changes: 12 additions & 1 deletion javascripts/vcard.js
Expand Up @@ -178,19 +178,30 @@ var email_regex = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0


function enableFormButtons() { function enableFormButtons() {
// $("#submitCreateFieldset").children().fadeIn(); // $("#submitCreateFieldset").children().fadeIn();

$("#submitCreateFieldset span.cancel").fadeTo('slow', 1);

$("#submitCreateFieldset button"). $("#submitCreateFieldset button").
text('Deploy vCard to Heroku'). text('Deploy vCard to Heroku').
removeClass('deploying').
removeClass('iconb'); removeClass('iconb');

window.clearInterval(window.throbInterval);
} }


function disableFormButtons() { function disableFormButtons() {
// $("#submitCreateFieldset").children().fadeOut(); // $("#submitCreateFieldset").children().fadeOut();

$("#submitCreateFieldset span.cancel").fadeTo('slow', 0);

$("#submitCreateFieldset button"). $("#submitCreateFieldset button").
text('Deploying...'). text('Deploying...').
addClass('deploying').
removeClass('iconb'); removeClass('iconb');

window.throbInterval = setInterval("$('#submitCreateFieldset button').toggleClass('throbby')",800);
} }



function hideValidationErrors() { function hideValidationErrors() {
$("#formBody p.error-message").remove(); $("#formBody p.error-message").remove();
$('input').removeClass('error'); $('input').removeClass('error');
Expand Down
16 changes: 16 additions & 0 deletions stylesheets/vcard.css
Expand Up @@ -697,7 +697,23 @@ form input[type=submit], form button[type=submit], form input[type=submit][disab
text-indent: none; text-indent: none;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.45); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.45);
width: inherit; width: inherit;

transition: all 0.8s;
-moz-transition: all 0.8s;
-webkit-transition: all 0.8s;
-o-transition: all 0.8s;

opacity: 1;
}

form button[type=submit].deploying {
opacity: 0.8;
} }

form button[type=submit].throbby {
opacity: .6;
}

form input[type=submit]:hover, form button[type=submit]:hover { form input[type=submit]:hover, form button[type=submit]:hover {
background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #7474be), color-stop(100%, #464695)); background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #7474be), color-stop(100%, #464695));
background: -webkit-linear-gradient(#7474be, #464695); background: -webkit-linear-gradient(#7474be, #464695);
Expand Down

0 comments on commit ba7608d

Please sign in to comment.