Sha256: c51b5d1b1c145b7ef9baa5f0d7f7b6b022cfaf9b33253d1d872e8b3aef6795d1
Contents?: true
Size: 1.96 KB
Versions: 15
Compression:
Stored size: 1.96 KB
Contents
<div class="center"> <div class="content"> <form id="login_form"> <input type="text" id="username" placeholder="Username" required/> <input type="password" id="password" placeholder="Password" required/> <input type="submit" value=""> <h1>Sign in</h1> </form> </div> </div> <div class="random_position"> <h5>English</h5> <h5>Vietnamese</h5> <h5>China</h5> <h5>Japanese</h5> <h5>Italian</h5> <h5>Korea</h5> <h5>Thai</h5> <h5>Russian</h5> <h5>Portuguese</h5> <h5>Norwegian</h5> <h5>Ukrainian</h5> <h5>Latvian</h5> <h5>Indonesian</h5> <h5>Hungarian</h5> <h5>French</h5> <h5>Persian</h5> <div/> <script> function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } var loadPosition = function () { $.each($(".random_position").find("h5"), function(index, item) { $(item).css({ top: getRandomInt(0, $("#express_translate_body").height() - $(item).height() - 5), left: getRandomInt(0, $("#express_translate_body").width() - $(item).width() - 10) }) $(item).removeClass(["animated", "bounceIn"]); $(item).addClass(["animated", "bounceIn"]); }) } loadPosition(); $(window).resize(function() { loadPosition(); }) var form = $("#login_form"); form.submit(function(event) { event.preventDefault(); $.ajax({ type: "POST", url: "/express_translate/login", data: { username: form.find("#username").val(), password: form.find("#password").val() }, success: function (data){ if (data.success) { setRlangCookie("token", data.token); setRlangCookie("username", data.username); window.notification("Login is successfully!", true); setTimeout(function() { window.location = "/express_translate" }, 1000) } else { window.notification(data.error, false); } } }) }) </script>
Version data entries
15 entries across 15 versions & 1 rubygems