diff --git a/src/css/common.css b/src/css/common.css index 26127be..7af6839 100644 --- a/src/css/common.css +++ b/src/css/common.css @@ -21,7 +21,7 @@ font-size: 14px; /* spacing */ --header-height : 125px; - --sidebar-width: 250px; + --sidebar-width: 300px; } /* Button styling */ diff --git a/src/js/components/sidebar/sidebar.css b/src/js/components/sidebar/sidebar.css index ee0342b..976f051 100644 --- a/src/js/components/sidebar/sidebar.css +++ b/src/js/components/sidebar/sidebar.css @@ -54,4 +54,35 @@ h6 { .section-header { background-color: var(--mediumGray); +} + +.sidebar-stat-line { + display: flex; + align-items: center; + justify-content: space-between; /* Distribute space between children */ + padding: 2px; + border-bottom: 1px solid #ddd; +} + +.edit-icon { + color: var(--spiritgreen); + cursor: pointer; + font-size: 16px; /* Adjust the size as needed */ + margin-left: 10px; +} + +.edit-icon:hover { + color: var(--citygreen); +} + +.stat-label { + margin-right: auto; /* Push next elements to the right */ +} + +.stat { + margin-left: 5px; /* Optional: Add some space between currency and edit icon */ +} + +.sidebar-stat-line.fund-total .stat { + margin-right: 05px; /* 25px lines up with lines above (with edit symbol) */ } \ No newline at end of file diff --git a/src/js/components/sidebar/sidebar.js b/src/js/components/sidebar/sidebar.js index 4fbd8c2..03daa64 100644 --- a/src/js/components/sidebar/sidebar.js +++ b/src/js/components/sidebar/sidebar.js @@ -3,7 +3,7 @@ import { BaselineSection } from './subcomponents/baseline_section'; import SuppSection from './subcomponents/supp_section' -// Assuming you have a CSS variable --main-color defined on the :root +// fetch CSS variables saved in :root const root = document.documentElement; const sideBarWidth = getComputedStyle(root).getPropertyValue('--sidebar-width').trim(); @@ -33,12 +33,6 @@ function updateSidebarTitle(new_title){ document.getElementById('sidebar-title').textContent = new_title; } - -// function fetchStat(stat_id){ -// const stat = document.querySelector(`#${stat_id} .stat`); -// return parseFloat(stat.getAttribute('value')) || 0; -// } - function updateTotals(){ SuppSection.update(); BaselineSection.update(); diff --git a/src/js/components/sidebar/subcomponents/baseline_section.js b/src/js/components/sidebar/subcomponents/baseline_section.js index 4268048..52ad898 100644 --- a/src/js/components/sidebar/subcomponents/baseline_section.js +++ b/src/js/components/sidebar/subcomponents/baseline_section.js @@ -1,6 +1,8 @@ import { FISCAL_YEAR } from "../../../constants"; -import { Baseline, FundLookupTable, Fund } from "../../../models"; +import { Baseline, FundLookupTable, Fund, CurrentFund } from "../../../models"; import { formatCurrency } from "../../../utils/common_utils"; +import { visitPage } from "../../../views/view_logic"; + export const BaselineSection = { _data: new Baseline(), _genFund : new Fund(1000), @@ -44,25 +46,42 @@ export const BaselineSection = { return `
${FundLookupTable.getName(fund.fund)}

-