-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
495 lines (405 loc) · 18.3 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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
<html>
<head>
<title>Jabradoodle, the jQuery Audio Button</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.0.0/normalize.min.css">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="jabradoodle.css">
<style>
body {
background: #FDFAF2;
color: #555;
font-family:"Helvetica Neue", sans-serif;
font-weight: 300;
font-size: 16px;
line-height: 1.4em;
padding: 15px 30px 60px 30px;
margin: 0 auto;
max-width: 1400px;
}
h1 {
font-size: 37px;
line-height: 40px;
margin: 0 0 18px 0;
}
h2 {
color: #333;
font-size: 19px;
line-height: 21px;
margin: 0 0 7px 0;
}
h2 span {
font-style: italic;
}
h3 {
font-size: 14px;
line-height: 16px;
margin: 3px 0 1px 0;
}
h4 {
color: #313131;
font-size: 11px;
line-height: 11px;
text-transform: uppercase;
margin: 20px 0 7px 0;
}
p {
font-size: 14px;
line-height: 19px;
margin: 0 0 16px 0;
}
a {
color: #965131;
}
ol {
list-style: decimal-leading-zero;
color: #000;
font-size: 13px;
padding-left: 28px;
margin: 0;
}
ol ul, ul ul, ol ol {
margin-bottom: 10px;
}
section {
width: 100%;
max-width: 560px;
margin-bottom: 30px;
}
section.examples{
max-width: 100%;
}
@media all and (min-width: 768px) {
section{
margin-bottom: 60px;
}
}
.intro {
color: #000;
max-width: 670px;
margin-bottom: 30px;
}
.intro p {
font-size: 17px;
line-height: 21px;
margin-bottom: 0;
}
.example{
margin: 0 0 33px 0;
}
.example > p {
max-width: 560px;
margin: 0 0 9px 0;
}
.example > img, .example > video, .example > iframe {
display: block;
width: 100%;
}
.example.small {
width: 60%;
}
code, .code {
display: block;
max-width: 600px;
margin: 20px 0;
padding: 6px 10px;
border-radius: 3px;
text-align: left;
background-color: #535353;
border: 1px solid #000000;
font-size: 13px;
line-height: 19px;
overflow: auto;
font-family: courier;
font-size: 12px;
color: #fff;
}
li .code {
display: inline;
padding: 1px 3px;
}
.example code, .example .code{
max-width: 900px;
}
#forkongithub a {
background:#000;
color:#fff;
text-decoration:none;
font-family:arial, sans-serif;
text-align:center;
font-weight:bold;
padding:5px 40px;
font-size:1rem;
line-height:2rem;
position:relative;
transition:0.5s;
}
#forkongithub a:hover {
background:#060;
color:#fff;
}
#forkongithub a::before, #forkongithub a::after {
content:"";
width:100%;
display:block;
position:absolute;
top:1px;
left:0;
height:1px;
background:#fff;
}
#forkongithub a::after {
bottom:1px;
top:auto;
}
@media screen and (min-width:800px) {
#forkongithub {
position:fixed;
display:block;
top:0;
right:0;
width:200px;
overflow:hidden;
height:200px;
}
#forkongithub a {
width:200px;
position:absolute;
top:60px;
right:-60px;
transform:rotate(45deg);
-webkit-transform:rotate(45deg);
box-shadow:3px 4px 10px rgba(0, 0, 0, 0.8);
}
}
#releasehistory h4{
margin: 0 0 3px 0;
}
#releasehistory ul{
margin: 0 0 11px 0;
padding: 0px;
}
#releasehistory li{
font-size: 13px;
line-height: 15px;
margin: 0 0 3px 0;
padding: 0;
list-style-type: none;
}
h2{
margin-bottom: 6px;
font-size: 0.9rem;
}
.sample{
margin-bottom: 6px;
}
.sample-customlook.jab-container{
background-color: #eaf2f9;
color: rgba(79, 124, 158, 0.65);
}
.sample-customlook.jab-container:hover{
color: rgba(79, 124, 158, 1);
}
.sample-customlook.jab-container.jab-state-loading{
color: rgba(79, 124, 158, 0.25);
background-color: rgba(243,242,249,0.8);
cursor: auto;
}
.sample-customlook .jab-bar{
background-color: #dae6ef;
}
.sample-customlook .jab-loader{
border-color: #fff;
border-left-color: #4f7c9e;
}
.sample-source{
text-transform: uppercase;
font-size: 0.6em;
}
</style>
</head>
<body>
<div id="forkongithub"><a href="https://github.com/sjwilliams/jabradoodle">Fork me on GitHub</a></div>
<section class="intro">
<h1>Jabradoodle</h1>
<p>Jabradoodle is a jQuery Audio Button (+ 🐩 ) that makes playing MP3s a walk in the dog park. You get a Play/Pause button with builtin progress bar. Optionally, you can customize the icons and status text on instantiation and the design with CSS.</p>
</section>
<section class="installation">
<h2>Download</h2>
<ul>
<li><a href="https://github.com/sjwilliams/jabradoodle">GitHub</a></li>
<li><span class="code">$ npm install jabradoodle</span></li>
</ul>
</section>
<section class="prep">
<h2>HTML/CSS Prep</h2>
<p>Be sure to include both the CSS and Javascript file in your project. The Javascript should come after your jQuery reference.</p>
<code>
<link rel="stylesheet" href="jabradoodle.css">
<br>
<script src="jquery.js"></script>
<br>
<script src="jabradoodle.js"></script>
</code>
</section>
<section class="installation">
<h2>Configuration</h2>
<p>The player's configurable options may be set on instantiation with JavaScript or with data attributes in the markup.</p>
<p>In all cases, you must specify a path to an MP3 and the duration of that MP3 in seconds.</p>
<pre class="code">
// Set options with data attributes and cal
<div class="audio" data-duration="72" data-src="heartstrings.mp3"> data-showprogressbar="false" </div>
$('.audio').jabradoodle();
// Set options in JavaScript
<div class="audio"></div>
$('.audio').jabradoodle({
src: 'heartstrings.mp3',
duration: 72,
showprogressbar: false
});
// Mix and match. Useful with many players that share common settings but different sources and durations.
<div class="audio" data-duration="72" data-src="heartstrings.mp3"></div>
$('.audio').jabradoodle({
showprogressbar: false
});
</pre>
<h3>Options</h3>
<pre class="code">
preload: false, // create audio element on init and start download, or wait until button click.exclusive: true, // play only one player at a time
fillcontainer: false, // whether or not the button expands as wide as the container it's in (display block vs display table)
showduration: true, // show duration in MM:SS format
showprogressbar: true, // show the moving progress bar in the background
countdown: false, // duration counts down as time updates
iconsmaintainwidth: true,
buttonmaintainwidth: true,
statusmaintainwidth: false,
playtext: 'Play',
pausetext: 'Pause',
resumetext: 'Resume',
playicon: PLAYICON, // passing in svg icons. You can pass in any markup.
pauseicon: PAUSEICON,
resumeicon: PLAYICON
</pre>
</section>
<section class="examples">
<h2>Example Usage</h2>
<div class="example">
<h3>Default Usage</h3>
<p>The default state includes Play/Pause icons and Play/Pause/Resume status text. </p>
<div class="sample" data-duration="72" data-src="//media.joshwilliams.com.s3.amazonaws.com/projects/code/jabradoodle/samples/Dave_Depper_-_Heartstrings.mp3"></div>
<pre class="code">
// html
<div class="audio" data-duration="72" data-src="heartstrings.mp3"></div>
// js
$('.audio').jabradoodle();
</pre>
<div class="sample-source" xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/" about="http://freemusicarchive.org/music/Dave_Depper/Compositions_2/Heartstrings"><span property="dct:title">Heartstrings</span> (<a rel="cc:attributionURL" property="cc:attributionName" href="http://www.needledrop.co/artists/dave-depper">Dave Depper</a>) / <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/">CC BY-NC 3.0</a></div>
</div>
<div class="example">
<h3>Customize Text</h3>
<p>Use different status text</p>
<div class="sample" data-duration="109" data-playtext="Play Newscast" data-pausetext="Pause Newscast" data-resumetext="Resume Newscast" data-src="https://ia801302.us.archive.org/3/items/VOANewscasts2015-11-21/VOA-newscast-2015-11-21-0000Z.mp3"></div>
<pre class="code">
// html
<div class="audio" data-duration="109" data-playtext="Play Newscast" data-pausetext="Pause Newscast" data-resumetext="Resume Newscast" data-src=newscast.mp3"></div>
// js
$('.audio').jabradoodle();
</pre>
<div class="sample-source"><a href="https://archive.org/details/VOANewscasts2015-11-21">Public Domain Audio</a></div>
</div>
<div class="example">
<h3>No Text</h3>
<p>All the text bringing you down? Just pass in empty values.</p>
<div class="sample" data-duration="29" data-playtext="" data-pausetext="" data-resumetext="" data-src="//media.joshwilliams.com.s3.amazonaws.com/projects/code/jabradoodle/samples/Dave_Depper_-_Motor_City.mp3"></div>
<pre class="code">
// html
<div class="audio" data-duration="109" data-playtext="" data-pausetext="" data-resumetext="" data-src=motorcity.mp3"></div>
// js
$('.audio').jabradoodle();
</pre>
<div class="sample-source" xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/" about="http://freemusicarchive.org/music/Dave_Depper/Compositions_2/Motor_City"><span property="dct:title">Motor City</span> (<a rel="cc:attributionURL" property="cc:attributionName" href="http://www.needledrop.co/artists/dave-depper">Dave Depper</a>) / <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/">CC BY-NC 3.0</a></div>
</div>
<div class="example">
<h3>No Progress Bar</h3>
<p>Eliminate the moving progress bar.</p>
<div class="sample" data-duration="31" data-showprogressbar="false" data-src="//media.joshwilliams.com.s3.amazonaws.com/projects/code/jabradoodle/samples/Dave_Depper_-_Pop_Nugget.mp3"></div>
<pre class="code">
// html
<div class="audio" data-duration="31" data-showprogressbar="false" data-src="popnugget.mp3"></div>
// js
$('.audio').jabradoodle();
</pre>
<div class="sample-source" xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/" about="http://freemusicarchive.org/music/Dave_Depper/Compositions_2/Pop_Nugget"><span property="dct:title">Pop Nugget</span> (<a rel="cc:attributionURL" property="cc:attributionName" href="http://www.needledrop.co/artists/dave-depper">Dave Depper</a>) / <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/">CC BY-NC 3.0</a></div>
</div>
<div class="example">
<h3>No Loading Icon</h3>
<p>Eliminate the loading icon that shows up while the audio loads..</p>
<div class="sample" data-duration="31" data-showloader="false" data-src="//media.joshwilliams.com.s3.amazonaws.com/projects/code/jabradoodle/samples/Dave_Depper_-_Pop_Nugget.mp3"></div>
<pre class="code">
// html
<div class="audio" data-duration="31" data-showloader="false" data-src="popnugget.mp3"></div>
// js
$('.audio').jabradoodle();
</pre>
<div class="sample-source" xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/" about="http://freemusicarchive.org/music/Dave_Depper/Compositions_2/Pop_Nugget"><span property="dct:title">Pop Nugget</span> (<a rel="cc:attributionURL" property="cc:attributionName" href="http://www.needledrop.co/artists/dave-depper">Dave Depper</a>) / <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/">CC BY-NC 3.0</a></div>
</div>
<div class="example">
<h3>Duration Text Countdowns</h3>
<p></p>
<div class="sample" data-duration="29" data-countdown="true" data-src="//media.joshwilliams.com.s3.amazonaws.com/projects/code/jabradoodle/samples/Dave_Depper_-_Motor_City.mp3"></div>
<pre class="code">
// html
<div class="audio" data-duration="31" data-countdown="true" data-src="motorcity.mp3"></div>
// js
$('.audio').jabradoodle();
</pre>
<div class="sample-source" xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/" about="http://freemusicarchive.org/music/Dave_Depper/Compositions_2/Motor_City"><span property="dct:title">Motor City</span> (<a rel="cc:attributionURL" property="cc:attributionName" href="http://www.needledrop.co/artists/dave-depper">Dave Depper</a>) / <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/">CC BY-NC 3.0</a></div>
</div>
<div class="example">
<h3>Custom Look</h3>
<p>It's all CSS under the hood.</p>
<div class="sample sample-customlook" data-duration="72" data-src="//media.joshwilliams.com.s3.amazonaws.com/projects/code/jabradoodle/samples/Dave_Depper_-_Heartstrings.mp3"></div>
<pre class="code">
// html
<div class="audio" data-duration="72" data-src="heartstrings.mp3"></div>
// css
.jab-container{
background-color: #eaf2f9;
color: rgba(79, 124, 158, 0.65);
}
.jab-container:hover{
color: rgba(79, 124, 158, 1);
}
.jab-container.jab-state-loading{
color: rgba(79, 124, 158, 0.25);
background-color: rgba(243,242,249,0.8);
cursor: auto;
}
.jab-bar{
background-color: #dae6ef;
}
.jab-loader{
border-color: #4f7c9e; /* background */
border-left-color: #fff; /* foreground */
}
// js
$('.audio').jabradoodle();
</pre>
<div class="sample-source" xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/" about="http://freemusicarchive.org/music/Dave_Depper/Compositions_2/Heartstrings"><span property="dct:title">Heartstrings</span> (<a rel="cc:attributionURL" property="cc:attributionName" href="http://www.needledrop.co/artists/dave-depper">Dave Depper</a>) / <a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/">CC BY-NC 3.0</a></div>
</div>
</section>
<section>
<h2>Credits</h2>
<p>Jabradoodle is by <a href="http://joshwilliams.com">Josh Williams</a>.</p>
</section>
<section>
<h2>License</h2>
<p>Jabradoodle is licensed under the <a href="https://raw.githubusercontent.com/sjwilliams/Jabradoodle/master/LICENSE">MIT license</a></p>
</section>
<script src="https://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous"></script>
<script src="jabradoodle.js"></script>
<script>
$('.sample').jabradoodle();
</script>
</body>
</html>