Skip to content

Commit 695f32a

Browse files
committed
add demo
1 parent f30a782 commit 695f32a

2 files changed

Lines changed: 106 additions & 3 deletions

File tree

‎demo.html‎

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<html>
2+
<head>
3+
<title>FLAPPER DEMO</title>
4+
<link href="css/flapper.css" type="text/css" rel="stylesheet" />
5+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
6+
<script src="transform/dist/jquery.transform-0.9.3.min.js"></script>
7+
<script src="src/jquery.flapper.js"></script>
8+
<script type="text/javascript">
9+
$(document).ready(function(){
10+
var opts = {
11+
chars_preset: 'alphanum',
12+
align: 'left',
13+
width: 22
14+
};
15+
16+
var $displays = $('input.display');
17+
var num = $displays.length;
18+
19+
$displays.flapper(opts);
20+
21+
var strings = [];
22+
$displays.each(function(){
23+
strings.push('');
24+
});
25+
26+
var cursor = 0;
27+
$('input.typesomething').keypress(function(event){
28+
if (event.charCode == 13) {
29+
var txt = $(this).val().toUpperCase();
30+
strings[cursor] = txt;
31+
32+
cursor++;
33+
if (cursor > num-1) {
34+
cursor = 0;
35+
}
36+
37+
$displays.each(function(i) {
38+
$(this).val(strings[i]).change();
39+
$('input.typesomething').val('');
40+
});
41+
}
42+
});
43+
});
44+
</script>
45+
<style type="text/css">
46+
body {
47+
font-family: Roboto Condensed;
48+
color: #333;
49+
}
50+
51+
.page {
52+
width: 1000px;
53+
margin: 30px auto 0;
54+
}
55+
56+
h1 {
57+
text-align: center;
58+
font-size: 64px;
59+
}
60+
61+
.displays {
62+
}
63+
64+
.flapper {
65+
margin-bottom: 2px;
66+
text-align: center;
67+
}
68+
69+
.inputarea {
70+
margin: 24px 0;
71+
}
72+
73+
input.typesomething {
74+
font-family: Roboto Condensed;
75+
font-size: 24px;
76+
width: 500px;
77+
padding: 14px;
78+
border: 0;
79+
background-color: #EEE;
80+
color: #333;
81+
}
82+
</style>
83+
</head>
84+
<body>
85+
<div class="page">
86+
<h1>FLAPPER DEMO</h1>
87+
<div class="displays">
88+
<input class="display M" />
89+
<input class="display M" />
90+
<input class="display M" />
91+
<input class="display M" />
92+
<input class="display M" />
93+
<input class="display M" />
94+
</div>
95+
<div class="inputarea">
96+
<input class="typesomething" placeholder="Type Something + <ENTER>" maxlength="22" />
97+
</div>
98+
</div>
99+
</body>
100+
</html>
101+

‎flapper.jquery.json‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
{
22
"name": "flapper",
3-
"title": "jQuery Flapper",
3+
"title": "Flapper",
44
"description": "A split-flap (Solari) display for numbers and words.",
55
"keywords": [
66
"solari",
77
"split-flap",
88
"splitflap",
9-
"display"
9+
"display",
10+
"numeric",
11+
"retro"
1012
],
1113
"version": "1.1.1",
1214
"author": {
@@ -28,7 +30,7 @@
2830
],
2931
"bugs": "https://github.com/jayKayEss/Flapper/issues",
3032
"homepage": "http://lab.jaykayess.com/Flapper/",
31-
"demo": "http://lab.jaykayess.com/Flapper/",
33+
"demo": "http://lab.jaykayess.com/Flapper/demo.html",
3234
"docs": "https://github.com/jayKayEss/Flapper/blob/master/README.md",
3335
"download": "https://github.com/jayKayEss/Flapper/archive/master.zip",
3436
"dependencies": {

0 commit comments

Comments
 (0)