Skip to content

Commit 577b402

Browse files
committed
Some improvements to graphics
1 parent 71322c0 commit 577b402

2 files changed

Lines changed: 28 additions & 20 deletions

File tree

app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h2 class="online-users-text"><span class="possibly-text">possibly</span>&nbsp;<
6767
<div class="footer-left-text-block">
6868
this project is open source, you can view it on <a href="https://github.com/debugger22/github-audio" target="_blank">GitHub</a><br/>
6969
developed by <a href="https://github.com/debugger22" target="_blank">@debugger22</a><br/><br/>
70-
ProTip: It's nice to keep it open in the background
70+
ProTip: It's actually kind of nice to leave on the background
7171
</div>
7272
<div class="footer-right-text-block">
7373
inspired by <a href="http://hatnote.com" target="_blank">hatnote</a><br/>

app/public/js/main.js

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ var width;
66
var height;
77
var mute = false;
88

9-
var scale_factor = 9,
10-
note_overlap = 15,
9+
var scale_factor = 6,
10+
note_overlap = 2,
1111
note_timeout = 300,
1212
current_notes = 0,
1313
max_life = 20000;
@@ -253,20 +253,25 @@ function drawEvent(data, svg_area) {
253253
}
254254
var size = data.message.length;
255255
var label_text;
256+
var ring_radius = 80;
257+
var ring_anim_duration = 3000;
258+
svg_text_color = '#FFFFFF';
256259
switch(data.type){
257260
case "PushEvent":
258261
label_text = data.user.capitalize() + " pushed to " + data.repo_name;
259-
edit_color = '#FFFFFF';
262+
edit_color = '#B2DFDB';
260263
break;
261264
case "PullRequestEvent":
262265
label_text = data.user.capitalize() + " " +
263266
data.action + " " + " a PR for " + data.repo_name;
264-
edit_color = '#18FFFF';
267+
edit_color = '#C6FF00';
268+
ring_anim_duration = 10000;
269+
ring_radius = 600;
265270
break;
266271
case "IssuesEvent":
267272
label_text = data.user.capitalize() + " " +
268273
data.action + " an issue in " + data.repo_name;
269-
edit_color = '#FFFF00';
274+
edit_color = '#FFEB3B';
270275
break;
271276
case "IssueCommentEvent":
272277
label_text = data.user.capitalize() + " commented in " + data.repo_name;
@@ -291,14 +296,15 @@ function drawEvent(data, svg_area) {
291296
.attr('fill', edit_color)
292297
.style('opacity', starting_opacity)
293298

299+
294300
var ring = circle_group.append('circle');
295-
ring.attr({r: size + 20, stroke: 'none'});
301+
ring.attr({r: size, stroke: 'none'});
296302
ring.transition()
297-
.attr('r', size + 40)
298-
.style('opacity', 0)
299-
.ease(Math.sqrt)
300-
.duration(2500);
301-
ring.remove();
303+
.attr('r', size + ring_radius)
304+
.style('opacity', 0)
305+
.ease(Math.sqrt)
306+
.duration(ring_anim_duration)
307+
.remove();
302308

303309
var circle_container = circle_group.append('a');
304310
circle_container.attr('xlink:href', 'https://github.com/' + data.repo_name);
@@ -312,9 +318,9 @@ function drawEvent(data, svg_area) {
312318
.transition()
313319
.duration(max_life)
314320
.style('opacity', 0)
315-
//circle.each('end', function(){
316-
// circle_group.remove();
317-
//})
321+
//.each(function(){
322+
// circle_group.remove();
323+
// })
318324
.remove();
319325

320326

@@ -323,22 +329,24 @@ function drawEvent(data, svg_area) {
323329
.text(label_text)
324330
.classed('label', true)
325331
.attr('text-anchor', 'middle')
332+
.attr('font-size', '0.8em')
326333
.transition()
327334
.delay(1000)
328335
.style('opacity', 0)
329-
.duration(5000)
330-
//.each('end', function() { no_label = true; })
336+
.duration(2000)
337+
.each(function() { no_label = true; })
331338
.remove();
332339
});
333340

334341
var text = circle_container.append('text')
335342
.text(label_text)
336343
.classed('article-label', true)
337344
.attr('text-anchor', 'middle')
345+
.attr('font-size', '0.8em')
338346
.transition()
339-
.delay(1000)
347+
.delay(2000)
340348
.style('opacity', 0)
341-
.duration(2000)
342-
//.each('end', function() { no_label = true; })
349+
.duration(5000)
350+
.each(function() { no_label = true; })
343351
.remove();
344352
}

0 commit comments

Comments
 (0)