Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Style stuff #190

Merged
merged 26 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
18fe3fb
fix - Savings goal now diplayed in user specified currency
Ben-G-Man Sep 23, 2024
0854b67
Merge branch 'main' of https://github.com/Ben-G-Man/SOFTENG310-FinTra…
Ben-G-Man Sep 23, 2024
601a430
feat - Added currency utility
Ben-G-Man Sep 24, 2024
7179c95
refactor - Moved currency conversion into currency util file
Ben-G-Man Oct 3, 2024
0456ce8
fix - Fixed merge conflicts
Ben-G-Man Oct 3, 2024
e143dd6
Merge pull request #1 from Ben-G-Man/Ben-G-Man-main
Ben-G-Man Oct 3, 2024
494ab0f
feat - Added connection to dashboard.css file
Ben-G-Man Oct 4, 2024
4dc8402
refactor - Moved CSS into individual stylesheets for reuseability
Ben-G-Man Oct 6, 2024
60829ac
feat - Restyled savings progress bar
Ben-G-Man Oct 6, 2024
dfa335e
feat - Styled background
Ben-G-Man Oct 6, 2024
6c43ba2
feat - Added generic button file
Ben-G-Man Oct 6, 2024
fe3538b
Merge pull request #2 from Ben-G-Man/design/layout-change
Ben-G-Man Oct 6, 2024
a9c57f7
Merge branch 'main' into main
Ben-G-Man Oct 6, 2024
305fd82
fix - Fixed sonar quality check problem
Ben-G-Man Oct 6, 2024
b929775
Merge branch 'main' of https://github.com/Ben-G-Man/SOFTENG310-FinTra…
Ben-G-Man Oct 6, 2024
71baf19
feat - Refactored goal bar CSS
Ben-G-Man Oct 6, 2024
87cb712
feat - Added consistent default button styles
Ben-G-Man Oct 7, 2024
8c3e657
feat - Added SO MUCH STUFF I DEFINITELY SHOULD HAVE COMMITTED MORE FR…
Ben-G-Man Oct 7, 2024
9e35696
fix - Fixed currency consistency
Ben-G-Man Oct 7, 2024
c200b11
fix - Fixed number rounding issue
Ben-G-Man Oct 8, 2024
6cb36c9
fix - I HATE SONAR
Ben-G-Man Oct 8, 2024
89f4a54
fix - I REALLY HATE SONAR
Ben-G-Man Oct 8, 2024
5979144
fix - Okay maybe it isnt that bad
Ben-G-Man Oct 8, 2024
c50dcda
fix - Merged changes from style change pull
Ben-G-Man Oct 8, 2024
3f06ca0
Merge branch 'main' of https://github.com/Ben-G-Man/SOFTENG310-FinTra…
Ben-G-Man Oct 8, 2024
5cd3d33
Merge pull request #3 from Ben-G-Man/Ben-G-Man-main
Ben-G-Man Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions frontend/src/assets/css/currencyDropdown.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@import url("variables.css");

.currencyOptionList_open, .currencyOptionList_closed {
width: 100%
}

.currencyOptionList_open {
transition-duration: 50ms;
height: calc(100vh - 5 * var(--itemHeight) - 3.5 * var(--subSectionPadding) - var(--topBarHeight) - 40px);
padding-top: calc(var(--subSectionPadding) * 2);
}

.currencyOptionList_closed {
transition-duration: 50ms;
height: 0;
padding-top: 0;
overflow: hidden;
}

.currencyOption {
width: 100%;
}

.defaultButton {
position: relative;
z-index: 2;
}

.defaultContainer {
position: relative;
z-index: 1;
float: left;
margin-left: var(--subSectionPadding);
margin-top: calc(var(--subSectionPadding) * -1 - var(--standardRadius) * 2);
min-height: calc(var(--standardRadius) * 2);
}

.currencyOption {
width: 100%;
float: left;
}
10 changes: 7 additions & 3 deletions frontend/src/assets/css/dashboard.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@import url("variables.css");

body {
background: linear-gradient(90deg, rgba(42,4,126,1) 0%, rgba(77,4,126,1) 100%);
/* background: linear-gradient(90deg, rgba(42,4,126,1) 0%, rgba(77,4,126,1) 100%); */
background: var(--color1);
overflow: hidden;
font-family: "Roboto Mono", monospace;
font-size: var(--standardFontSize);
}

.topBar {
Expand All @@ -26,19 +28,21 @@ body {
}

.sideBar {
background: linear-gradient(180deg, rgba(42,4,126,1) 0%, rgba(77,4,126,1) 100%);
width: var(--sideBarWidth);
height: calc(100vh - var(--topBarHeight));
float: right;
}

.scrollableContent {
display: flex;
flex-direction: column;
background-color: var(--color2);
box-shadow: inset 0px 10px 20px 0px rgba(0,0,0,0.5);
border-radius: var(--standardRadius);
width: calc(100vw - var(--sideBarWidth));
height: calc(100vh - var(--topBarHeight));
float: left;
padding: calc( 2 * var(--subSectionPadding));
padding: calc( 4 * var(--subSectionPadding));
gap: calc( 4 * var(--subSectionPadding));
overflow: scroll;
}
106 changes: 106 additions & 0 deletions frontend/src/assets/css/default.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
@import url("variables.css");

/* ---- ---- Default Container ---- ---- */

.defaultContainer, .defaultButtonContainer, .defaultDropdownContainer {
width: calc(var(--sideBarWidth) - 2 * var(--subSectionPadding));
padding: calc(var(--subSectionPadding) * 0.5);
border-radius: var(--standardRadius);
background: var(--noAffordanceBackground);
}

/* ---- ---- Default Button and Default Dropdown ---- ---- */

.defaultButtonContainer, .defaultDropdownContainer {
transition-duration: 100ms;
margin-left: var(--subSectionPadding);
margin-bottom: var(--subSectionPadding);
overflow: hidden;
box-shadow: var(--noAffordanceShadow);
float: left;
}

.defaultButton {
transition-duration: 100ms;
width: 100%;
height: calc(var(--itemHeight) - var(--subSectionPadding));
border-radius: calc(var(--standardRadius) * 0.75);
background: var(--physicalAffordanceBackground);
box-shadow: var(--physicalAffordanceShadow);
color: var(--color2);
font-size: var(--standardFontSize);
}

.defaultButtonContainer:hover, .defaultDropdownContainer:hover {
transition-duration: 100ms;
padding: 0;
}

.defaultButtonContainer:hover {
box-shadow: var(--noAddordanceShadow_hover);
background: rgb(100, 100, 100);
}

.defaultButtonContainer:hover .defaultButton, .defaultDropdownContainer:hover .defaultButton {
transition-duration: 100ms;
background: var(--physicalAffordanceBackground_hover);
box-shadow: var(--physicalAffordanceShadow_hover);
border-radius: var(--standardRadius);
font-size: calc(var(--standardFontSize) + 1px);
height: var(--itemHeight);
}

/* ---- ---- Goal Bar ---- ---- */

.goalBarContainer, .goalDivider, .subGoalContainer {
height: calc((var(--topBarHeight) - 3 * var(--subSectionPadding)) * 0.5);
}

.goalBarContainer {
/* Origonal styling => w-full bg-gray-200 rounded-lg h-6 relative */
width: 100%;
background: rgb(211, 211, 211);
border-radius: var(--standardRadius);
position: relative;
}

.goalBarContainer {
padding: 3px;
background: var(--noAffordanceBackground);
box-shadow: var(--noAffordanceShadow);
}

.goalBar {
/* Origonal styling => bg-gradient-to-r from-blue-400 bg-primary h-full rounded-lg */
height: 100%;
border-radius: var(--standardRadius);
border-top: 2px;
background: var(--visualAffordanceBackground);
box-shadow: var(--visualAffordanceShadow);
}

.goalDivider {
/* Origonal styling => absolute border-l border-gray-400 */
position: absolute;
border: 1px solid rgba(255, 255, 255, 0.3);
top: 0;
}

.subGoalContainer {
/* Origonal styling => absolute w-full flex justify-between -top-6 */
position: absolute;
width: 100%;
display: flex;
justify-content: space-between;
top: calc((var(--topBarHeight) - var(--subSectionPadding)) * 0.5);
}

/* Origonal styling => {`absolute left-1/2 transform -translate-x-1/2 text-xs
${Number(balance) >= Number(subgoal) ? "text-green-700 border-green-500" : "text-gray-300 border-gray-300"}
border rounded px-1`} */

.subGoal, .subGoalCompleted {
text-align: center;
width: 0;
position: relative;
}
22 changes: 0 additions & 22 deletions frontend/src/assets/css/defaultButton.css

This file was deleted.

45 changes: 14 additions & 31 deletions frontend/src/assets/css/savingsTracker.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,30 @@

.trackerContainer {
position: absolute;
width: calc(100vw - 2 * var(--sideBarWidth) - 2 * var(--subSectionPadding));
right: var(--sideBarWidth);
width: calc(100vw - 2 * var(--sideBarWidth) - 2 * var(--subSectionPadding) - 10vw);
right: calc(var(--sideBarWidth) + 5vw);
height: calc(var(--topBarHeight) - 2 * var(--subSectionPadding));
margin-top: var(--subSectionPadding);
margin-left: var(--subSectionPadding);
float: left;
}

.trackerTextContainer, .progressBarContainer {
.balanceCounterContainer {
display: flex;
justify-content: center;
position: absolute;
left: 0;
height: calc((var(--topBarHeight) - 3 * var(--subSectionPadding)) * 0.5);
top: 0;
left: 0;
width: 100%;
height: 100%;
}

.trackerTextContainer {
display: flex;
justify-content: center;
align-items: center;
}

.trackerText {
.balanceCounter {
padding-left: var(--subSectionPadding);
padding-right: var(--subSectionPadding);
width: fit-content;
height: calc(100% - var);
background-color: rgba(255, 255, 255, 0.5);
text-align: center;
color: var(--color2);
z-index: 2;
}

.progressBarContainer {
box-sizing: border-box;
border-width: 2px;
border-color: var(--color1);
border-radius: var(--standardRadius);
overflow: hidden;
}

.progressBar {
position: absolute;
height: 100%;
left: 0;
top: 0;
background-color: var(--color1);
z-index: 1;
font-size: 0.75rem;
}
14 changes: 14 additions & 0 deletions frontend/src/assets/css/transactions.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@import url("variables.css");

.transactionLog {
display: flex;
justify-content: space-between;
flex-direction: column;
align-items: center;
border: solid 4px var(--color3);
border-radius: var(--standardRadius);
}

.transaction {

}
26 changes: 21 additions & 5 deletions frontend/src/assets/css/variables.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
:root {
--color1: black;
--color2: white;
--color1: rgb(50, 48, 50);
--color2: rgb(222, 218, 225);
--color3: rgb(9, 158, 106);
--topBarHeight: 64px;
--topBarBtnHeight: 32px;
--topBarBtnWidth: 64px;
--sideBarWidth: calc(16vw);
--subSectionPadding: 8px;
--itemHeight: 10vh;
--standardRadius: 10px
--standardRadius: 10px;
--standardFontSize: 16px;

--color1_gradientInner: rgb(40, 39, 40);
--color1_hover: rgb(54, 52, 54);
--color1_gradientInner_hover: rgb(44, 43, 44);

--noAffordanceBackground: var(--color2);
--noAffordanceShadow: inset 0px 2px 3px 0px rgba(0,0,0,0.5);
--noAddordanceShadow_hover: 0px 4px 4px 0px rgba(0,0,0,0.25);

--visualAffordanceBackground: linear-gradient(90deg, rgb(5, 87, 68), rgb(43, 177, 99));
--visualAffordanceShadow: inset -3px 3px 4px 2px rgba(200, 255, 184, 0.4);

--physicalAffordanceBackground: linear-gradient(var(--color1), var(--color1_gradientInner));
--physicalAffordanceShadow: inset 0px 1px 4px 1px rgba(153, 148, 155, 0.3);
--physicalAffordanceBackground_hover: linear-gradient(var(--color1_hover), var(--color1_gradientInner_hover));
--physicalAffordanceShadow_hover: inset 0px 1.5px 5px 1px rgba(153, 148, 155, 0.2);
}
Empty file.
1 change: 0 additions & 1 deletion frontend/src/components/Transaction.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const Transaction = ({ transaction }) => {

const handleCheckboxChange = (e) => {
handleSelect(transaction.id, e.target.checked);
console.log("clicked: ", transaction.id);
};
return (
<div className="flex flex-row justify-start text-body pl-[8x]">
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/components/default/DefaultButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import '../../assets/css/default.css';

export default function DefaultButton(props) {
return (
<div className="defaultButtonContainer">
<button className="defaultButton" onClick={props.onClick}>
{props.children}
</button>
</div>
);
}
9 changes: 0 additions & 9 deletions frontend/src/components/metrics/BalanceGraph.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,22 @@ export default function BalanceGraph() {
const parseDate = (dateString) => {
// Parse the date string
const date = new Date(dateString);
console.log(date)

// Create a new date object for the start of the year
const startOfYear = new Date(date.getFullYear(), 0, 0);
console.log(startOfYear)

// Calculate the difference in milliseconds
const diff = date - startOfYear;

// Convert milliseconds to days and return the day of the year
const oneDay = 1000 * 60 * 60 * 24;
const parseDate = Math.floor(diff / oneDay);
console.log(parseDate)

return parseDate;
}

useEffect(() => {

console.log(balance)
console.log(transactions)

let pastBalance = balance
const newBalanceData = transactions.reduce((acc, transaction) => {

Expand All @@ -67,9 +61,6 @@ export default function BalanceGraph() {
newBalanceData.push({x: 0, y: pastBalance})

setBalanceData(newBalanceData)

console.log(newBalanceData)

}, [balance, transactions])

return (
Expand Down
Loading