teijo / jquery-bracket

jQuery Bracket library for organizing single and double elimination tournaments
http://aropupu.fi/bracket/
MIT License
482 stars 253 forks source link

Is there a way to get round header and info? #152

Open lorenanderson-itrellis opened 6 years ago

lorenanderson-itrellis commented 6 years ago

At the top of each round, is there a way to insert a title and other info such as dates?

I am looking for something like: "Round 1" "Matches happen between Mon. and Wed."

Similar to this photo: https://res.cloudinary.com/cmgverticals/image/upload/f_auto,q_80/v1491278076/ncaa_bracket_final_piwaax.jpg

hansoncaleb commented 4 years ago

Did anyone ever figure this out?

RenautMestdagh commented 2 years ago

I was able to do this

function infoWhereWhen() {
      const matches = document.getElementsByClassName("teamContainer");
      const tijdenknockout = !{JSON.stringify(tijdenknockout)};
      const veldnamen = !{JSON.stringify(veldnamen)};

      for (let i = 0; i < matches.length; i++) {

        const div = document.createElement("div");
        div.style.position = "relative"
        div.style.width = "0"
        div.style.height = "0"

        const label = document.createElement("label");
        label.style.position = "absolute"
        label.style.width = "250px"
        label.style.fontSize = "85%"
        label.style.left = "10px"
        label.style.top = "-20px"
        label.style.padding = "0"
        label.style.color = 'rgba(0,0,0,0.6)'
        label.innerHTML = veldnamen[i] + "&nbsp&nbsp|&nbsp&nbsp" + tijdenknockout[i];

        div.append(label)
        matches[i].append(div)
      }

}

I had to mess around for a bit before i was happy with the result tho... You can view the result here Screenshot from 2022-05-21 20-56-41