Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add score_markers layout #456

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions layout/score_markers/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

30 changes: 30 additions & 0 deletions layout/score_markers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
LoadEverything().then(() => {
Start = async () => {};

Update = async (event) => {
let data = event.data;
let oldData = event.oldData;

// window.team

let src = "";

if (_.get(data, "score.best_of")) {
let html = "";
for (let i = 0; i < _.get(data, "score.best_of"); i += 1) {
if (_.get(data, "score.team.1.score", 0) > i) {
html += "<img src='./t1_game_win.svg' />";
} else {
html += "<img src='./t1_game_base.svg' />";
}
}
$(".container").html(html);
} else {
let html = "";
for (let i = 0; i < _.get(data, "score.team.1.score", 0); i += 1) {
html += "<img src='./t1_game_win.svg' />";
}
$(".container").html(html);
}
};
});
1 change: 1 addition & 0 deletions layout/score_markers/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
15 changes: 15 additions & 0 deletions layout/score_markers/t1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<html>
<head>
<script src="../include/globals.js"></script>
<link rel="stylesheet" href="../main.css" />
<link rel="stylesheet" href="./index.css" />
</head>
<body>
<div class="container"></div>

<script>
window.team = "1";
</script>
<script src="index.js"></script>
</body>
</html>
51 changes: 51 additions & 0 deletions layout/score_markers/t1_game_base.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions layout/score_markers/t1_game_win.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions layout/score_markers/t2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<html>
<head>
<script src="../include/globals.js"></script>
<link rel="stylesheet" href="../main.css" />
<link rel="stylesheet" href="./index.css" />
</head>
<body>
<div class="container"></div>

<script>
window.team = "2";
</script>
<script src="index.js"></script>
</body>
</html>
51 changes: 51 additions & 0 deletions layout/score_markers/t2_game_base.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions layout/score_markers/t2_game_win.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.