JSFiddle - React, Tailwind, and code Playground

by Clear

JavaScript

$( document ).ready(function() {
            var opened = false;
		  $('#register-btn').click(function() {
            if (!opened) {
			$('#register-box').animate({
              'left': '380px',
              'opacity': 1
            }, 600 , 'easeOutExpo');
		  $('#login-box').fadeOut('fast');
		  $('#register-btn').animate({
              'bottom': '50%',
			  'margin-bottom': '-55px'
            }, 600 , 'easeOutExpo');
            opened = true;
            } else {
                $('#register-box').animate({
              'left': '998px',
              'opacity': 0
            }, 600 , 'easeOutExpo');
		  $('#login-box').fadeIn('slow');
		  $('#register-btn').animate({
              'bottom': '0px',
			  'margin-bottom': '0px'
            }, 600 , 'easeOutExpo');
		});
              opened = false;
          }
                
		});