-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchloechatter_wc.html
212 lines (189 loc) · 7.81 KB
/
chloechatter_wc.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chloechatter</title>
<meta name="description" content="">
<!--<link rel="stylesheet" type="text/css" href="style.css">-->
<style>
.cloud {
margin: auto;
}
.yourcloud {
margin: auto;
border: 10px solid rgba(128, 128, 128, .7);
}
.word {
margin-left: auto;
margin-right: auto;
margin-top: 10px;
margin-bottom: 10px;
padding: 10px;
background-color: rgb(255, 230, 230);
color: rgb(102, 102, 102);
transition: padding .35s ease-in,
background-color .8s ease-in,
font-size .35s ease-in;
}
input.word:focus {
padding: 20px;
background-color: rgb(255, 153, 153);
font-size: 30px;
color: white;
}
.submit_btn {
padding: 10px;
margin-bottom: 10px;
font-size: 20px;
transition: padding .35s ease-in;
}
button.submit_btn:hover {
padding: 20px;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="cloud" id="cloud" style="position:relative;width:1000px;height:800px;"></div>
<div id="details"></div>
<script src="wordcloud2.js"></script>
<script>
var tags = [
["LOVE", 2100000],
["team", 900000],
["many", 200000],
["JOY", 1000000],
["children", 500000],
["beautiful", 6000000],
["ideas", 1100000],
["mommy", 606666],
["life", 505555],
["friendship", 500500],
["energy", 400000],
["failure", 467983],
["determination", 1000000],
["DESIGN", 300000],
["JavaScript",475000],
["Python", 650000],
["Django", 200000],
["JQuery", 367890],
["React", 750000],
["HTML", 1000000],
["CSS", 675000],
["MINDFUL", 300000],
["helpful", 250550],
["AJAX", 250000],
["JSON", 567500],
["curls", 175500],
["Agile", 200000],
["flexible", 350000],
["intelligence", 500000],
["substance", 460000],
["DYNAMIC", 675000],
["maturity", 460000],
["experience", 350000],
["journey", 157890],
["GLOW", 100000],
["knitting", 120000],
["programming", 319000],
["developing", 500000],
["M.B.A.", 400000],
["Air Force", 500000],
["Veteran", 600000],
["variety", 360000],
["diversity", 500000],
["transition", 430000],
["transformation", 300000],
["sand dollar", 176000],
["enhancement", 275000],
["excellence", 750000],
["cooking", 200000],
["discovery", 200000],
["Top Secret Clearance", 170000],
["Hello World!", 575000],
["business", 300000],
["accounting", 300000],
["finance", 300000],
["proforma", 300000],
["K.I.S.S.", 300000],
["earth-friendly", 300000],
["management", 300000],
["resourceful", 200000],
["documentation", 200000],
["project", 170000]
];
WordCloud(document.getElementById('cloud'), {
list : tags.map(function(word) { return [word[0], Math.round(word[1]/10000)]; })
});
// var clicked = function(ev) {
// var details = "";
// if (ev.target.nodeName === "SPAN"){
// var tag = ev.target.textContent,
// clickedTag;
// if (tags.some(function(el){
// if (el[0] === tag) {
// clickedTag = el;
// return true;
// }
// return false;
// })) {
// details = "There were " + clickedTag[1] +
// " Stack Overflow questions tagged \"" + tag + "\"";
// }
// }
// document.getElementById("details").innerText = details;
// }
// document.getElementById("cloud").addEventListener("click", clicked);
</script>
<div>
<h1>Want to make your own Wordcloud? </h1>
<h3>Enter words in order of priority:</h3>
<input class="word" id="one" type="text" placeholder="your first word"/><br>
<input class="word" id="two" type="text" placeholder="your second word"/><br>
<input class="word" id="three" type="text" placeholder="your third word"/><br>
<input class="word" id="four" type="text" placeholder="your fourth word"/><br>
<input class="word" id="five" type="text" placeholder="your fifth word"/><br>
<input class="word" id="six" type="text" placeholder="your sixth word"/><br>
<input class="word" id="seven" type="text" placeholder="your seventh word"/><br>
<input class="word" id="eight" type="text" placeholder="your eighth word"/><br>
<input class="word" id="nine" type="text" placeholder="your ninth word"/><br>
<input class="word" id="ten" type="text" placeholder="your tenth word"/><br>
<button class="submit_btn" id="submit_btn" type="submit">Make My Wordcloud!</button><br>
<div class="yourcloud" id="yourcloud" style="position:relative;width:1000px;height:800px;"></div>
<script src="wordcloud2.js"></script>
<script>
// a function to get the tags from user inputs
var submitBtn = document.getElementById('submit_btn');
// var tags = [];
submitBtn.onclick = function(){
var one = document.getElementById('one');
var two = document.getElementById('two');
var three = document.getElementById('three');
var four = document.getElementById('four');
var five = document.getElementById('five');
var six = document.getElementById('six');
var seven = document.getElementById('seven');
var eight = document.getElementById('eight');
var nine = document.getElementById('nine');
var ten = document.getElementById('ten');
// alert(one.value + ", " + two.value);
var words = [
[one.value, 1000000],
[two.value, 700000],
[three.value, 700000],
[four.value, 650000],
[five.value, 630000],
[six.value, 575000],
[seven.value, 500000],
[eight.value, 400000],
[nine.value, 375000],
[ten.value, 300000]
];
WordCloud(document.getElementById('yourcloud'), {
list : words.map(function(word) { return [word[0], Math.round(word[1]/6000)]; })
});
}
</script>
</div>
</body>
</html>