Skip to content

Instantly share code, notes, and snippets.

@damienklinnert
Created July 12, 2012 23:44
Show Gist options
  • Save damienklinnert/3101842 to your computer and use it in GitHub Desktop.
Save damienklinnert/3101842 to your computer and use it in GitHub Desktop.
a little script to create a input field with floating letters that are flying right in
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>floating search</title>
<style>
*:focus {
outline: 0;
}
* {
font-size: 14pt;
font-weight: normal;
}
input {
width: 100px;
height: 200px;
line-height: 200px;
border: 0;
-webkit-transition: all 0.1s linear;
}
span {
float: left;
height: 200px;
line-height: 200px;
}
.big {
font-size: 80pt;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
$(function () {
$('input').keydown(function (e) {
var stuff = $('input').val();
$('#content').append(stuff);
$('input').val('');
$('input').addClass('big');
setTimeout(function () {
$('input').removeClass('big');
}, 200)
});
$('input').keyup(function (e) {
});
});
</script>
</head>
<body>
<div id="wrapper">
<span id="content"></span>
<input type="text">
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment