-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
350 lines (316 loc) · 15.6 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="css/css?family=Inconsolata:400,700">
<title>Wowdown - Beautiful dropdowns</title>
<meta name="description" content="Beautiful dropdowns" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="icon.png" rel="icon" type="image/png">
<link rel="stylesheet" type="text/css" href="css/foundation.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/app.css">
<link rel="stylesheet" type="text/css" href="css/prism.css">
<script src="js/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="css/wowdown.css">
<script src="js/wowdown.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('select.normal').wowdown()
$('select#hero_select').wowdown({
vertical_padding: "10px",
})
$('#myblue_dropdown').wowdown({
background: "#0f37a9",
active_background: "rgb(149, 211, 255)",
placeholder_color: "#97bce0",
placeholder_active_color: "#0f37a9",
option_color: "#405463",
vertical_padding: "15px",
horizontal_padding: "20px"
})
$('#intense_dropdown').wowdown({
background: "#1d456f",
active_background: "rgb(135, 142, 144)",
placeholder_color: "rgb(169, 232, 169)",
placeholder_active_color: "rgb(169, 232, 169)",
option_color: "#fff",
vertical_padding: "15px",
horizontal_padding: "20px",
intense: true
})
})
function my_callback(value) {
alert("The value selected is " + value)
}
</script>
</head>
<body>
<div class="row">
<div id="content">
<header style="float:left;width:100%;">
<hgroup class="columns medium-8">
<h2 class="title">Wowdown! <span class="version">v0.1.0</span></h2>
<p>Dropdowns that make you go "Wow!"</p>
</hgroup>
</header>
<div id="hero">
<div class="columns medium-12 content">
<div style="padding:0" class="columns medium-5">
<select style="margin-top:2px;">
<option value = "ew">From ugly</option>
<option value = "what">What</option>
<option value = "even">Even</option>
</select>
</div>
<div class="columns medium-2">
<span class="to">to</span>
</div>
<div style="padding:0" class="float-right columns medium-5">
<select data-placeholder="Select an Option" id="hero_select">
<option selected value = "beautiful">Beautiful</option>
<option value = "badass">Badass</option>
<option value = "awesome">Awesome</option>
</select>
</div>
</div>
</div>
<div class="columns medium-12" id="documentation">
<div class="sections" id="actions">
<div style="padding-left:0;" class="columns medium-8 float-left">
<a target="_blank" href="https://github.com/Dopevog/wowdown" class="button">
<div class="bg"></div>
<div class="content">Grab the source!</div>
</a>
</div>
<div style="padding-right:0" class="columns medium-4 float-left">
<a target="_blank" href="https://patreon.com/dopevog" class="button">
<div class="bg"></div>
<div class="content">Support</div>
</a>
</div>
</div>
<div class="sections" id="init">
<h2>Installation</h2>
<div class="steps">
<ol>
<li>
<span class="step_name">Include the Jquery Framework</span>
<pre><code class="language-html"><script type="text/javascript" src="/path/to/jquery.js"></script></code></pre>
</li>
<li>
<span class="step_name">Add the wowdown.js</span>
<pre><code class="language-html"><script type="text/javascript" src="/path/to/wowdown.js"></script></code></pre>
</li>
<li>
<span class="step_name">.. and the wowdown.css</span>
<pre><code class="language-html"><link href="/path/to/wowdown.css" rel="stylesheet" /></code></pre>
</li>
</ol>
</div>
</div>
<div class="sections" id="init">
<h2>Usage</h2>
<div class="steps">
<ol>
<li>
<span class="step_name">Create a standard HTML select as you would, with <span class="code">data-placeholder</span> to give a placeholder text. </span>
<pre><code class="language-html"><select name="food_selector" data-placeholder="Select a food to eat">
<option value="Ice Cream">Ice Cream</option>
...
</select></code></pre>
</li>
<li>
<span class="step_name">Initiate the plugin in your js file</span>
<pre><code class="language-javascript">$(document).ready(function(){ <br />
$('select').wowdown() <br />
});</code></pre>
</li>
</ol>
<div class="output">
<span>Output</span>
<select class="normal" data-placeholder="Select an option">
<option value="Ice Cream">Ice Cream</option>
<option value="Chocolate">Chocolate</option>
<option value="Waffels">Waffels</option>
</select>
</div>
</div>
</div>
<div class="sections" id="init">
<h2>Customizing</h2>
<p>You are allowed to change the way the dropdown look like based on your own taste. You can find the table explaining each options after the example output to be shown below.</p>
<div class="steps">
<ol>
<li>
<span class="step_name">Add the desired options during the initialisation.</span>
<pre><code class="language-javascript">$(document).ready(function(){
$('#myblue_dropdown').wowdown({
background: "#0f37a9",
active_background:"rgb(149, 211, 255)",
placeholder_color: "#97bce0",
placeholder_active_color: "#0f37a9",
option_color:"#405463",
vertical_padding: "15px",
horizontal_padding: "20px",
intense: false
});
});</code></pre>
</li>
</ol>
<div class="output">
<span>Output</span>
<select id="myblue_dropdown" data-placeholder="How do you travel?">
<option value="1">Car</option>
<option value="2">Bus</option>
<option value="3">Unicorn</option>
</select>
</div>
<table>
<thead>
<tr>
<th style="width:180px;">Option</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>background</td>
<td>
Sets the initial background of the dropdown
<div class="code">
<span>Default: #e5e5e5</span>
</div>
</td>
</tr>
<tr>
<td>active_background</td>
<td>
Sets the active background color when the dropdown is opened
<div class="code">
<span>Default: #fff</span>
</div>
</td>
</tr>
<tr>
<td>placeholder_color</td>
<td>
The initial color of the placeholder text
<div class="code">
<span>Default: #000</span>
</div>
</td>
</tr>
<tr>
<td>placeholder_active_color</td>
<td>
The active color of the placeholder text when the dropdown is opened
<div class="code">
<span>Default: #000</span>
</div>
</td>
</tr>
<tr>
<td>option_color</td>
<td>
Color of the option values
<div class="code">
<span>Default: #000</span>
</div>
</td>
</tr>
<tr>
<td>vertical_padding</td>
<td>
Vertical padding of the dropdown
<div class="code">
<span>Default: 15px</span>
</div>
</td>
</tr>
<tr>
<td>horizontal_padding</td>
<td>
Horizontal padding of the dropdown
<div class="code">
<span>Default: 40px</span>
</div>
</td>
</tr>
<tr>
<td>intense</td>
<td>
Intense mode
<div class="code">
<span>Default: false</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sections" id="init">
<h2>Intense Mode</h2>
<p>Perhaps you may want to make your dropdown more intense for your users. If that's the case, then you might want to checkout the <span class='code'>intense</span> option</p>
<div class="steps">
<ol>
<li>
<span class="step_name">Set the <span class = "code">intense</span> option to true</span>
<pre><code class="language-javascript">$(document).ready(function(){
$('#intense_dropdown').wowdown({
...
intense: true // add this option
});
});</code></pre>
</li>
</ol>
<div class="output">
<span>Output</span>
<select id="intense_dropdown" data-placeholder=" Dropdown">
<option value="dramatic">Dramatic</option>
<option value="very_dramatic">Very Dramatic</option>
<option value="super_dramatic">Super Dramatic</option>
</select>
</div>
<p class="note">**Currently the intense animation will automatically be used if the display is below 800px (mobile devices) regardless if the option value is <span class="code">false</span></p>
</div>
</div>
<div class="sections" id="init">
<h2>Callbacks</h2>
<p>Additionally you may want to add callbacks to handle what happens when the user selects an option.</p>
<div class="steps">
<ol>
<li>
<span class="step_name">Add the <span class = "code">data-callback</span> attribute followed by your callback function.</span>
<pre><code class="language-html"><select name="food_selector" data-callback="my_callback" data-placeholder="Select a food to eat" >
...</code></pre>
</li>
<li>
<span class="step_name">The callback function should be placed outside <span class = "code">$(document).ready()</span>. The function can also access the <span class="code">value</span> that was chosen by the user.</span>
<pre><code class="language-javascript">$(document).ready(function(){
...
})
function my_callback(value){
alert("The value selected is " + value)
}</code></pre>
</li>
</ol>
<div class="output">
<span>Output</span>
<select class="normal" data-callback="my_callback" data-placeholder="Select something to eat">
<option value="Ice Cream">Ice Cream</option>
<option value="Chocolate">Chocolate</option>
<option value="Waffels">Waffels</option>
</select>
</div>
</div>
</div>
</div>
<footer class="columns medium-12">
<p>
Made with 💙 on Earth <br /> All Rights Reserved - Dopevog.
</p>
</footer>
</div>
</div>
<script src="js/prism.js"></script>
</body>