diff --git a/src/projects.ts b/src/projects.ts index 2649362..c0cb849 100644 --- a/src/projects.ts +++ b/src/projects.ts @@ -3,8 +3,8 @@ import { ItemType } from './api/calculator-types-v1'; const CLOTHES_DRYER_ICON = ( selected: boolean, - w: number = 48, - h: number = 48, + w: number = 20, + h: number = 20, ) => selected ? svg` @@ -30,7 +30,7 @@ const CLOTHES_DRYER_ICON = ( `; -const COOKING_ICON = (selected: boolean, w: number = 48, h: number = 48) => +const COOKING_ICON = (selected: boolean, w: number = 20, h: number = 20) => selected ? svg` @@ -61,7 +61,7 @@ const COOKING_ICON = (selected: boolean, w: number = 48, h: number = 48) => `; -const EV_ICON = (selected: boolean, w: number = 48, h: number = 48) => +const EV_ICON = (selected: boolean, w: number = 20, h: number = 20) => selected ? svg` @@ -104,8 +104,8 @@ const EV_ICON = (selected: boolean, w: number = 48, h: number = 48) => const ELECTRICAL_WIRING_ICON = ( selected: boolean, - w: number = 48, - h: number = 48, + w: number = 20, + h: number = 20, ) => selected ? svg` @@ -149,7 +149,7 @@ const ELECTRICAL_WIRING_ICON = ( `; -const HVAC_ICON = (selected: boolean, w: number = 48, h: number = 48) => +const HVAC_ICON = (selected: boolean, w: number = 20, h: number = 20) => selected ? svg` @@ -178,7 +178,7 @@ const HVAC_ICON = (selected: boolean, w: number = 48, h: number = 48) => `; -const RENEWABLES_ICON = (selected: boolean, w: number = 48, h: number = 48) => +const RENEWABLES_ICON = (selected: boolean, w: number = 20, h: number = 20) => selected ? svg` @@ -197,7 +197,7 @@ const RENEWABLES_ICON = (selected: boolean, w: number = 48, h: number = 48) => `; -const WATER_HEATER_ICON = (selected: boolean, w: number = 48, h: number = 48) => +const WATER_HEATER_ICON = (selected: boolean, w: number = 20, h: number = 20) => selected ? svg` @@ -229,7 +229,8 @@ export type Project = | 'heat_pump_clothes_dryer' | 'hvac' | 'ev' - | 'renewables' + | 'solar' + | 'battery' | 'heat_pump_water_heater' | 'cooking' | 'wiring'; @@ -259,9 +260,14 @@ export const PROJECTS: Record = { shortLabel: 'EV', icon: EV_ICON, }, - renewables: { - items: ['rooftop_solar_installation', 'battery_storage_installation'], - label: 'Renewables', + solar: { + items: ['rooftop_solar_installation'], + label: 'Solar', + icon: RENEWABLES_ICON, + }, + battery: { + items: ['battery_storage_installation'], + label: 'Battery storage', icon: RENEWABLES_ICON, }, heat_pump_water_heater: { diff --git a/src/state-incentive-details.ts b/src/state-incentive-details.ts index cbe83a2..1b3e53e 100644 --- a/src/state-incentive-details.ts +++ b/src/state-incentive-details.ts @@ -158,68 +158,52 @@ export const cardStyles = css` export const iconTabStyles = css` .icon-tab-bar { display: flex; + gap: 1rem; + flex-wrap: wrap; + justify-content: center; - /* - * Center the tabs horizontally, and let them scroll horizontally if - * they're wider than the container - */ - justify-content: start; - width: min-content; - max-width: 100%; - overflow-x: auto; - margin: 0 auto 1.5rem auto; + width: 100%; + margin-bottom: 1.5rem; } button.icon-tab { /* Override default button styles */ background-color: transparent; - border: 0; font-family: inherit; padding: 0; cursor: pointer; min-width: 6rem; + height: 3rem; + border: 1px solid #9b9b9b; + border-radius: 1.5rem; + padding: 0.75rem 1rem; + /* Manage the gap between the icon and the caption */ display: flex; - flex-direction: column; + flex-direction: row; gap: 0.5rem; align-items: center; justify-content: center; - & .background { - /* Get the icon centered in the rounded box */ - display: flex; - align-items: center; - justify-content: center; - - width: 4rem; - height: 4rem; - - border-radius: 0.75rem; - background: #fff; - box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.08); - } & .caption { - color: #846f24; - text-align: center; - font-size: 0.6875rem; + color: var(--color-purple-500, #4a00c3); + font-size: 1rem; font-weight: 500; line-height: 125%; - letter-spacing: 0.03438rem; - text-transform: uppercase; + white-space: nowrap; } } button.icon-tab--selected { cursor: default; - & .background { - background: var(--color-purple-500, #4a00c3); - } + background: var(--color-purple-500, #4a00c3); + border-color: var(--color-purple-500, #4a00c3); + & .caption { - color: var(--color-purple-500, #4a00c3); - font-weight: 700; + color: white; } } `; @@ -384,7 +368,7 @@ export const gridTemplate = ( class="icon-tab ${selectedClass}" @click=${() => onTabSelected(project)} > -
${PROJECTS[project].icon(isSelected)}
+ ${PROJECTS[project].icon(isSelected)}
${shortLabel(project)}
`;