forked from conartist6/splitflap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.htm
More file actions
151 lines (141 loc) · 3.8 KB
/
Copy pathindex.htm
File metadata and controls
151 lines (141 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!doctype html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Split-Flap Display Control</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script type="text/javascript" src="js/splitflap.js"></script>
<script type="text/javascript" src="http:////cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js"></script>
<link type="text/css" rel="stylesheet" href="/css/reset.css" />
<link type="text/css" rel="stylesheet" href="css/splitflap.css" />
<style>
body
{
position: absolute;
width: 100%;
margin: 0 auto;
height: 300px;
top: 32%;
margin-top: -74px;
text-align: center;
font-size: 30px;
}
.splitflap
{
font-size: 150px;
margin-bottom: 30px;
}
.splitflap .segment
{
font-family: sans-serif;
width: 145px;
}
#clock
{
position: fixed;
bottom: 0;
left: 50%;
font-size: 90px;
margin: 0 0 20px -178px;
}
#clock .segment
{
width: 120px;
}
.twentyfour li
{
text-align: right !important;
}
.twentyfour li:after
{
content: " ";
display: inline-block;
width: 10px;
}
.ampm
{
margin-left: -7px !important;
}
.ampm li
{
font-size: 30px !important;
width: 58px !important;
border-radius: 8px !important;
}
.splitflap .ampm .top li
{
border-bottom-left-radius: 0 !important;
border-bottom-right-radius: 0 !important;
}
.splitflap .ampm .bottom li
{
border-top-left-radius: 0 !important;
border-top-right-radius: 0 !important;
}
.splitflap .segment:first-child .top li
{
border-top-left-radius: 20px;
}
.splitflap .segment:last-child .top li
{
border-top-right-radius: 20px;
}
.splitflap .segment:first-child .bottom li
{
border-bottom-left-radius: 20px;
}
.splitflap .segment:last-child .bottom li
{
border-bottom-right-radius: 20px;
}
</style>
<script type="text/javascript">//<![CDATA[
$(window).load(function(){
var disp = $("#splitflap").splitflap({
initial: "HELLO",
glyphSet: [" ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",".","?","!",","]
});
setTimeout(function(){disp.splitflap("value", "WORLD")}, 1900);
$("#print").on("submit", function(e)
{
var input = $("#print input");
disp.splitflap("value", input.val());
input.val("");
e.preventDefault();
});
function clockInput(time)
{
return [time.toString("h"), time.toString("mm"), time.toString("tt")];
}
var now = new Date();
var clock = $("#clock").splitflap({
glyphSet:
{
".hours.twentyfour": $.splitflap.twentyfour,
".minutes": $.splitflap.minutes,
".ampm": ["AM", "PM"]
},
initial: clockInput(now)
});
function updateClock() {
var now = new Date();
setTimeout(updateClock, (62 - now.getSeconds()) * 1000);
$("#clock").splitflap("value", clockInput(now));
}
setTimeout(updateClock, (62 - now.getSeconds()) * 1000);
});//]]>
</script>
</head>
<body>
<a href="https://github.com/conartist6/splitflap"><img style="position: fixed; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<div id="splitflap">
</div>
<form id="print" action="javascript:">
display.print("<input type="text" name="text" size="6"></input>");
</form>
<div id="clock">
<div class="segment hours twentyfour"></div><span style="font-size: 1.1em; font-weight: 600">:</span><div class="segment minutes"></div>
<div class="segment ampm">
</div>
</div>
</body></html>