-
Notifications
You must be signed in to change notification settings - Fork 30
/
index.html
160 lines (154 loc) · 5.18 KB
/
index.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="demo/stylesheets/style.css">
<script src="demo/vendor/modernizr.min.js"></script>
</head>
<body id="top">
<a href="https://github.com/space150/flyLabel.js" class="github-ribbon"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<a href="https://github.com/space150/flyLabel.js" class="github-ribbon--text">on github</a>
<div class="container">
<div class="container--inner">
<div class="intro">
<h1 class="intro__heading">flyLabel.js</h1>
<p>
Flexible floating form labels to make your boring placeholders <em>super fly</em>.
Based on the <a href="http://mattdsmith.com/float-label-pattern/">FloatLabel</a> pattern by Matt Smith.
With flyLabel.js, it's easy to trigger custom behaviors on form labels.
Check out the examples, and <a href="https://github.com/space150/flyLabel.js#contributing">contribute your own</a>.
</p>
</div>
<div class="demo-section column-wrapper cf">
<div class="behavior-demo column--left">
<h1 class="behavior-demo__heading">Classic</h1>
<div class="fly-group">
<label for="classic" class="fly-label classic">Favorite Power Ranger</label>
<input type="text" name="classic" class="fly-input" placeholder="Favorite Power Ranger">
</div>
</div>
<div class="behavior-code column--right behavior-code--odd">
<pre>
.classic {
opacity: 0;
top: 2em;
z-index: -1;
}
.classic.is-active {
opacity: 1;
top: 1em;
z-index: 1;
}
</pre>
</div>
</div>
<div class="demo-section column-wrapper cf">
<div class="behavior-demo column--left">
<h1 class="behavior-demo__heading">Drop</h1>
<div class="fly-group">
<label for="drop" class="fly-label drop">First Name</label>
<input type="text" name="drop" class="fly-input" placeholder="First Name">
</div>
</div>
<div class="behavior-code column--right ">
<pre>
.drop {
opacity: 0;
text-shadow: 0 0 25px blue;
transform: scale(11);
z-index: -1;
}
.drop.is-active {
opacity: 1;
text-shadow: 0 0 0 blue;
transform: scale(1);
z-index: 1;
}
</pre>
</div>
</div>
<div class="demo-section column-wrapper cf">
<div class="behavior-demo column--left">
<h1 class="behavior-demo__heading">From Right</h1>
<div class="fly-group">
<label for="from-right" class="fly-label from-right">Last Name</label>
<input type="text" name="from-right" class="fly-input" placeholder="Last Name">
</div>
</div>
<div class="behavior-code column--right behavior-code--odd">
<pre>
.from-right {
left: 5em;
opacity: 0;
}
.from-right.is-active {
left: 0%;
opacity: 1;
}
</pre>
</div>
</div>
<div class="demo-section column-wrapper cf">
<div class="behavior-demo column--left">
<h1 class="behavior-demo__heading">Jiggle</h1>
<div class="fly-group">
<label for="jiggle" class="fly-label jiggle">Favorite Color</label>
<input type="text" name="jiggle" class="fly-input" placeholder="e.g. red, blue, etc.">
</div>
</div>
<div class="behavior-code column--right ">
<pre>
.jiggle.is-active {
animation: JIGGLE .3s ease;
animation-iteration-count: 3;
}
</pre>
</div>
</div>
<div class="demo-section column-wrapper cf">
<div class="behavior-demo column--left">
<h1 class="behavior-demo__heading">Select</h1>
<div class="fly-group">
<label for="select" class="fly-label classic">Secret Number</label>
<div class="select-wrapper">
<select name="select" class="fly-input">
<option value="">Secret Number</option>
<option value="4">4</option>
<option value="8">8</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="23">23</option>
<option value="42">42</option>
</select>
</div>
</div>
</div>
<div class="behavior-code column--right behavior-code--odd">
<pre>
.classic {
opacity: 0;
top: 2em;
z-index: -1;
}
.classic.is-active {
opacity: 1;
top: 1em;
z-index: 1;
}
</pre>
</div>
</div>
<div class="footer">
<a href="https://github.com/space150/flyLabel.js">on github</a>
</div>
</div>
</div>
<script src="demo/vendor/jquery.min.js"></script>
<script src="dist/flyLabel.min.js"></script>
<script>
if (Modernizr.input.placeholder) {
$('body').flyLabels();
}
</script>
</body>
</html>