-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
497 lines (421 loc) · 13.8 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
496
497
<!DOCTYPE html>
<html>
<head>
<title>Initials Avatar Generator API</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;700&display=swap" rel="stylesheet">
</head>
<style>
body {
margin: 0;
font-family: 'Source Sans Pro', sans-serif;
background-color: #16171e;
}
h2 {
color: #fff !important;
}
h1, h2 {
font-weight: 700 !important;
}
:not(pre)>code {
font-family: Consolas, monaco, monospace;
font-size: .875rem;
color: #f0506e;
white-space: nowrap;
padding: 2px 6px;
background: #f8f8f8;
}
img {
vertical-align: middle;
border-radius: 3px;
max-width: 100%;
height: auto;
box-sizing: border-box;
}
p {
margin: 0 0 20px 0;
}
*+p {
margin-top: 20px;
}
.oxro-h2,
.oxro-h3,
.oxro-h4,
h2 {
margin: 0 0 20px 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 400;
color: #333;
text-transform: none;
}
*+.oxro-h3,
*+.oxro-h4,
*+h2 {
margin-top: 40px;
}
.oxro-h2,
h2 {
font-size: 1.7rem;
line-height: 1.3;
}
.oxro-h3 {
font-size: 1.5rem;
line-height: 1.4;
}
.oxro-h4 {
font-size: 1.25rem;
line-height: 1.4;
}
@media (min-width:960px) {
.oxro-h2,
h2 {
font-size: 2rem;
}
}
hr {
overflow: visible;
text-align: inherit;
margin: 0 0 20px 0;
border: 0;
border-top: 1px solid #e5e5e5;
}
*+hr {
margin-top: 20px;
}
::selection {
background: #39f;
color: #fff;
text-shadow: none;
}
.oxro-table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
margin-bottom: 20px;
}
*+.oxro-table {
margin-top: 20px;
}
.oxro-table th {
padding: 16px 12px;
text-align: left;
vertical-align: bottom;
font-size: .875rem;
font-weight: 400;
color: #999;
text-transform: uppercase;
}
.oxro-table td {
padding: 16px 12px;
vertical-align: top;
}
.oxro-table tbody tr {
transition: background-color .1s linear;
}
.oxro-container {
box-sizing: content-box;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
padding-left: 15px;
padding-right: 15px;
}
@media (min-width:640px) {
.oxro-container {
padding-left: 30px;
padding-right: 30px;
}
}
@media (min-width:960px) {
.oxro-container {
padding-left: 40px;
padding-right: 40px;
}
}
.oxro-container::after,
.oxro-container::before {
content: "";
display: table;
}
.oxro-container::after {
clear: both;
}
.oxro-container>:last-child {
margin-bottom: 0;
}
.oxro-container-small {
max-width: 900px;
}
.oxro-label {
margin-right: 5px;
font-weight: 700;
display: inline-block;
padding: 0 10px;
background: #1e87f0;
line-height: 1.5;
font-size: .875rem;
color: #fff;
vertical-align: middle;
white-space: nowrap;
border-radius: 2px;
text-transform: uppercase;
}
.oxro-text-muted {
color: #999 !important;
}
.oxro-text-emphasis {
color: #333 !important;
}
.oxro-position-relative {
position: relative !important;
}
@media print {
*,
::after,
::before {
background: 0 0 !important;
color: #000 !important;
box-shadow: none !important;
text-shadow: none !important;
}
thead {
display: table-header-group;
}
img,
tr {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
h2,
p {
orphans: 3;
widows: 3;
}
h2 {
page-break-after: avoid;
}
}
/*! CSS Used from: Embedded */
.oxro-h2,
.oxro-h3,
.oxro-h4 {
margin-top: 10px;
margin-bottom: 10px;
color: #ccc;
}
p {
color: #bdc3c7 !important;
}
.oxro-text-emphasis {
color: #dbdddf !important;
}
.oxro-label {
background: #3F51B5;
}
code {
width: auto !important;
height: auto !important;
padding: .2em;
margin: -.2em 0;
border-radius: 5px;
font-size: 85%;
font-family: Consolas, Liberation Mono, Menlo, Courier, monospace;
text-indent: 0;
border: none;
background:#101118 !important;
color: #b3b5b6 !important;
}
hr {
border-top: 1px solid #6a6a6a;
opacity: 0.3;
}
td {
color: #a0a2a4 !important;
}
.oxro-h2,
.oxro-h1,
.oxro-h3,
.oxro-h4 {
margin-top: 10px;
margin-bottom: 10px;
color: #ccc;
}
p {
color: #a0a2a4;
}
.oxro-text-emphasis {
color: #dbdddf !important;
}
.oxro-label {
background: #3F51B5;
}
html {
background: #313339;
}
hr {
border-top: 1px solid #6a6a6a;
opacity: 0.3;
}
td {
color: #a0a2a4 !important;
}
.oxro-table-striped tbody tr:nth-of-type(2n+1),
.oxro-table-striped>tr:nth-of-type(2n+1) {
border-bottom: 0px;
}
.oxro-table-striped tbody tr:nth-of-type(2n+1),
.oxro-table-striped>tr:nth-of-type(2n+1) {
border-top: 0px;
}
.oxro-table-striped tbody tr:nth-of-type(2n+1),
.oxro-table-striped>tr:nth-of-type(2n+1) {
background: #2b2c31;
}
a {
text-decoration: none;
color: #576BD7;
}
a:hover {
color: #3F51B5;
}
@media only screen and (max-width: 500px) {
.img-example {
display: flex;
flex-direction: column;
}
.img-example code {
margin-top: 5px;
white-space: normal;
text-align: center;
}
}
</style>
<body>
<div class="oxro-container oxro-container-small oxro-position-relative">
<div>
<!---->
<div style="margin-top: 30px;">
<h2 class="oxro-h2">Introduction</h2>
<p class="oxro-h4">Get familiar with our free and <a href="https://github.com/eddiejibson/avatars">open
source</a> avatar generator API.</p>
<p>From one GET request, an avatar will be returned (in SVG format) with the initials of the name
provided. Such a URL is fit to put in an
<code class="inline"><img></code> tag with ease. With no rate-limiting or tracking and an
excellent up-time record with speedy responses, this tool works great in production, too. If you
don't believe us and want to run it for yourself, you can find the ridiculously simple code on <a
href="https://github.com/eddiejibson/avatars">GitHub</a> (This page aswell!). Just don't forget
to give us credit, eh?</p>
<hr style="margin-top:5px;">
<h2 class="oxro-h3">Examples</h2>
<p><span class="oxro-label">GET</span> <span
class="oxro-text-muted">https://avatar.oxro.io</span>/avatar.svg<span
class="oxro-text-emphasis">?name=Eddie&background=f39c12&length=1</span></p>
<div style="display:flex;flex-direction:row;align-items: center;">
<img style="width:50px;height:50px;min-height:50px;min-width:50px;"
src="https://avatar.oxro.io/avatar.svg?name=Eddie+Jibson&background=686de0&length=1">
<p style="margin:0;margin-left:7px;">Returns an SVG avatar with the background color specified in
the hex #f39c12 and the
intial "E" (specified one)</p>
</div>
<p><span class="oxro-label">GET</span><span class="oxro-text-muted"></span>
https://avatar.oxro.io</span>/avatar.svg<span
class="oxro-text-emphasis">?name=John+Smith&background=6ab04c&color=000</span></p>
<div style="display:flex;flex-direction:row;align-items: center;">
<img style="width:50px;height:50px;min-height:50px;min-width:50px;"
src="https://avatar.oxro.io/avatar.svg?name=John+Smith&background=6ab04c&color=000">
<p style="margin:0;margin-left:7px;">Returns an SVG avatar with the background color specified in
the hex #f39c12 and the
intials "JS"</p>
</div>
<p><span class="oxro-label">GET</span> <span class="oxro-text-muted"></span>
https://avatar.oxro.io</span>/avatar.svg<span
class="oxro-text-emphasis">?name=Eddie&background=ff6b6b&caps=3&bold=true</span></p>
<div style="display:flex;flex-direction:row;align-items: center;">
<img style="width:50px;height:50px;min-height:50px;min-width:50px;"
src="https://avatar.oxro.io/avatar.svg?name=Eddie&background=ff6b6b&caps=3&bold=true">
<p style="margin:0;margin-left:7px;">Returns an SVG avatar with a random background color and the
intials "Ed" (respective capitalization) in the bold version of the font.</p>
</div>
<p class="img-example">Example within img tag: <code class="inline"><img
src="https://avatar.oxro.io/avatar.svg?name=Eddie"></code></p>
<p><b>Note:</b> Any file extension is accepted <code>avatar.png?name=Eddie</code> returns the same as <code>avatar.svg?name=Eddie</code></p>
<hr style="margin-top:30px;">
<h2 class="oxro-h3">Parameters</h2>
<table class="oxro-table">
<thead>
<tr>
<th>Query</th>
<th>Explaination</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>The name/username/email of the entity you want the avatar's initials to represent</td>
<td>O</td>
</tr>
<tr>
<td>length</td>
<td>How many initials should be present in the avatar? (either 1 or 2)</td>
<td>2</td>
</tr>
<tr>
<td>background</td>
<td>The background color of the avatar (without the # in a hex) e.g #fff becomes fff</td>
<td>Random</td>
</tr>
<tr>
<td>color</td>
<td>The text color of the avatar (without the # in a hex) e.g #fff becomes fff</td>
<td>fff</td>
</tr>
<tr>
<td>bold</td>
<td>Should the bold version of the font be utilized?</td>
<td>false</td>
</tr>
<tr>
<td>rounded</td>
<td>How many pixels should the avatar be rounded (border-radius like) by?</td>
<td>0</td>
</tr>
<tr>
<td>isRounded</td>
<td>For those who don't want to specify the exact pixel amount of rounding to be done on the avatar, you can instead just provide true or false here and it'll do the magic for you.</td>
<td>false</td>
</tr>
<tr>
<td>fontSize</td>
<td>The font size for the initials in pixels.</td>
<td>250</td>
</tr>
<tr>
<td>height</td>
<td>The height of the avatar in pixels</td>
<td>500</td>
</tr>
<tr>
<td>width</td>
<td>The width of the avatar in pixels</td>
<td>500</td>
</tr>
<tr>
<td>caps</td>
<td>Capitalization of the letter(s). 3 for leaving such as provided, 2 for all lowercase or
1 for all uppercase.</td>
<td>3</td>
</tr>
</tbody>
</table>
<hr style="margin-top:30px;">
<p>Developed by <a href="https://jibson.co">Edward Jibson</a> and <a
href="https://github.com/eddiejibson/avatars/graphs/contributors">Contributors</a>.</p>
</div>
</div>
</div>
</body>
</html>