From 5482c6aae9b520bf0dfd31de4c4bbec38794d3ba Mon Sep 17 00:00:00 2001 From: Charles Danesi Date: Thu, 7 Oct 2021 20:36:08 -0400 Subject: [PATCH 1/2] refactor code --- script.js | 12 +++++------- style.css | 56 ------------------------------------------------------- 2 files changed, 5 insertions(+), 63 deletions(-) diff --git a/script.js b/script.js index 2a5850b..7defa20 100644 --- a/script.js +++ b/script.js @@ -14,7 +14,11 @@ updateBackground(); function updateBackground() { isWarranty.nextElementSibling.style.backgroundColor = isWarranty.checked ? "red" - : "transparent"; + : "transparent"; + isWarranty.nextElementSibling.style.color = isWarranty.checked + ? "white" + : "black"; +} } // Notification system @@ -23,9 +27,3 @@ function updateBackground() { const notifCountStr = document.getElementById("lblTask").innerText; const notifCount = parseInt(notifCountStr.split(" ")[2]); // Total task count const notifCountNew = parseInt(notifCountStr.split(" ")[5].slice(1)); // New task count - -/* -// Insert notification button -const insertButton = document.getElementById("exitBtn"); -insertButton.innerHTML = `
notifications${notifCountNew}
`; -*/ diff --git a/style.css b/style.css index 5d998e2..ea7828a 100644 --- a/style.css +++ b/style.css @@ -156,59 +156,3 @@ img[id="Img3"] { label[for="chkWarrantee"] { padding: 0.35em; } - -/* Fancy Notifications */ - -/* -#div_task { - display: none; - visibility: hidden; -} - -#newBtn { - position: relative; -} - -.material-icons-outlined { - font-family: "Material Icons Outlined"; -} - -#notification-button { - position: relative; - color: var(--lightblue); - cursor: pointer; - text-decoration: none; - outline: none; -} - -#notification-button:hover { - color: var(--lightgray); -} - -.notification-icon { - font-size: 2.5em; - position: absolute; - top: 5; - right: 3; -} - -#notification-badge { - position: absolute; - top: 0; - right: 0; -} -*/ - -/* Top bar */ - -#div_location { - /* position: relative; - width: 80%; */ -} - -#frmLocation { - /* position: absolute; - top: -40; - right: 370; */ -} -*/ \ No newline at end of file From 945c0f8d94da91621750f878468093bc6fc4f83d Mon Sep 17 00:00:00 2001 From: Charles Danesi Date: Thu, 7 Oct 2021 20:37:09 -0400 Subject: [PATCH 2/2] fix typo in script.js --- script.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/script.js b/script.js index 7defa20..f09500f 100644 --- a/script.js +++ b/script.js @@ -14,12 +14,11 @@ updateBackground(); function updateBackground() { isWarranty.nextElementSibling.style.backgroundColor = isWarranty.checked ? "red" - : "transparent"; - isWarranty.nextElementSibling.style.color = isWarranty.checked + : "transparent"; + isWarranty.nextElementSibling.style.color = isWarranty.checked ? "white" : "black"; } -} // Notification system // https://portal.trgrepair.com/task_manager.asp?rnd=0.9996227368620352