Skip to content

Commit

Permalink
edit homepagebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
vokymir committed May 11, 2024
1 parent 5e022a0 commit 19b9bd0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 34 deletions.
30 changes: 2 additions & 28 deletions TScripts/Main.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@

window.onload = function(){
const sec = document.getElementById("mainSection");

const newTournament = document.createElement("button");
newTournament.addEventListener("click",Control.createTournament);
newTournament.textContent = "Nový turnaj";

const loadTournament = document.createElement("button");
loadTournament.addEventListener("click",Control.loadTournament);
loadTournament.textContent = "Načíst turnaj ze souboru";

const resumeTournament = document.createElement("button");
resumeTournament.addEventListener("click",Control.resumeTournament);
resumeTournament.textContent = "Pokračovat v turnaji";

const justMatch = document.createElement("button");
justMatch.addEventListener("click",Control.justMatch);
justMatch.textContent = "Chci jenom počítadlo";


sec?.appendChild(newTournament);
sec?.appendChild(loadTournament);
sec?.appendChild(resumeTournament);
sec?.appendChild(justMatch);
}

function lol(){
console.log("husyz");
window.onload = function () {
UI.buildHomePage();
}
35 changes: 29 additions & 6 deletions TScripts/UI.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@

class UI{
class UI {

static buildHomePage(){
static buildHomePage() {
// append all buttons and whatever
const sec = document.getElementById("mainSection");

const newTournament = document.createElement("button");
newTournament.addEventListener("click", Control.createTournament);
newTournament.textContent = "Nový turnaj";

const loadTournament = document.createElement("button");
loadTournament.addEventListener("click", Control.loadTournament);
loadTournament.textContent = "Načíst turnaj ze souboru";

const resumeTournament = document.createElement("button");
resumeTournament.addEventListener("click", Control.resumeTournament);
resumeTournament.textContent = "Pokračovat v turnaji";

const justMatch = document.createElement("button");
justMatch.addEventListener("click", Control.justMatch);
justMatch.textContent = "Chci jenom počítadlo";


sec?.appendChild(newTournament);
sec?.appendChild(loadTournament);
sec?.appendChild(resumeTournament);
sec?.appendChild(justMatch);
}

static buildTournamentPage(){
static buildTournamentPage() {
// append all buttons with current tournament inserted to html
}

static buildMatchPage(){
static buildMatchPage() {
// as before, insert specific match to html if needed
}

static buildJustMatchPage(match: Match){
static buildJustMatchPage(match: Match) {
// build a page for it
// add a button for: save and start a tournament from it
}


static updateTournamentPage(){
static updateTournamentPage() {
// basically when change of order method happen, so the ui reflects it
}
}

0 comments on commit 19b9bd0

Please sign in to comment.