-
Notifications
You must be signed in to change notification settings - Fork 1
/
rubberDucks.html
136 lines (106 loc) · 2.69 KB
/
rubberDucks.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Rubber ducks webkit demo</title>
<style type="text/css">
body {
font-family: "Helvetica Neue", Helvetica;
font-size: 24px;
}
p {
font-weight: 100;
margin-left: 30px;
color:#888;
}
.rubberDuck {
position: absolute;
opacity: 0;
}
.duckMover {
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function:ease-in-out;
}
.barContainer {
float: left;
}
.bar {
height:90px;
width:80%;
-webkit-border-radius:5px;
border: 5px solid rgba(255,255,255,0);
-webkit-transition-property: width;
-webkit-transition-duration: 0.2s;
-webkit-transition-timing-function:ease;
background-color: #cde76a;
}
.balance {
text-align:right;
padding:20px;
}
.barContainer {
width: 400px;
height: 100px;
margin:30px;
border: 1px solid #cccccc;
-webkit-border-radius:5px;
}
@-webkit-keyframes greenPulse {
from { border-color: rgba(0,255,0,1); }
to { border-color: rgba(255,255,255,0.5); }
}
@-webkit-keyframes greenPulseEnd {
from { border-color: rgba(0,255,0,1); }
to { border-color: rgba(0,255,0,0); }
}
@-webkit-keyframes grayPulse {
from { border-color: rgba(0,0,0,0.5); }
to { border-color: rgba(0,0,0,0); }
}
@-webkit-keyframes grayPulseEnd {
from { border-color: rgba(0,0,0,0.5); }
to { border-color: rgba(0,0,0,0); }
}
.sourceBarEnd, .targetBarEnd {
-webkit-animation-duration: 0.5s;
-webkit-animation-iteration-count: 1;
}
.sourceBar, .targetBar {
-webkit-animation-duration: 1s;
-webkit-animation-direction: alternate;
-webkit-animation-iteration-count: infinite;
}
.sourceBar {
-webkit-animation-name: greenPulse;
}
.sourceBarEnd {
-webkit-animation-name: greenPulseEnd;
}
.targetBar {
-webkit-animation-name: grayPulse;
}
.targetBarEnd {
-webkit-animation-name: grayPulseEnd;
}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="rubberDucks.js"></script>
</head>
<body>
<p>Hello. Each box contains up to 100 rubber ducks. Drag from one box to another to move ducks between boxes. Use two fingers to rotate and zoom the boxes.</p>
<p><a href="http://github.com/jaanus/rubberDucks">Read more about this demo.</a></p>
<div class="container">
<div class="barContainer duck0">
<div class="bar"><div class="balance">10</div></div>
</div>
<div class="barContainer duck1">
<div class="bar"><div class="balance">20</div></div>
</div>
<div class="barContainer duck2">
<div class="bar"><div class="balance">30</div></div>
</div>
</div>
</body>
</html>