Advertisement
Guest User

Untitled

a guest
Jun 10th, 2020
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. (function ($) {
  2. 'use strict';
  3.  
  4. function genCode() {
  5. var code = 'DMR-' + Math.floor(1000 + Math.random() * 9000);
  6. $('.verify-code span').append(code)
  7. }
  8.  
  9. function verify(user, code) {
  10. $.get('https://www.habbo.com.br/api/public/users', {
  11. name: user,
  12. cache: false
  13. }).done(function (res) {
  14. if (res.motto.toUpperCase().indexOf(code) != -1) {
  15. $('#verify-user').remove();
  16. $('.submit-buttons').append('<input class="button1" type="submit" name="submit" value="Continuar">');
  17. return
  18. }
  19. $('.verify-motto').text('Código não encontrado. Tente novamente!');
  20. $('.verify-motto').css('background-color', '#E54732');
  21. return
  22. }).fail(function () {
  23. $('.verify-motto').text('Este usuário não existe. Tente novamente!');
  24. $('.verify-motto').css('background-color', '#E54732');
  25. return
  26. })
  27. }
  28. $(function () {
  29. if (_userdata["session_logged_in"] === 1) {
  30. return
  31. }
  32. if (!((/^\/register/i.test(location.pathname)) && (/^\?step\=2.*$/i.test(location.search)))) {
  33. return
  34. }
  35. var $fieldset = $('.submit-buttons');
  36. $fieldset.find('input').remove();
  37. $fieldset.append('<div id="verify-user">' + '<div class="verify-code">Coloque esse código na sua missão: <span></span></div>' + '<a href="javascript:void(0);" class="verify-motto">Verificar</a>' + '</div>');
  38. genCode();
  39. $('.verify-motto').on('click', function () {
  40. $(this).text('Verificando...');
  41. $(this).css('background-color', '#2e3133');
  42. var inputUser = $('#username_reg').val();
  43. var userCode = $('.verify-code span').text();
  44. verify(inputUser, userCode)
  45. });
  46. $('<style>', {
  47. 'text': ['#verify-user {', ' width: 70%;', ' margin: auto;', ' text-align: center;', '}', '', '.verify-code {', ' font-size: 18px;', ' margin-bottom: 20px;', ' background-color: #0062cc;', ' color: #fff;', ' padding: 10px;', '}', '', '.verify-code span {', ' font-weight: 700;', ' text-decoration: underline;', '}', '', '.verify-motto {', ' background-color: #5CCD5C;', ' color: #FFF!important;', ' border-radius: 3px;', ' box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.2), 0 1px 5px 0 rgba(0,0,0,0.12);', ' font-size: 15px;', ' padding: 10px 24px;', ' transition: ease .2s;', '}', '', '.verify-motto:hover {', ' -ms-filter: brightness(90%);', ' -webkit-filter: brightness(90%);', ' filter: brightness(90%);', ' background-color: #3abc3a;', '}'].join('')
  48. }).appendTo('head')
  49. })
  50. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement