From e993baf219391b6a562a8e6952e8ed2f6d444509 Mon Sep 17 00:00:00 2001 From: Mritul Date: Tue, 4 Oct 2022 10:16:26 +0530 Subject: [PATCH 1/2] Added active button states --- Style/style.css | 4 ++++ main.js | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Style/style.css b/Style/style.css index d75a2a3..4b8e420 100644 --- a/Style/style.css +++ b/Style/style.css @@ -303,3 +303,7 @@ div.cont { color: #fff; outline: none; } + +.active { + background-color: #fae588; +} diff --git a/main.js b/main.js index efb3df5..ee1bcab 100644 --- a/main.js +++ b/main.js @@ -96,21 +96,33 @@ document.addEventListener("DOMContentLoaded", function () { bold.addEventListener("click", function () { textArea.style.fontWeight = "bold"; + bold.classList.add("active"); + plain.classList.remove("active"); }); underline.addEventListener("click", function () { textArea.style.textDecoration = "underline"; + underline.classList.add("active"); + normal.classList.remove("active"); }); emphasized.addEventListener("click", function () { textArea.style.fontStyle = "italic"; + emphasized.classList.add("active"); + unemphasized.classList.remove("active"); }); plain.addEventListener("click", function () { textArea.style.fontWeight = ""; + plain.classList.add("active"); + bold.classList.remove("active"); }); normal.addEventListener("click", function () { textArea.style.textDecoration = ""; + normal.classList.add("active"); + underline.classList.remove("active"); }); unemphasized.addEventListener("click", function () { textArea.style.fontStyle = ""; + unemphasized.classList.add("active"); + emphasized.classList.remove("active"); }); $(document).on("click", "#files li", function (e) { From b2b9d0d29aaeffaec32a2ba385757b8c68f9c7ad Mon Sep 17 00:00:00 2001 From: Mritul Date: Tue, 4 Oct 2022 10:40:22 +0530 Subject: [PATCH 2/2] Aligned the buttons through a flexbox --- Style/style.css | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Style/style.css b/Style/style.css index 4b8e420..b3d63e1 100644 --- a/Style/style.css +++ b/Style/style.css @@ -137,6 +137,7 @@ header { transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; } + #heading { position: relative; font-size: 5vh; @@ -173,7 +174,7 @@ header { padding: auto; } #emp-nonemp { - margin: auto 16px; + /* margin: auto; */ cursor: pointer; outline: 0; @@ -307,3 +308,25 @@ div.cont { .active { background-color: #fae588; } + +button { + padding: 0.3rem 0.5rem; +} + +#deleteAll, +#save { + width: 100px; + font-size: 0.7rem; + padding: 0.3rem 0; + font-weight: bold; +} + +#style { + display: flex; + align-items: center; + justify-content: space-around; +} + +#emp-nonemp { + display: flex; +}