" ui change"

component_ui
sonali 2024-10-02 18:02:18 +05:30
parent d8c91e08d9
commit ea5f145e98
12 changed files with 696 additions and 557 deletions

View File

@ -1,38 +0,0 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@ -1,7 +1,7 @@
.layout-container { .layout-container {
display: flex; /* display: flex;
flex-direction: column; flex-direction: column;
min-height: 100vh; min-height: 100vh; */
font-family: 'Montserrat', sans-serif; font-family: 'Montserrat', sans-serif;
} }

View File

@ -1,4 +1,3 @@
.amount-container { .amount-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -14,10 +13,10 @@
.backarrow { .backarrow {
position: relative; /* position: absolute; */
width: 100%; width: 100%;
text-align: center;
margin-bottom: 50px;
} }
@ -35,7 +34,7 @@
.amount-titles { .amount-titles {
font-size: 24px; font-size: 24px;
width: 100px; width: 100%;
color: #fff; color: #fff;
margin: 0 auto; margin: 0 auto;
text-align: center; text-align: center;
@ -45,6 +44,8 @@
.amount-display { .amount-display {
display: flex; display: flex;
width: 150px;
height: 30px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: #1E1E1E; background: #1E1E1E;
@ -81,7 +82,6 @@
.coin { .coin {
width: 50px; width: 50px;
height: 50px; height: 50px;
background: #E335DC; background: #E335DC;
box-shadow: -10px -10px 12px rgba(50, 50, 51, 0.66), 10px 10px 16px #040404, inset -2px -2px 2px rgba(111, 0, 121, 0.64), inset 2px 2px 2px rgba(102, 0, 98, 0.56); box-shadow: -10px -10px 12px rgba(50, 50, 51, 0.66), 10px 10px 16px #040404, inset -2px -2px 2px rgba(111, 0, 121, 0.64), inset 2px 2px 2px rgba(102, 0, 98, 0.56);
border-radius: 50%; border-radius: 50%;
@ -95,9 +95,6 @@
} }
.coin-value { .coin-value {
font-size: 24px; font-size: 24px;
font-weight: bold; font-weight: bold;
@ -147,8 +144,8 @@
} }
.Rupeesicon { .Rupeesicon {
width: 20px; width: 33px;
height: 20px; height: 33px;
} }
.total-amount { .total-amount {
@ -189,3 +186,45 @@
} }
} }
@media (max-width: 375px) {
.amount-container {
padding: 0px;
max-width: 90%;
}
.backarrow {
justify-content: space-between;
}
.arrowbtn {
font-size: 20px;
margin: 20px 8px;
}
.amount-titles {
font-size: 18px;
}
.rupess_section {
gap: 8px;
margin-top: 10px;
}
.coin {
width: 40px;
height: 35px;
}
.coin-value {
font-size: 20px;
}
.Rupeesicon {
width: 25px;
height: 25px;
}
.total-amount {
font-size: 26px;
}
}

View File

@ -1,9 +1,16 @@
body {
margin: 0;
overflow: hidden; /* Disable page scrolling */
}
/* Centered container without scrolling */
.total-amount-container { .total-amount-container {
display: flex;
flex-direction: column; flex-direction: column;
position: absolute; position: fixed;
width: 80%; width: 80%;
max-width: 500px; max-width: 500px;
height: auto; height: 340px;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
@ -13,7 +20,7 @@
box-shadow: -8px -8px 12px rgba(50, 50, 51, 0.66), 8px 8px 16px #040404, box-shadow: -8px -8px 12px rgba(50, 50, 51, 0.66), 8px 8px 16px #040404,
inset -2px -2px 2px rgba(255, 255, 255, 0.64), inset -2px -2px 2px rgba(255, 255, 255, 0.64),
inset 2px 2px 2px rgba(39, 39, 44, 0.56); inset 2px 2px 2px rgba(39, 39, 44, 0.56);
padding: 20px; padding: 8px;
box-sizing: border-box; box-sizing: border-box;
} }
@ -82,7 +89,7 @@
@media (max-width: 768px) { @media (max-width: 768px) {
.total-amount-container { .total-amount-container {
width: 90%; width: 90%;
top: 60%; top: 65%;
} }
.input-group { .input-group {

View File

@ -7,11 +7,10 @@
background-color: #1e1e1e; background-color: #1e1e1e;
color: white; color: white;
width: 100%; width: 100%;
padding: 10px; padding: 10px;
} }
.arrow { .arrow {
position: absolute; position: absolute;
top: 10px; top: 10px;
@ -32,15 +31,21 @@
text-align: center; text-align: center;
} */ } */
.category-titles {
font-size: 20px;
margin-right: 4px;
color: #fff;
margin-bottom: 20px;
}
.category-display { .category-display {
margin: 30px; margin: 35px 0 10px 0;
width: 150px; width: 150px;
height: 30px; height: 30px;
/* left: calc(50% - 207px / 2 - 0.5px); */
top: 90px;
background: #1E1E1E; background: #1E1E1E;
box-shadow: 0px 0px 22.3px #00D092, 0px 0px 2.9px #FFFFFF, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56); box-shadow: 0px 0px 22.3px #00D092, 0px 0px 2.9px #FFFFFF, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56);
border-radius: 24px; border-radius: 24px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -48,17 +53,13 @@
border-radius: 8px; border-radius: 8px;
} }
.category-titles {
font-size: 24px;
margin-right: 4px;
}
.category-icon { .category-icon {
width: 30px; width: 30px;
/* top: 10px; */ /* top: 10px; */
justify-content: center; justify-content: center;
align-items: center; align-items: center;
/* margin: 2px; */ margin: 2px;
height: 30px; height: 30px;
} }
@ -68,13 +69,13 @@
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
margin-top: 20px; margin-top: 0px;
} }
.cat-item { .cat-item {
background-color: #2a2a2a; background-color: #2a2a2a;
border-radius: 10px; border-radius: 10px;
padding: 15px; padding: 10px;
margin: 10px; margin: 10px;
min-width: 120px; min-width: 120px;
text-align: center; text-align: center;
@ -105,9 +106,6 @@
transition: border-color 0.3s ease, background-color 0.3s ease; transition: border-color 0.3s ease, background-color 0.3s ease;
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.category-titles { .category-titles {
font-size: 20px; font-size: 20px;
@ -118,7 +116,7 @@
.category-icon { .category-icon {
width: 35px; width: 35px;
margin: 10px; margin: 10px;
height: 35px; height: 3px;
} }
.cat-item { .cat-item {
@ -135,6 +133,7 @@
.category-titles { .category-titles {
font-size: 18px; font-size: 18px;
color: #fff;
} }
@ -156,3 +155,47 @@
} }
} }
@media (max-width: 375px) {
.category-container {
padding: 0;
}
.arrow {
top: 30px;
left: 20px;
}
.category-display {
width: 120px;
height: 20px;
margin: 15px auto;
font-size: 14px;
}
.category-titles {
font-size: 13px;
justify-content: center;
/* align-items: center; */
margin-right: 5px;
}
.category-icons {
width: 20px;
margin: 3px;
height: 20px;
}
.cat-item {
min-width: 40px;
font-size: 9px;
padding: 6px;
margin: 6px;
}
.texts {
width: 80%;
font-size: 14px;
padding: 8px;
margin: 15px 0;
}
}

View File

@ -8,21 +8,18 @@ import '../ExpenseCategory/ExpenseCategory.css';
function ExpenseCategory() { function ExpenseCategory() {
const navigate = useNavigate(); const navigate = useNavigate();
const [totalAmount, setTotalAmount, category, setCategory] = useOutletContext(); const [totalAmount, setTotalAmount, category, setCategory] = useOutletContext();
const [categories, setCategories] = useState(["Hair", "Clothing", "Food", "Books", "Electronics", "Other"]); const [categories, setCategories] = useState(["Hair", "Clothing", "Food", "Books", "Electronics", "Other"]);
const [selectedCategories, setSelectedCategories] = useState([]); const [selectedCategories, setSelectedCategories] = useState([]);
const [customCategoryCount, setCustomCategoryCount] = useState(0); const [customCategoryCount, setCustomCategoryCount] = useState(0);
const [newCategory, setNewCategory] = useState('');
const location = useLocation(); const location = useLocation();
const entryType = location.state?.entryType; const entryType = location.state?.entryType;
const handleBackClick = () => { const handleBackClick = () => {
navigate("/income", { state: { entryType } });
navigate("/expense", { state: { entryType } });
console.log(entryType); console.log(entryType);
} }
@ -38,7 +35,8 @@ function ExpenseCategory() {
} }
}; };
const handleAddCategory = (newCategory) => { const handleAddCategory = () => {
if (newCategory.trim() === '') return;
if (!categories.includes(newCategory)) { if (!categories.includes(newCategory)) {
if (customCategoryCount < 3) { if (customCategoryCount < 3) {
const updatedCategories = [...categories, newCategory]; const updatedCategories = [...categories, newCategory];
@ -46,6 +44,7 @@ function ExpenseCategory() {
setCustomCategoryCount(customCategoryCount + 1); setCustomCategoryCount(customCategoryCount + 1);
localStorage.setItem('categories', JSON.stringify(updatedCategories)); localStorage.setItem('categories', JSON.stringify(updatedCategories));
alert(`Category "${newCategory}" added!`); alert(`Category "${newCategory}" added!`);
setNewCategory(''); // Clear input field after adding
} else { } else {
alert('You can only add up to three custom categories!'); alert('You can only add up to three custom categories!');
} }
@ -90,20 +89,25 @@ function ExpenseCategory() {
))} ))}
</section> </section>
{/* Input and button for adding new category */}
{customCategoryCount < 3 && ( {customCategoryCount < 3 && (
<input className='texts' <div className="add-category">
<input
className='texts'
type="text" type="text"
placeholder="Add New Category" placeholder="Add New Category"
onKeyDown={(e) => { value={newCategory}
if (e.key === 'Enter') { onChange={(e) => setNewCategory(e.target.value)}
handleAddCategory(e.target.value);
e.target.value = '';
}
}}
/> />
<button
className="add-button"
onClick={handleAddCategory}
>
Add
</button>
</div>
)} )}
</div> </div>
); );
} }
export default ExpenseCategory; export default ExpenseCategory;

View File

@ -1,6 +1,6 @@
.expense-container { .expense-container {
max-width: 800px; max-width: 100%;
margin: 0 auto; margin: 0 auto;
padding: 20px; padding: 20px;
justify-content: center; justify-content: center;

View File

@ -1,6 +1,12 @@
body {
margin: 0;
overflow: hidden;
}
.total-amount-container { .total-amount-container {
display: flex;
flex-direction: column; flex-direction: column;
position: absolute; position: relative;
width: 80%; width: 80%;
max-width: 500px; max-width: 500px;
height: auto; height: auto;
@ -82,7 +88,7 @@ input:focus {
@media (max-width: 768px) { @media (max-width: 768px) {
.total-amount-container { .total-amount-container {
width: 90%; width: 90%;
top: 60%; top: auto;
} }
.input-group { .input-group {
@ -119,3 +125,24 @@ input:focus {
height: 40px; height: 40px;
} }
} }
@media (max-width: 375px) {
.total-amount-container {
padding: 15px;
margin: 20px;
width: 95%;
}
.amount-input,
.category-input {
min-width: 150px;
}
.add-entry-1,
.add-entry-2 {
font-size: 12px;
height: 35px;
}
}

View File

@ -7,7 +7,7 @@
background-color: #1e1e1e; background-color: #1e1e1e;
color: white; color: white;
width: 100%; width: 100%;
font-family: 'Montserrat', sans-serif;
padding: 10px; padding: 10px;
} }
@ -21,8 +21,6 @@
.arrow-icon { .arrow-icon {
font-size: 24px; font-size: 24px;
right: 85px;
bottom: 40px;
} }
/* /*
@ -35,12 +33,17 @@
text-align: center; text-align: center;
} */ } */
.category-titles {
font-size: 20px;
margin-right: 4px;
color: #fff;
margin-bottom: 20px; /* Add 10px space below category titles */
}
.category-display { .category-display {
margin: 40px; margin: 35px 0 10px 0; /* 10px space below the display box */
width: 10px; width: 150px;
height: 30px; height: 30px;
/* left: calc(50% - 207px / 2 - 0.5px); */
top: 90px;
background: #1E1E1E; background: #1E1E1E;
box-shadow: 0px 0px 22.3px #00D092, 0px 0px 2.9px #FFFFFF, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56); box-shadow: 0px 0px 22.3px #00D092, 0px 0px 2.9px #FFFFFF, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56);
border-radius: 24px; border-radius: 24px;
@ -52,18 +55,13 @@
border-radius: 8px; border-radius: 8px;
} }
.category-titles {
font-size: 24px;
color: #fff;
margin-right: 4px;
}
.category-icon { .category-icon {
width: 30px; width: 30px;
/* top: 10px; */ /* top: 10px; */
justify-content: center; justify-content: center;
align-items: center; align-items: center;
/* margin: 2px; */ margin: 2px;
height: 30px; height: 30px;
} }
@ -73,13 +71,13 @@
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
margin-top: 20px; margin-top: 0px;
} }
.cat-item { .cat-item {
background-color: #2a2a2a; background-color: #2a2a2a;
border-radius: 10px; border-radius: 10px;
padding: 15px; padding: 10px;
margin: 10px; margin: 10px;
min-width: 120px; min-width: 120px;
text-align: center; text-align: center;
@ -110,23 +108,44 @@
transition: border-color 0.3s ease, background-color 0.3s ease; transition: border-color 0.3s ease, background-color 0.3s ease;
} }
.add-category {
display: flex;
align-items: center;
margin-top: 10px;
}
.texts {
flex: 1;
padding: 5px;
margin-right: 10px;
}
.add-button {
padding: 10px 14px;
margin: 15px;
background-color: #2a2a2a;
color: white;
border: none;
border-radius: 3px;
cursor: pointer;
}
.add-button:hover {
background-color: #2a2a2a;
}
/* Mobile responsiveness */
@media (max-width: 768px) { @media (max-width: 768px) {
.category-titles { .category-titles {
font-size: 20px; font-size: 20px;
} }
.category-container {
margin: 10px;
}
.category-icon { .category-icon {
width: 35px; width: 35px;
margin: 10px; margin: 10px;
height: 35px; height: 3px;
} }
.cat-item { .cat-item {
@ -137,12 +156,13 @@
@media (max-width: 480px) { @media (max-width: 480px) {
.arrow { .arrow {
top: 30px; top: 40px;
left: 10px; left: 40px;
} }
.category-titles { .category-titles {
font-size: 18px; font-size: 18px;
color: #fff;
} }
@ -164,3 +184,46 @@
} }
} }
@media (max-width: 375px) {
.category-container {
padding: 0; /* Reduce padding for a more compact layout */
}
.arrow {
top: 30px; /* Adjust positioning of the arrow */
left: 20px;
}
.category-display {
width: 120px; /* Adjust width to fit smaller screens */
height: 25px;
margin: 15px auto; /* Center and reduce margins */
font-size: 14px; /* Adjust font size for smaller display */
}
.category-titles {
font-size: 16px; /* Reduce font size */
margin-right: 2px; /* Adjust spacing */
}
.category-icon {
width: 25px; /* Reduce size of icons */
height: 25px;
margin: 5px;
}
.cat-item {
min-width: 70px;
font-size: 12px;
padding: 8px;
margin: 6px;
}
.texts {
width: 80%;
font-size: 14px;
padding: 8px;
margin: 15px 0;
}
}

View File

@ -11,13 +11,12 @@ function Category() {
const [categories, setCategories] = useState(["Hair", "Clothing", "Food", "Books", "Electronics", "Other"]); const [categories, setCategories] = useState(["Hair", "Clothing", "Food", "Books", "Electronics", "Other"]);
const [selectedCategories, setSelectedCategories] = useState([]); const [selectedCategories, setSelectedCategories] = useState([]);
const [customCategoryCount, setCustomCategoryCount] = useState(0); const [customCategoryCount, setCustomCategoryCount] = useState(0);
const [newCategory, setNewCategory] = useState('');
const location = useLocation(); const location = useLocation();
const entryType = location.state?.entryType; const entryType = location.state?.entryType;
const handleBackClick = () => { const handleBackClick = () => {
navigate("/income", { state: { entryType } }); navigate("/income", { state: { entryType } });
console.log(entryType); console.log(entryType);
} }
@ -34,7 +33,8 @@ function Category() {
} }
}; };
const handleAddCategory = (newCategory) => { const handleAddCategory = () => {
if (newCategory.trim() === '') return;
if (!categories.includes(newCategory)) { if (!categories.includes(newCategory)) {
if (customCategoryCount < 3) { if (customCategoryCount < 3) {
const updatedCategories = [...categories, newCategory]; const updatedCategories = [...categories, newCategory];
@ -42,6 +42,7 @@ function Category() {
setCustomCategoryCount(customCategoryCount + 1); setCustomCategoryCount(customCategoryCount + 1);
localStorage.setItem('categories', JSON.stringify(updatedCategories)); localStorage.setItem('categories', JSON.stringify(updatedCategories));
alert(`Category "${newCategory}" added!`); alert(`Category "${newCategory}" added!`);
setNewCategory(''); // Clear input field after adding
} else { } else {
alert('You can only add up to three custom categories!'); alert('You can only add up to three custom categories!');
} }
@ -86,17 +87,23 @@ function Category() {
))} ))}
</section> </section>
{/* Input and button for adding new category */}
{customCategoryCount < 3 && ( {customCategoryCount < 3 && (
<input className='texts' <div className="add-category">
<input
className='texts'
type="text" type="text"
placeholder="Add New Category" placeholder="Add New Category"
onKeyDown={(e) => { value={newCategory}
if (e.key === 'Enter') { onChange={(e) => setNewCategory(e.target.value)}
handleAddCategory(e.target.value);
e.target.value = '';
}
}}
/> />
<button
className="add-button"
onClick={handleAddCategory}
>
Add
</button>
</div>
)} )}
</div> </div>
); );

View File

@ -123,7 +123,7 @@
} }
.buttons { .buttons {
max-width: 100%; max-width: 80%;
} }
.expense-btn, .income-btn { .expense-btn, .income-btn {

View File

@ -1,13 +0,0 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}