# HG changeset patch # User veltr # Date 1366818888 -7200 # Node ID 4e1e66b2fdf162d4eabf4dce2ac74983fa4aca84 # Parent 007254e973336d4890ac38205f609c4c7ded40eb Various upgrades and bugfixes diff -r 007254e97333 -r 4e1e66b2fdf1 assets/sprites.psd Binary file assets/sprites.psd has changed diff -r 007254e97333 -r 4e1e66b2fdf1 css/playscreen.css --- a/css/playscreen.css Mon Apr 22 18:42:40 2013 +0200 +++ b/css/playscreen.css Wed Apr 24 17:54:48 2013 +0200 @@ -45,11 +45,15 @@ } .lock-button { - width: 36px; background-position: -36px -54px; + width: 72px; height: 24px; margin: 3px 4px; background-position: -36px -42px; } -.lock-button.locked { - background-position: -36px -36px; +.lock-button.locked, .lock-button:hover { + background-position: -36px -18px; +} + +.lock-button.locked:hover { + background-position: -36px -42px; } .duration, .time-separator, .current-time { @@ -61,7 +65,7 @@ width: 6px; text-align: center; } .duration, .current-time { - width: 120px; margin: 0 8px; + width: 100px; margin: 0 8px; } .current-time { text-align: right; color: #CCCCCC; @@ -93,7 +97,7 @@ } .home-button { - background-position: -36px -18px; + background-position: -72px 0; } .play-canvas { @@ -159,20 +163,21 @@ .play-localtweets { left: 390px; + width: 450px; position: absolute; z-index: 2; } -.play-localtweets .tweet { - width: 320px; background: #666666; padding: 4px; +.tweet { + background: #666666; padding: 4px; min-height: 32px; } .tweet img { - width: 20px; height: 20px; float: left; + width: 32px; height: 32px; float: left; } .tweet p { - margin-left: 24px; font-size: 12px; + margin-left: 36px; font-size: 15px; text-shadow: 0 0 2px #000000; line-height: 16px; } .tweet a { @@ -180,49 +185,46 @@ } .play-tagcloud { - left: 720px; + right: 0; top: 5px; position: absolute; - width: 296px; + width: 140px; } .play-tagcloud li { cursor: pointer; - float: left; - height: 16px; - line-height: 16px; + height: 20px; + padding: 3px 0; text-align: center; - width: 98px; - display: inline-block; - margin-bottom: -6px; } .play-tagcloud li.selected { background: #FFFF00; color: #000000; } -.play-tagcloud li:nth-child(3n+2) { - margin-top: 5px; -} - -.play-tagcloud li:nth-child(3n) { - margin-top: 10px; -} - .user-tweets { - position: absolute; left: 730px; top: 300px; bottom: 0; right: 0; display: none; + position: absolute; left: 420px; top: 40px; bottom: 40px; right: 60px; display: none; + background: rgba(64,64,64,.8); border-radius: 10px; z-index: 4; box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); } .user-tweets-head { - font-size: 14px; text-align: center; + font-size: 14px; text-align: center; margin: 10px 0 0; } .user-tweets-list { - position: absolute; left: 0; top: 20px; bottom: 0; right: 0; overflow: auto; + position: absolute; left: 10px; top: 30px; bottom: 10px; right: 10px; overflow: auto; +} + +.close-user-tweets { + float: right; font-size: 20px; font-weight: bold; margin: 5px; text-decoration: none; color: #FFFFFF; } .user-tweets-list .tweet { - background: #666666; font-size: 12px; padding: 4px; margin: 5px 0; + margin-bottom: 10px; cursor: hand; +} + +.user-tweets-list .tweet:hover { + background: #808080; cursor: pointer; } .user-name { diff -r 007254e97333 -r 4e1e66b2fdf1 img/sprites.png Binary file img/sprites.png has changed diff -r 007254e97333 -r 4e1e66b2fdf1 js/playscreen.js --- a/js/playscreen.js Mon Apr 22 18:42:40 2013 +0200 +++ b/js/playscreen.js Wed Apr 24 17:54:48 2013 +0200 @@ -242,7 +242,8 @@ xscale = globW/mx, yscale, localyscale, - filteredSegments = []; + filteredSegments = [], + currentTweetTc = -1; function showLocal() { var $c = $(".play-canvas"), @@ -421,19 +422,54 @@ var deltaY = $(".play-bottom").offset().top; - $(".play-localtweets .tweet:visible").each(function() { + ctx.strokeStyle = "#ccc"; + + $(".play-localtweets .tweet").each(function() { var el = $(this), liY = + el.offset().top + el.outerHeight() / 2 - deltaY, - tY = localyscale * (+el.attr("data-timestamp") - localpos + localduration / 2); + t = +el.attr("data-timestamp"), + tY = localyscale * (t - localpos + localduration / 2), + tX = localL + lxscale * (data.fiveseconds[Math.floor(t / 5)].count - lmi); ctx.beginPath(); - ctx.strokeStyle = "#ccc"; - ctx.moveTo(localL, tY); + ctx.moveTo(tX, tY); ctx.lineTo(localR, tY); ctx.lineTo(400, liY); ctx.stroke(); $(this).css("background",colors[el.attr("data-topic-id")] || ""); }); + ctx.strokeStyle = "#000"; + ctx.fillStyle = "#ff0"; + + $(".user-tweets .tweet:visible").each(function() { + var el = $(this), + t = +el.attr("data-timestamp"), + hover = (t === currentTweetTc); + if (hover) { + ctx.strokeStyle = "#900"; + ctx.lineWidth = 3; + } + if (t > localstart && t < localend) { + var tY = localyscale * (t - localpos + localduration / 2), + tX = localL + lxscale * (data.fiveseconds[Math.floor(t / 5)].count - lmi); + ctx.beginPath(); + ctx.arc(tX,tY,hover ? 6 : 3,0,2*Math.PI,true); + ctx.fill(); + ctx.stroke(); + } + var n = Math.floor(t / 60), + x = globL + xscale * data.minutes[n].count, + y = yscale * t; + ctx.beginPath(); + ctx.arc(x,y,hover ? 6 : 3,0,2*Math.PI,true); + ctx.fill(); + ctx.stroke(); + if (hover) { + ctx.strokeStyle = "#000"; + ctx.lineWidth = 1; + } + }); + ctx.fillStyle = '#ffffff'; ctx.strokeStyle = '#999999'; ctx.font = '10px Arial,Helvetica'; @@ -549,7 +585,7 @@ .sortBy(function(w) { return -w.score; }) - .first(39) + .first(tcLength) .value(); var values = _(localkeywords).pluck('score'), @@ -560,7 +596,7 @@ tc = $(".play-tagcloud li"); localkeywords.forEach(function(w, i) { - var size = 10 + (w.score - min) * scale, + var size = 12 + (w.score - min) * scale, selected = (w.word === selectedWord), e = $(tc[i]), t = e.text(); @@ -575,8 +611,8 @@ } selectedVisible = selectedVisible || selected; }); - if (localkeywords.length < 39) { - for (var i = localkeywords.length; i < 39; i++) { + if (localkeywords.length < tcLength) { + for (var i = localkeywords.length; i < tcLength; i++) { $(tc[i]).text("").removeClass("selected"); } } @@ -588,7 +624,9 @@ throttledGetTweets(); } - for (var i = 0; i < 39; i++) { + var tcLength = 20; + + for (var i = 0; i < tcLength; i++) { $(".play-tagcloud").append("