From 2186af44ecc1924f8343e06714999c76a15a1c0e Mon Sep 17 00:00:00 2001 From: Blaster4385 Date: Mon, 19 Feb 2024 20:43:27 +0530 Subject: refactor: Revamp UI and colorscheme - We gruvbox now :) --- .../src/components/CustomSelect/CustomSelect.jsx | 10 +++++++- .../CustomSelect/CustomSelect.module.css | 28 ++++++++++++++------- client/src/components/Editor/Editor.jsx | 4 +++ client/src/components/Editor/Editor.module.css | 10 +++++--- client/src/components/Header/Header.jsx | 2 +- client/src/components/Header/Header.module.css | 29 +++------------------- client/src/index.css | 2 ++ client/src/variables.css | 5 ++++ 8 files changed, 51 insertions(+), 39 deletions(-) create mode 100644 client/src/variables.css diff --git a/client/src/components/CustomSelect/CustomSelect.jsx b/client/src/components/CustomSelect/CustomSelect.jsx index 9969a6d..2f98b34 100644 --- a/client/src/components/CustomSelect/CustomSelect.jsx +++ b/client/src/components/CustomSelect/CustomSelect.jsx @@ -20,7 +20,15 @@ const CustomSelect = ({ options, onSelect }) => { return (
- {selectedOption ? selectedOption.label : "Select an option"} + {selectedOption ? ( + <> + </> + {selectedOption.label} + + + ) : ( + "Select an option" + )}
{isOpen && (
diff --git a/client/src/components/CustomSelect/CustomSelect.module.css b/client/src/components/CustomSelect/CustomSelect.module.css index a3b6520..158aee0 100644 --- a/client/src/components/CustomSelect/CustomSelect.module.css +++ b/client/src/components/CustomSelect/CustomSelect.module.css @@ -1,32 +1,42 @@ .select { position: relative; display: inline-block; + width: 12rem; + text-align: center; + background-color: var(--color-yellow); + color: var(--color-dark); + border-radius: 10px; } .selected__option { cursor: pointer; padding: 10px; - border: 1px solid #ccc; - border-radius: 4px; + border: none; + display: flex; + justify-content: space-between; } .options { position: absolute; - top: 100%; + top: 140%; left: 0; width: 100%; - border: 1px solid #ccc; - border-top: none; - border-radius: 0 0 4px 4px; - background-color: #ebdbb2; + border: none; + border-radius: 10px; + background-color: var(--color-yellow); z-index: 1; } .option { padding: 10px; - color: #282828; + color: var(--color-dark); + border-bottom: var(--color-dark) 1px solid; cursor: pointer; + transition: all 0.3s ease; &:hover { - background-color: #f0f0f0; + scale: 1.1; + } + &:last-child { + border-bottom: none; } } diff --git a/client/src/components/Editor/Editor.jsx b/client/src/components/Editor/Editor.jsx index 0bb046e..dd07e5f 100644 --- a/client/src/components/Editor/Editor.jsx +++ b/client/src/components/Editor/Editor.jsx @@ -25,6 +25,10 @@ const Editor = () => { }; const handleClick = async () => { + if (!text) { + alert("Please enter some text!"); + return; + } const response = await fetch(`${SERVER_BASE_URL}/bin`, { method: "POST", headers: { diff --git a/client/src/components/Editor/Editor.module.css b/client/src/components/Editor/Editor.module.css index 2e42978..02ac7b3 100644 --- a/client/src/components/Editor/Editor.module.css +++ b/client/src/components/Editor/Editor.module.css @@ -29,6 +29,7 @@ font-size: 16px; line-height: 1.5rem; text-align: right; + color: var(--color-light); } .codespace { @@ -39,7 +40,7 @@ } .codespace__textarea { - caret-color: white; + caret-color: var(--color-light); background: transparent; position: absolute; color: transparent; @@ -70,16 +71,19 @@ right: 3rem; height: 6rem; width: 6rem; - background-color: #ebdbb2; - color: white; + background-color: var(--color-yellow); border: none; border-radius: 50%; cursor: pointer; transition: 0.3s; z-index: 1; + &:hover { + transform: scale(1.1); + } } .btn__icon { height: 3rem; width: 3rem; + filter: invert(11%) sepia(0%) saturate(0%) hue-rotate(158deg) brightness(100%) contrast(88%); } diff --git a/client/src/components/Header/Header.jsx b/client/src/components/Header/Header.jsx index fb8d694..d85b1ea 100644 --- a/client/src/components/Header/Header.jsx +++ b/client/src/components/Header/Header.jsx @@ -6,7 +6,7 @@ import CustomSelect from "../CustomSelect/CustomSelect"; const Header = ({ isSelectVisible, onLanguageChange }) => { return (
-

minibin

+

minibin

{isSelectVisible && (