Skip to content

Commit

Permalink
fix: improve setting styles
Browse files Browse the repository at this point in the history
  • Loading branch information
dubisdev committed Feb 22, 2023
1 parent 93aac10 commit f606076
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 20 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"just-debounce": "1.1.0",
"mathjs": "11.5.1",
"react": "18.2.0",
"react-colorful": "^5.6.1",
"react-dom": "18.2.0",
"react-textra": "0.1.3",
"tauri-plugin-autostart-api": "https://github.com/tauri-apps/tauri-plugin-autostart",
Expand Down
2 changes: 1 addition & 1 deletion settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
padding: 0 2em;
font-family: sans-serif;
color: rgb(241, 238, 238);
background-color: rgb(32, 41, 64);
background-color: rgb(22, 22, 23);
}

</style>
Expand Down
15 changes: 7 additions & 8 deletions src/components/Settings/BGColor.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { HexColorPicker } from "react-colorful";
import { settings } from "@utils/settingsStorage";
import styles from "./index.module.css";
import "./bgcolor.css";
import * as ls from "@utils/localStorage";

export const BGColor = () => {
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
ls.set("background", event.target.value);
const handlePickerChange = (color: string) => {
ls.set("background", color);
};

return (
<input
type="color"
defaultValue={settings.getCache("background")}
onChange={handleChange}
className={styles.settingValue}
<HexColorPicker
color={settings.getCache("background")}
onChange={handlePickerChange}
/>
);
};
5 changes: 5 additions & 0 deletions src/components/Settings/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export const Checkbox = (props: CheckboxProps) => {

return (
<input
style={{
accentColor: "white",
width: "30%",
height: "1.25rem",
}}
type="checkbox"
checked={isChecked}
onChange={(e) => onChange(e.target.checked)}
Expand Down
20 changes: 20 additions & 0 deletions src/components/Settings/bgcolor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.react-colorful {
height: 95px !important;
width: 30% !important;
}

.react-colorful__saturation {
height: 80px !important;
border-radius: 0px 10px 0px 0px !important;
}

.react-colorful__hue {
height: 15px !important;
border-radius: 0px 0px 10px 0px !important;
}

.react-colorful__pointer {
border: 2px solid white !important;
width: 15px !important;
height: 15px !important;
}
32 changes: 21 additions & 11 deletions src/components/Settings/index.module.css
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
.settingsContainer {
color: whitesmoke;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
width: 95%;
margin: 0 auto;
gap: 1em;
}

.settingItem {
padding: 0.5em;
border: 1px solid white;
background-color: #1f6dbb;
border-radius: 10px;
width: 100%;
display: inline-flex;
gap: 0.5em;
justify-content: space-between;
justify-content: space-evenly;
align-items: center;
box-shadow: 0 0 10px 0 rgba(255, 255, 255, 0.206);
}

.settingTextZone {
width: 80%;
align-self: flex-start;
width: 85%;
padding: 1em;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
gap: 0.25em;
gap: 1em;
}

.settingTitle {
Expand Down Expand Up @@ -59,7 +60,7 @@
font-weight: bold;
color: white;
background-color: #1f6dbb;
border: 1px solid #ffffff;
border: 1px solid #2d2b2b;
border-radius: 0.25em;
padding: 0.5em;
cursor: pointer;
Expand All @@ -71,8 +72,17 @@
font-weight: bold;
color: white;
background-color: #1f6dbb;
border: 1px solid #ffffff;
border: 1px solid #2d2b2b;
border-radius: 0.25em;
padding: 0.5em;
cursor: pointer;
}

button:hover {
background-color: #0f69ca;
}

button:focus {
background-color: #2689f3;
outline-color: cornflowerblue;
}

0 comments on commit f606076

Please sign in to comment.