-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |