From 57510aebec0efee51d175b68e2d0cd6a56afa625 Mon Sep 17 00:00:00 2001 From: Ben Burlingham Date: Sun, 13 Nov 2016 16:48:14 -0800 Subject: [PATCH] Updates to tourney pane. --- css/style.css | 14 +------------- css/tourney.scss | 17 +---------------- index.html | 9 ++++----- js/bundle.js | 14 +++----------- js/diagram.js | 2 +- js/ui.js | 12 ++---------- 6 files changed, 12 insertions(+), 56 deletions(-) diff --git a/css/style.css b/css/style.css index 661ad3e..231a486 100644 --- a/css/style.css +++ b/css/style.css @@ -56,20 +56,8 @@ body { position: absolute; top: 0; } -.tourney-link { - border: 1px solid #d5d5d5; - display: block; - font-size: 0; - margin-bottom: 20px; - padding: 2px 0; - text-align: center; - width: 200px; } - .tourney-link:hover { - background: #777; } - .tourney-image { - height: 260px; - width: 195px; } + width: 200px; } .tourney-country { color: #777; diff --git a/css/tourney.scss b/css/tourney.scss index a2ad9ed..e4ed03c 100644 --- a/css/tourney.scss +++ b/css/tourney.scss @@ -4,23 +4,8 @@ top: 0; } -.tourney-link { - border: 1px solid #d5d5d5; - display: block; - font-size: 0; - margin-bottom: 20px; - padding: 2px 0; - text-align: center; - width: 200px; - - &:hover { - background: #777; - } -} - .tourney-image { - height: 260px; - width: 195px; + width: 200px; } .tourney-country { diff --git a/index.html b/index.html index 178a9b6..255dc86 100644 --- a/index.html +++ b/index.html @@ -23,16 +23,16 @@

Visualization should invite interaction to create and answer questions such as:

Data source: OpenFootball. There are a few errors. - Transform, and reduce scripts built in Haskell, publically available in the source code. + Transform and reduce scripts are built in Haskell, publically available in the source code.

@@ -55,11 +55,10 @@

TODO
- 1974 two germanies? update ribbon hover // STRANGE EXTENDED TIME CHILE-BRAZIL (when? not 1930) - FIX BY HAND? IS BECAUE se1 IS SCORE __GOING INTO__ EXTENDED TIME No finals in 1954 or 1962? - Big holes in 1950? + 1954 - teams already played eachother (uh oh) fix buoy viz diff --git a/js/bundle.js b/js/bundle.js index 58a4287..6a88ebe 100644 --- a/js/bundle.js +++ b/js/bundle.js @@ -493,7 +493,7 @@ var p1 = game.sp1 ? '(+' + game.sp1 + ' in penalties)' : ''; var p2 = game.sp2 ? '(+' + game.sp2 + ' in penalties)' : ''; - return c1 + ': ' + game.s1 + ' ' + e1 + ' ' + p1 + '\n' + c2 + ': ' + game.s2 + ' ' + e2 + ' ' + p2; + return c1 + ': ' + game.s1 + ' ' + e1 + ' ' + p1 + '\n' + c2 + ': ' + game.s2 + ' ' + e2 + ' ' + p2 + '\n' + data.rounds[game.rId]; }); group.append("text").each(function (d) { @@ -584,7 +584,6 @@ var UI = { CLASSNAMES: { TOURNEY: { - LINK: 'tourney-link', IMAGE: 'tourney-image', COUNTRY: 'tourney-country', YEAR: 'tourney-year' @@ -696,8 +695,6 @@ tourneyPane.querySelector('.' + UI.CLASSNAMES.TOURNEY.IMAGE).src = 'res/' + ek + '.jpg'; - tourneyPane.querySelector('.' + UI.CLASSNAMES.TOURNEY.LINK).href = href; - tourneyPane.querySelector('.' + UI.CLASSNAMES.TOURNEY.COUNTRY).innerHTML = tourneyList[ek]; tourneyPane.querySelector('.' + UI.CLASSNAMES.TOURNEY.COUNTRY).href = href; @@ -760,14 +757,10 @@ }, buildTourneyPane: function buildTourneyPane() { - var link = document.createElement('a'); var img = document.createElement('img'); var country = document.createElement('a'); var year = document.createElement('a'); - link.className = UI.CLASSNAMES.TOURNEY.LINK; - link.target = '_blank'; - img.className = UI.CLASSNAMES.TOURNEY.IMAGE; country.className = UI.CLASSNAMES.TOURNEY.COUNTRY; @@ -778,9 +771,7 @@ var tourneyPane = document.querySelector('.tourney'); - link.appendChild(img); - - tourneyPane.appendChild(link); + tourneyPane.appendChild(img); tourneyPane.appendChild(year); tourneyPane.appendChild(country); }, @@ -953,6 +944,7 @@ return UI.ROUND_TYPES.SEMIFINAL; case 'Final': case 'Finals': + case 'Final Round': return UI.ROUND_TYPES.FINAL; } diff --git a/js/diagram.js b/js/diagram.js index 249c414..8d9d594 100644 --- a/js/diagram.js +++ b/js/diagram.js @@ -229,7 +229,7 @@ const Diagram = { const p1 = game.sp1 ? `(+${game.sp1} in penalties)` : ''; const p2 = game.sp2 ? `(+${game.sp2} in penalties)` : ''; - return `${c1}: ${game.s1} ${e1} ${p1}\n${c2}: ${game.s2} ${e2} ${p2}`; + return `${c1}: ${game.s1} ${e1} ${p1}\n${c2}: ${game.s2} ${e2} ${p2}\n${data.rounds[game.rId]}`; }); group.append("text") diff --git a/js/ui.js b/js/ui.js index 535902f..a919eab 100644 --- a/js/ui.js +++ b/js/ui.js @@ -1,7 +1,6 @@ const UI = { CLASSNAMES: { TOURNEY: { - LINK: 'tourney-link', IMAGE: 'tourney-image', COUNTRY: 'tourney-country', YEAR: 'tourney-year', @@ -113,8 +112,6 @@ const UI = { tourneyPane.querySelector(`.${UI.CLASSNAMES.TOURNEY.IMAGE}`).src = `res/${ek}.jpg`; - tourneyPane.querySelector(`.${UI.CLASSNAMES.TOURNEY.LINK}`).href = href; - tourneyPane.querySelector(`.${UI.CLASSNAMES.TOURNEY.COUNTRY}`).innerHTML = tourneyList[ek]; tourneyPane.querySelector(`.${UI.CLASSNAMES.TOURNEY.COUNTRY}`).href = href; @@ -179,14 +176,10 @@ const UI = { }, buildTourneyPane: () => { - const link = document.createElement('a'); const img = document.createElement('img'); const country = document.createElement('a'); const year = document.createElement('a'); - link.className = UI.CLASSNAMES.TOURNEY.LINK; - link.target = '_blank'; - img.className = UI.CLASSNAMES.TOURNEY.IMAGE; country.className = UI.CLASSNAMES.TOURNEY.COUNTRY; @@ -197,9 +190,7 @@ const UI = { const tourneyPane = document.querySelector('.tourney'); - link.appendChild(img); - - tourneyPane.appendChild(link); + tourneyPane.appendChild(img); tourneyPane.appendChild(year); tourneyPane.appendChild(country); }, @@ -405,6 +396,7 @@ const UI = { return UI.ROUND_TYPES.SEMIFINAL; case 'Final': case 'Finals': + case 'Final Round': return UI.ROUND_TYPES.FINAL; }