-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
179 lines (164 loc) · 3.57 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Facitars Test</title>
<script src="http://chancejs.com/chance.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<script src="../dist/facitars.js"></script>
<style>
body {
background-color: #eee;
}
.facitar {
float: left;
padding: 5px;
border: 1px solid #eee;
margin: 2px;
font-size: 12px;
}
.facitar svg {
margin: 5px;
}
.facitar .color {
padding: 2px 5px;
}
</style>
</head>
<body>
<div id="facitars"></div>
<script>
// generate some random name using chance
let names = [
'Anthony Mugendi',
'Marie Marsh',
'Birdie Romero',
'Martha Hubbard',
'Nannie Stanley',
'Ronnie McGee',
'Todd Kelley',
'David Vasquez',
'Elizabeth Valdez',
'Theodore Farmer',
'Gussie Meyer',
'Mollie Hernandez',
'Ida McCoy',
'Tom Welch',
'Harriett Diaz',
'Rebecca Tate',
'Glenn Allison',
'Sally Dennis',
'Winnie Barker',
'Larry Ward',
'Callie McCormick',
'Sara Bowers',
'Lizzie Pearson',
'Ruby McKenzie',
'Shane Schultz',
'Edward Park',
'Lina Schmidt',
'Lottie Payne',
'Corey Todd',
'Ricky Hammond',
'Martin Townsend',
'Kathryn Cunningham',
'Brandon Bailey',
'William Becker',
'Floyd Snyder',
'Madge Allen',
'Nell Beck',
'Isabelle Richards',
'Minerva Becker',
'Marvin George',
'Sally Welch',
'Jeremiah Johnston',
'Edgar Blair',
'Paul Singleton',
'Luis Barnett',
'Ivan Hughes',
'Cody Steele',
'Curtis Young',
'Elmer Caldwell',
'Jeanette Riley',
'Eleanor Malone',
'Jeanette Steele',
'Susan Tucker',
'Evelyn Brady',
'Elijah Jordan',
'Alexander Robbins',
'Lewis Owens',
'Randy Crawford',
'Walter Miller',
'Shawn Harvey',
'Harvey Lawrence',
'Jeanette Quinn',
'Nora Harper',
'Eleanor Perry',
'Marguerite Summers',
'Lura Harrington',
'Maria Dunn',
'Lucile Diaz',
'Maurice Parks',
'Gregory Thornton',
'Blake Rodriquez',
'Garrett Morales',
'Louisa Alexander',
'Albert Lowe',
'Alta Phelps',
'Gussie Schmidt',
'Gregory Herrera',
'Susie Walker',
'Carrie Norman',
'Inez Cross',
'Roxie Singleton',
'Mason Gutierrez',
'Chester Jones',
'Jeffery Malone',
'Richard Norris',
'Helen Rodriguez',
'Jon Marsh',
'Cynthia Crawford',
'Lewis Hogan',
'Bill Drake',
'Effie Saunders',
'Ronald McKenzie',
'Tony Conner',
'Harriet Ball',
'Marie Walker',
'Barbara Wilkins',
'Estella Warren',
'Adelaide Peters',
'Randall Burke',
'Ruth Garrett',
'Isabella Vasquez',
];
const facitars = new Facitars();
// console.log(facitar);
console.time('Generating Facitars');
(async () => {
let container = $('#facitars');
for (let name of names) {
let { svg, color } = await facitars.generate(name);
// console.log(svg, color);
let clrEl = $('<div/>')
.addClass('color')
.css({
background: color,
})
.text(color);
let nameEl = $('<div/>').text(name);
$('<div/>')
.append(svg)
.append(nameEl)
.append(clrEl)
.addClass('facitar')
.appendTo(container);
// body.append(svg);
}
console.timeEnd('Generating Facitars');
})();
</script>
</body>
</html>