top_fraggers = {
let svg = d3.create('svg').style("background-color", '#101010').attr("preserveAspectRatio", "none") .attr("viewBox", "-2 -2 1765 1100")
let phantom_color = "#609faa"
let vandal_color = "#e83a49"
let x_fkp_scale = d3.scaleLinear()
.domain([0, .4])
.range([270, 625])
svg.append("image")
.attr("xlink:href", "https://owcdn.net/img/638e35b162881.png")
.attr("id", "logoImage")
.attr("x", 630)
.attr("y", 10)
.attr("width", 500)
.attr("height", 200);
svg.append("text")
.attr("class", "signature")
.attr("text-anchor", "left")
.attr("y", 2)
.attr("x", 0)
.attr("dy", ".75em")
.attr('style', "font-size: 20px; font-family: 'Bebas Neue';")
.text("Author: Sam Rosenberg").call(addWebFont, 'Bebas Neue', 'https://fonts.gstatic.com/s/bebasneue/v2/JTUSjIg69CK48gW7PXoo9WlhyyTh89Y.woff2').attr('style', d => "font-size: 50px; font-family: 'Bebas Neue';").attr("fill", "white");
svg.append("text")
.attr("class", "signature")
.attr("text-anchor", "left")
.attr("y", 88)
.attr("x", 0)
.attr("dy", ".75em")
.text("Data from rib.gg").call(addWebFont, 'Bebas Neue', 'https://fonts.gstatic.com/s/bebasneue/v2/JTUSjIg69CK48gW7PXoo9WlhyyTh89Y.woff2').attr('style', d => "font-size: 50px; font-family: 'Bebas Neue';").attr("fill", "white");
svg.append("text")
.attr("class", "twitter")
.attr("text-anchor", "left")
.attr("y", 44)
.attr("x",46)
.attr("dy", ".75em")
.attr('style', "font-size: 20px; font-family: 'Bebas Neue';")
.text("@MasGrebnesor").call(addWebFont, 'Bebas Neue', 'https://fonts.gstatic.com/s/bebasneue/v2/JTUSjIg69CK48gW7PXoo9WlhyyTh89Y.woff2').attr('style', d => "font-size: 50px; font-family: 'Bebas Neue';").attr("fill", "white");
svg.append("image")
.attr("xlink:href", "https://cdn4.iconfinder.com/data/icons/social-media-icons-the-circle-set/48/twitter_circle-512.png")
.attr("id", "logoImage")
.attr("x", 0)
.attr("y", 41)
.attr("width", 45)
.attr("height", 45);
let left_offset = 110
let top_offset = 200
var text2 = svg.append("svg:text").attr("class", "title")
.attr("text-anchor", "middle")
.attr("y", top_offset-20+120)
.attr("x", 1765/2)
.attr('style', "font-size: 90px; font-family: 'Bebas Neue';").attr("fill", "black");
;
text2.append("svg:tspan").style("fill", "#10b39d").text("LOCK//IN ");
text2.append("svg:tspan").style("fill", "white").text("Tournament Bracket");
let top_box = 230;
const newShade = (hexColor, magnitude) => {
hexColor = hexColor.replace(`#`, ``);
if (hexColor.length === 6) {
const decimalColor = parseInt(hexColor, 16);
let r = (decimalColor >> 16) + magnitude;
r > 255 && (r = 255);
r < 0 && (r = 0);
let g = (decimalColor & 0x0000ff) + magnitude;
g > 255 && (g = 255);
g < 0 && (g = 0);
let b = ((decimalColor >> 8) & 0x00ff) + magnitude;
b > 255 && (b = 255);
b < 0 && (b = 0);
return `#${(g | (b << 8) | (r << 16)).toString(16)}`;
} else {
return hexColor;
}
};
let left_teams = ["KOI","NRG Esports","DetonatioN FocusMe", "Giants Gaming", "Gen.G", "LOUD","FunPlus Phoenix","Karmine Corp"];
let total_offset = -20;
for (let i = 0; i < left_teams.length; i++)
{
if ((i)%2 === 0)
{
total_offset += 20;
}
let team = left_teams[i];
svg.append("rect")
.attr("x", 30)
.attr("y", top_box + 100*i + total_offset)
.attr("width", 200)
.attr("height", 100)
.attr("fill", newShade(team_look.find(t => t.Team == team).Color,0))
.attr("opacity", .7)
svg.append("image")
.attr("xlink:href",team_look.find(t => t.Team == team).Logo)
.attr("id", "logoImage")
.attr("x", 30)
.attr("y", top_box+ 100*i +total_offset+5)
.attr("width", 200)
.attr("height", 90);
}
let left_teams_r2 = ["KOI","NRG Esports","DetonatioN FocusMe", "Giants Gaming", "Gen.G", "LOUD","FunPlus Phoenix","Karmine Corp"];
let total_offset_r2 = -130;
for (let i = 0; i < left_teams.length/2; i++)
{
if ((i)%2 === 0)
{
total_offset_r2 += 240;
}
let team = left_teams[i];
svg.append("rect")
.attr("x", 230)
.attr("y", top_box + 100*i + total_offset_r2)
.attr("width", 200)
.attr("height", 100)
.attr("fill", newShade(team_look.find(t => t.Team == team).Color,0))
.attr("opacity", .7)
svg.append("image")
.attr("xlink:href",team_look.find(t => t.Team == team).Logo)
.attr("id", "logoImage")
.attr("x", 230)
.attr("y", top_box+ 100*i +total_offset_r2)
.attr("width", 200)
.attr("height", 98);
}
let left_teams_r3 = ["KOI","NRG Esports","DetonatioN FocusMe", "Giants Gaming", "Gen.G", "LOUD","FunPlus Phoenix","Karmine Corp"];
let total_offset_r3 = 0;
for (let i = 0; i < left_teams.length/4; i++)
{
if ((i)%2 === 0)
{
total_offset_r3 += 280;
}
let team = left_teams[i];
svg.append("rect")
.attr("x", 430)
.attr("y", top_box + 150*i + total_offset_r3)
.attr("width", 220)
.attr("height", 150)
.attr("fill", newShade(team_look.find(t => t.Team == team).Color,0))
.attr("opacity", .7)
svg.append("image")
.attr("xlink:href",team_look.find(t => t.Team == team).Logo)
.attr("id", "logoImage")
.attr("x", 430)
.attr("y", top_box+ 150*i +total_offset_r3)
.attr("width", 220)
.attr("height", 148);
}
let right_teams = ["BBL Esports","DRX","Cloud9", "Paper Rex", "Team Heretics", "Evil Geniuses","MIBR","Talon Esports"];
let right_teams_l3 = ["KOI","NRG Esports","DetonatioN FocusMe", "Giants Gaming", "Gen.G", "LOUD","FunPlus Phoenix","Karmine Corp"];
let total_offset_l3 = 0;
for (let i = 0; i < right_teams.length/4; i++)
{
if ((i)%2 === 0)
{
total_offset_l3 += 280;
}
let team = right_teams[i];
svg.append("rect")
.attr("x", 1110)
.attr("y", top_box + 150*i + total_offset_l3)
.attr("width", 220)
.attr("height", 150)
.attr("fill", newShade(team_look.find(t => t.Team == team).Color,0))
.attr("opacity", .7)
svg.append("image")
.attr("xlink:href",team_look.find(t => t.Team == team).Logo)
.attr("id", "logoImage")
.attr("x", 1110)
.attr("y", top_box+ 150*i +total_offset_l3)
.attr("width", 220)
.attr("height", 148);
}
let left_teams_l2 = ["KOI","NRG Esports","DetonatioN FocusMe", "Giants Gaming", "Gen.G", "LOUD","FunPlus Phoenix","Karmine Corp"];
let total_offset_l2 = -130;
for (let i = 0; i < right_teams.length/2; i++)
{
if ((i)%2 === 0)
{
total_offset_l2 += 240;
}
let team = right_teams[i];
svg.append("rect")
.attr("x", 1330)
.attr("y", top_box + 100*i + total_offset_l2)
.attr("width", 200)
.attr("height", 100)
.attr("fill", newShade(team_look.find(t => t.Team == team).Color,0))
.attr("opacity", .7)
svg.append("image")
.attr("xlink:href",team_look.find(t => t.Team == team).Logo)
.attr("id", "logoImage")
.attr("x", 1330)
.attr("y", top_box+ 100*i +total_offset_l2)
.attr("width", 200)
.attr("height", 98);
}
let total_offset_l1 = -20;
for (let i = 0; i < left_teams.length; i++)
{
if ((i)%2 === 0)
{
total_offset_l1 += 20;
}
let team = right_teams[i];
svg.append("rect")
.attr("x", 1530)
.attr("y", top_box + 100*i + total_offset_l1)
.attr("width", 200)
.attr("height", 100)
.attr("fill", newShade(team_look.find(t => t.Team == team).Color,0))
.attr("opacity", .7)
svg.append("image")
.attr("xlink:href",team_look.find(t => t.Team == team).Logo)
.attr("id", "logoImage")
.attr("x", 1530)
.attr("y", top_box+ 100*i +total_offset_l1+5)
.attr("width", 200)
.attr("height", 90);
}
return svg.node();
}