-
Notifications
You must be signed in to change notification settings - Fork 1
/
examples.html
117 lines (113 loc) · 4.62 KB
/
examples.html
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
<!DOCTYPE html>
<html>
<head>
<!--
digits.js - Examples
https://github.com/adressler/digits.js
Copyright 2012, Armin Dressler
Licensed under the MIT license.
See LICENSE for details.
-->
<title>digits.js – examples</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href='http://fonts.googleapis.com/css?family=Iceberg' rel='stylesheet' type='text/css'>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="jquery.digits.js"></script>
<style>
body {
font-family: Courier, sans-serif;
font-size: 12px;
}
.digitsWrapper {
padding: 3px 2px;
width: 433px;
height: 25px;
background: #cedce7; /* Old browsers */
background: -moz-linear-gradient(top, #cedce7 0%, #596a72 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cedce7), color-stop(100%,#596a72)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #cedce7 0%,#596a72 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #cedce7 0%,#596a72 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #cedce7 0%,#596a72 100%); /* IE10+ */
background: linear-gradient(top, #cedce7 0%,#596a72 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cedce7', endColorstr='#596a72',GradientType=0 ); /* IE6-9 */
}
.digitWrapper {
width: 14px;
height: 22px;
float: left;
overflow: hidden;
margin: 0;
padding: 3px 1px 0 3px;
background: #f7f7f7; /* Old browsers */
background: -moz-linear-gradient(top, #f7f7f7 0%, #dbdbdb 50%, #d1d1d1 51%, #fefefe 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7f7f7), color-stop(50%,#dbdbdb), color-stop(51%,#d1d1d1), color-stop(100%,#fefefe)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f7f7f7 0%,#dbdbdb 50%,#d1d1d1 51%,#fefefe 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f7f7f7 0%,#dbdbdb 50%,#d1d1d1 51%,#fefefe 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f7f7f7 0%,#dbdbdb 50%,#d1d1d1 51%,#fefefe 100%); /* IE10+ */
background: linear-gradient(top, #f7f7f7 0%,#dbdbdb 50%,#d1d1d1 51%,#fefefe 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f7f7f7', endColorstr='#fefefe',GradientType=0 ); /* IE6-9 */
box-shadow: 1px 1px 2px #555 inset;
}
.digitWrapper span {
display: block;
width: 12px;
height: 24px;
text-align: center;
font-family: 'Iceberg', 'Courier';
font-size: 18px;
color: #333;
line-height: 19px;
}
input, button {
font-size: 15px;
}
</style>
<script type="text/javascript" charset="utf-8">
$(function() {
// Init digits.js with a length of 24 digits, a new charset and left aligned.
// You can also define a value here. Fallback is elements' data-digits-value attribute,
// text within the element or the default text of digits.js ("HELLO WORLD!").
// The min/max values are for defining the duration each digit needs to reach the target value,
// depending on 'distance' to the character. The duration value is 'milliseconds per pixel'.
// With "silentInit: false" (also the default value) the animation will run on init. A value of
// true means that there will be no animation at startup. This is useful, if you render the
// digits markup into your page and want to plug in the digits effect afterwards.
// The 'fallback' parameter allows to set a default character - defaults to ' ' (space).
// With digitsWrapper and digitWrapper you can set class names for wrapping elements.
window.digits_conf = {
length : 24
, chars : '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.,!?'
, align : 'left'
, duration : 5
, progress : 50
, min : 600
, max : 2000
, silentInit : false
// , fallback : '_'
// , value : 'Hello digits.js!'
// , digitsWrapper : 'digitsWrapper'
// , digitWrapper : 'digitWrapper'
};
$('.digits').digits(); // you could also include options here: $('.digits').digits({ ... })
// update digits value from input box
$('form').submit(function() {
var value = $('input').val();
$('.digits').digits('set', value);
return false;
});
});
</script>
</head>
<body>
<h1>digits.js</h1>
<p>Try watching in CSS3 capable browser for full experience.</p>
<br/>
<div class="digits" data-digits-value="Fancy animated digits."></div>
<br/>
<br/>
<form>
<input type="text" length="24" value="Try this, my friend!" />
<button id="set">Update digits</button>
</form>
</body>
</html>