From 6371273679efe59515b6f334434d2a2ab6e5f479 Mon Sep 17 00:00:00 2001 From: jams <36876904+jamsge@users.noreply.github.com> Date: Mon, 24 Oct 2022 21:17:21 -0700 Subject: [PATCH 1/7] new html/css for pronoun inputs --- Interface Source Code/src/index.css | 12 ++++++++++-- Interface Source Code/src/index.html | 10 ++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Interface Source Code/src/index.css b/Interface Source Code/src/index.css index 035867f..93cf4ee 100644 --- a/Interface Source Code/src/index.css +++ b/Interface Source Code/src/index.css @@ -132,9 +132,17 @@ input[type="text"] { #p1Name, #p2Name { float: left; - min-width: 60px; + min-width: 70px; max-width: 174px; - width: 60px; + width: 70px; + border-radius: 0px; +} + +#p1Pronouns, #p2Pronouns { + float: left; + min-width: 70px; + max-width: 184px; + width: 70px; border-radius: 0px; } diff --git a/Interface Source Code/src/index.html b/Interface Source Code/src/index.html index 8a27f29..b7cb9c5 100644 --- a/Interface Source Code/src/index.html +++ b/Interface Source Code/src/index.html @@ -31,7 +31,8 @@
-
+ +
@@ -100,9 +101,10 @@
- - -
+ + + +
From 9327b0b086c4357148812e3acac4b159ed815b81 Mon Sep 17 00:00:00 2001 From: jams <36876904+jamsge@users.noreply.github.com> Date: Mon, 24 Oct 2022 21:31:34 -0700 Subject: [PATCH 2/7] gui.js additions + global variable for pronouns + input resize listeners for pronoun inputs + add pronouns to swap function + add pronouns to clear players function + add pronouns to scoreboard json --- Interface Source Code/src/gui.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Interface Source Code/src/gui.js b/Interface Source Code/src/gui.js index 11ed176..6bb6416 100644 --- a/Interface Source Code/src/gui.js +++ b/Interface Source Code/src/gui.js @@ -24,8 +24,10 @@ const viewport = document.getElementById('viewport'); const p1NameInp = document.getElementById('p1Name'); const p1TagInp = document.getElementById('p1Tag'); +const p1PronounsInp = document.getElementById('p1Pronouns'); const p2NameInp = document.getElementById('p2Name'); const p2TagInp = document.getElementById('p2Tag'); +const p2PronounsInp = document.getElementById('p2Pronouns'); const charImgP1 = document.getElementById('p1CharImg'); const charImgP2 = document.getElementById('p2CharImg'); @@ -114,6 +116,10 @@ function init() { //resize the box whenever the user types p1TagInp.addEventListener("input", resizeInput); p2TagInp.addEventListener("input", resizeInput); + + //resize the box whenever the user types + p1PronounsInp.addEventListener("input", resizeInput); + p2PronounsInp.addEventListener("input", resizeInput); //set click listeners to change the "best of" status @@ -672,18 +678,24 @@ function checkRound() { function swap() { let tempP1Name = p1NameInp.value; let tempP1Team = p1TagInp.value; + let tempP1Pronouns = p1PronounsInp.value; let tempP2Name = p2NameInp.value; let tempP2Team = p2TagInp.value; + let tempP2Pronouns = p2PronounsInp.value; p1NameInp.value = tempP2Name; p1TagInp.value = tempP2Team; + p1PronounsInp.value = tempP2Pronouns p2NameInp.value = tempP1Name; p2TagInp.value = tempP1Team; + p2PronounsInp.value = tempP1Pronouns changeInputWidth(p1NameInp); changeInputWidth(p1TagInp); + changeInputWidth(p1PronounsInp); changeInputWidth(p2NameInp); changeInputWidth(p2TagInp); + changeInputWidth(p2PronounsInp); let tempP1Char = charP1; @@ -710,12 +722,16 @@ function clearPlayers() { //clear player texts p1TagInp.value = ""; p1NameInp.value = ""; + p1PronounsInp.value=""; p2TagInp.value = ""; p2NameInp.value = ""; + p2PronounsInp.value=""; changeInputWidth(p1TagInp); changeInputWidth(p1NameInp); + changeInputWidth(p1PronounsInp); changeInputWidth(p2TagInp); changeInputWidth(p2NameInp); + changeInputWidth(p2PronounsInp); //reset characters to random document.getElementById('p1CharSelector').setAttribute('src', charPath + '/CSS/Random.png'); @@ -779,6 +795,7 @@ function writeScoreboard() { let scoreboardJson = { p1Name: p1NameInp.value, p1Team: p1TagInp.value, + p1Pronouns: p1PronounsInp.value, p1Character: charP1, p1Skin: skinP1, p1Color: colorP1, @@ -786,6 +803,7 @@ function writeScoreboard() { p1WL: currentP1WL, p2Name: p2NameInp.value, p2Team: p2TagInp.value, + p2Pronouns: p2PronounsInp.value, p2Character: charP2, p2Skin: skinP2, p2Color: colorP2, From 2a9e93e7debcf823e322425df5cb3ccb6a2671c4 Mon Sep 17 00:00:00 2001 From: jams <36876904+jamsge@users.noreply.github.com> Date: Mon, 24 Oct 2022 22:40:34 -0700 Subject: [PATCH 3/7] Game Scoreboard.html addtions: + pronoun text and wrapper element + appropriate style addtions --- Stream Tool/Game Scoreboard.html | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Stream Tool/Game Scoreboard.html b/Stream Tool/Game Scoreboard.html index b070ac8..9372ed1 100644 --- a/Stream Tool/Game Scoreboard.html +++ b/Stream Tool/Game Scoreboard.html @@ -153,10 +153,30 @@ #p1Wrapper { left: 5px; } - + #p2Wrapper { right: 5px; } + + .pronouns-wrapper { + text-transform: none; + position:absolute; + text-align: center; + top:435px; + width: 150px; + height: 54px; + font-size:40px; + background-color: aqua; + font-family: "Deansgate"; + } + + #p1Pronouns-wrapper { + left: 18px; + } + + #p2Pronouns-wrapper { + right: 18px; + } .teams { color: rgb(116, 116, 116); @@ -414,6 +434,14 @@
+
+ they/them +
+ +
+ it +
+
From 191e8810e87543302ea69d29fb0eb67caeaad0bb Mon Sep 17 00:00:00 2001 From: jams <36876904+jamsge@users.noreply.github.com> Date: Mon, 24 Oct 2022 22:41:42 -0700 Subject: [PATCH 4/7] Game Scoreboard.js additions: + updatePlayerName pronoun parameters + update pronoun text on json update --- .../Resources/Scripts/Game Scoreboard.js | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Stream Tool/Resources/Scripts/Game Scoreboard.js b/Stream Tool/Resources/Scripts/Game Scoreboard.js index 50b3819..444134f 100644 --- a/Stream Tool/Resources/Scripts/Game Scoreboard.js +++ b/Stream Tool/Resources/Scripts/Game Scoreboard.js @@ -42,6 +42,7 @@ function init() { async function getData(scInfo) { let p1Name = scInfo['p1Name']; let p1Team = scInfo['p1Team']; + let p1Pronouns = scInfo['p1Pronouns']; let p1Score = scInfo['p1Score']; let p1Color = scInfo['p1Color']; let p1Character = scInfo['p1Character']; @@ -50,6 +51,7 @@ async function getData(scInfo) { let p2Name = scInfo['p2Name']; let p2Team = scInfo['p2Team']; + let p2Pronouns = scInfo['p2Pronouns']; let p2Score = scInfo['p2Score']; let p2Color = scInfo['p2Color']; let p2Character = scInfo['p2Character']; @@ -148,7 +150,7 @@ async function getData(scInfo) { //finally out of the intro, now lets start with player 1 first //update player name and team name texts - updatePlayerName('p1Wrapper', 'p1Name', 'p1Team', p1Name, p1Team); + updatePlayerName('p1Wrapper', 'p1Name', 'p1Team', 'p1Pronouns', p1Name, p1Team, p1Pronouns); //sets the starting position for the player text, then fades in and moves the p1 text to the next keyframe gsap.fromTo("#p1Wrapper", {x: -pMove}, //from @@ -180,7 +182,7 @@ async function getData(scInfo) { //took notes from player 1? well, this is exactly the same! - updatePlayerName('p2Wrapper', 'p2Name', 'p2Team', p2Name, p2Team); + updatePlayerName('p2Wrapper', 'p2Name', 'p2Team', 'p2Pronouns', p2Name, p2Team, p2Pronouns); gsap.fromTo("#p2Wrapper", {x: pMove}, {delay: introDelay+.1, x: 0, opacity: 1, ease: "power2.out", duration: fadeInTime}); @@ -271,13 +273,15 @@ async function getData(scInfo) { //player 1 time! if (document.getElementById('p1Name').textContent != p1Name || - document.getElementById('p1Team').textContent != p1Team) { + document.getElementById('p1Team').textContent != p1Team || + document.getElementById('p1Pronouns').textContent != p1Pronouns) { //move and fade out the player 1's text fadeOutMove("#p1Wrapper", -pMove, () => { //now that nobody is seeing it, quick, change the text's content! - updatePlayerName('p1Wrapper', 'p1Name', 'p1Team', p1Name, p1Team); + updatePlayerName('p1Wrapper', 'p1Name', 'p1Team', 'p1Pronouns', p1Name, p1Team, p1Pronouns); //fade the name back in with a sick movement fadeInMove("#p1Wrapper"); + fadeInMove("#p1Pronouns-wrapper") }); } @@ -336,10 +340,12 @@ async function getData(scInfo) { //did you pay attention earlier? Well, this is the same as player 1! if (document.getElementById('p2Name').textContent != p2Name || - document.getElementById('p2Team').textContent != p2Team){ + document.getElementById('p2Team').textContent != p2Team || + document.getElementById('p2Pronouns').textContent != p2Pronouns){ fadeOutMove("#p2Wrapper", pMove, () => { - updatePlayerName('p2Wrapper', 'p2Name', 'p2Team', p2Name, p2Team); + updatePlayerName('p2Wrapper', 'p2Name', 'p2Team', 'p2Pronouns', p2Name, p2Team, p2Pronouns); fadeInMove("#p2Wrapper"); + fadeInMove("#p2Pronouns-wrapper"); }); } @@ -616,16 +622,19 @@ function updateSocial(mainSocial, mainText, mainBox, otherSocial, otherBox) { } //player text change -function updatePlayerName(wrapperID, nameID, teamID, pName, pTeam) { +function updatePlayerName(wrapperID, nameID, teamID, pronounsID, pName, pTeam, pPronouns) { const nameEL = document.getElementById(nameID); nameEL.style.fontSize = '30px'; //set original text size nameEL.textContent = pName; //change the actual text const teamEL = document.getElementById(teamID); teamEL.style.fontSize = '20px'; teamEL.textContent = pTeam; + const pronounsEl = document.getElementById(pronounsID); + pronounsEl.textContent = pPronouns; resizeText(document.getElementById(wrapperID)); //resize if it overflows } + //round change function updateRound(round) { const roundEL = document.getElementById('round'); From a68f81d017778dd081d89a0d25abad5af0920f4d Mon Sep 17 00:00:00 2001 From: jams <36876904+jamsge@users.noreply.github.com> Date: Mon, 24 Oct 2022 22:44:22 -0700 Subject: [PATCH 5/7] bruh moment --- Stream Tool/Game Scoreboard.html | 1 - 1 file changed, 1 deletion(-) diff --git a/Stream Tool/Game Scoreboard.html b/Stream Tool/Game Scoreboard.html index 9372ed1..802d1e4 100644 --- a/Stream Tool/Game Scoreboard.html +++ b/Stream Tool/Game Scoreboard.html @@ -166,7 +166,6 @@ width: 150px; height: 54px; font-size:40px; - background-color: aqua; font-family: "Deansgate"; } From db88e940ec5edf85ac102f119cf8b818fb7917f0 Mon Sep 17 00:00:00 2001 From: jams <36876904+jamsge@users.noreply.github.com> Date: Tue, 25 Oct 2022 02:50:52 -0700 Subject: [PATCH 6/7] set font size in script instead of css, small adjustments --- Stream Tool/Game Scoreboard.html | 15 +++++++-------- Stream Tool/Resources/Scripts/Game Scoreboard.js | 7 +++++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Stream Tool/Game Scoreboard.html b/Stream Tool/Game Scoreboard.html index 802d1e4..cbebfb4 100644 --- a/Stream Tool/Game Scoreboard.html +++ b/Stream Tool/Game Scoreboard.html @@ -162,10 +162,9 @@ text-transform: none; position:absolute; text-align: center; - top:435px; + top:430px; width: 150px; height: 54px; - font-size:40px; font-family: "Deansgate"; } @@ -433,13 +432,13 @@
-
- they/them -
+ + + -
- it -
+ + +
diff --git a/Stream Tool/Resources/Scripts/Game Scoreboard.js b/Stream Tool/Resources/Scripts/Game Scoreboard.js index 444134f..baa719c 100644 --- a/Stream Tool/Resources/Scripts/Game Scoreboard.js +++ b/Stream Tool/Resources/Scripts/Game Scoreboard.js @@ -12,6 +12,7 @@ let p2CharacterPrev, p2SkinPrev, p2ScorePrev, p2ColorPrev, p2wlPrev; let bestOfPrev; //max text sizes (used when resizing back) +const pronounSize = '24px'; const roundSize = '32px'; const casterSize = '24px'; const twitterSize = '20px'; @@ -629,8 +630,10 @@ function updatePlayerName(wrapperID, nameID, teamID, pronounsID, pName, pTeam, p const teamEL = document.getElementById(teamID); teamEL.style.fontSize = '20px'; teamEL.textContent = pTeam; - const pronounsEl = document.getElementById(pronounsID); - pronounsEl.textContent = pPronouns; + const pronounsEL = document.getElementById(pronounsID); + pronounsEL.style.fontSize = pronounSize; // set original text size + pronounsEL.textContent = pPronouns; // change the actual text + resizeText(pronounsEL); // resize if it overflows resizeText(document.getElementById(wrapperID)); //resize if it overflows } From 8f0059862ebdd9c62f81481b2303f1c201646211 Mon Sep 17 00:00:00 2001 From: jams <36876904+jamsge@users.noreply.github.com> Date: Tue, 25 Oct 2022 14:14:48 -0700 Subject: [PATCH 7/7] fix window sizing --- Interface Source Code/src/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Interface Source Code/src/index.js b/Interface Source Code/src/index.js index 772b92f..74197cc 100644 --- a/Interface Source Code/src/index.js +++ b/Interface Source Code/src/index.js @@ -9,13 +9,12 @@ if (require('electron-squirrel-startup')) { // eslint-disable-line global-requir const createWindow = () => { // Create the browser window. const mainWindow = new BrowserWindow({ - width: 600, - height: 300, - + minHeight: 360, minWidth: 600, - minHeight: 300, + maxHeight: 360, maxWidth: 600, - maxHeight: 300, + height:360, + width:360, webPreferences: { nodeIntegration: true,