captcha.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*-------------------------------------------------
  2. Project: TEXT-160 SMS
  3. Author: Webstrot
  4. Copyright © 2019-20
  5. ----------------------------------------------------*/
  6. /*=================== Custom Functions ====================*/
  7. (function($) {
  8. "use strict";
  9. $('select').niceSelect();
  10. var BOX = $('.captchaBox');
  11. var WRAP = $('.captchaWrapper');
  12. var CHECK = $('#hiddenCaptcha');
  13. $(function(){
  14. if(CHECK.prop('checked')) {
  15. BOX.removeClass();
  16. BOX.addClass('captchaBox circle fadeOut');
  17. }
  18. });
  19. BOX.click(function() {
  20. setTimeout(scaleDown, 100);
  21. })
  22. function scaleDown() {
  23. BOX.addClass('scaleDown');
  24. setTimeout(scaleUp, 600);
  25. }
  26. function scaleUp() {
  27. BOX.removeClass('scaleDown boxHover').addClass('circle scaleUp');
  28. WRAP.addClass('rotation');
  29. setTimeout(fadeToMark, 1200);
  30. }
  31. function fadeToMark() {
  32. BOX.removeClass('scaleUp rotation').addClass('fadeOut');
  33. setTimeout(checkItOut, 400);
  34. }
  35. function checkItOut() {
  36. CHECK.prop('checked', true);
  37. }
  38. })(jQuery);
  39. /*=============== End Custom Functions ================*/