Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Add Carbon Footprint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonitsi authored and Jonitsi committed Dec 8, 2023
1 parent 57b1f9f commit 73f27bd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export default function History(): ReactElement {
</div>
</>
)
}
}

Check failure on line 15 in src/pages/history.tsx

View workflow job for this annotation

GitHub Actions / Continuous Integration

Insert `⏎`
31 changes: 30 additions & 1 deletion src/pages/overview.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { ReactElement } from 'react'
import { ReactElement, useState } from 'react'

export default function Overview(): ReactElement {
const [isHovered, setIsHovered] = useState(false);

Check failure on line 4 in src/pages/overview.tsx

View workflow job for this annotation

GitHub Actions / Continuous Integration

Delete `;`
return (
<>
<h2 className="text-xl font-bold dark:text-slate-300">Overview</h2>

<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 mt-8 gap-16 ">
{/* Real-Time summary */}
<div className="flex flex-col gap-8 bg-white rounded-lg shadow p-7 dark:bg-slate-700 transition-all duration-500">
<div>
<h3 className="text-xl font-bold text-gray-800 dark:text-gray-200 mb-2">
Expand Down Expand Up @@ -77,6 +79,33 @@ export default function Overview(): ReactElement {
</div>
</div>
</div>

{/* Carbon Footprint */}
<div className="flex flex-col gap-8 bg-white rounded-lg shadow p-7 dark:bg-slate-700 transition-all duration-500">
<div>
<h2 className="text-xl font-bold text-gray-800 dark:text-gray-200 mb-2">
Carbon Footprint
</h2>
<div className="relative" onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}>

Check failure on line 89 in src/pages/overview.tsx

View workflow job for this annotation

GitHub Actions / Continuous Integration

Replace `··<div·className="relative"·onMouseEnter={()·=>·setIsHovered(true)}·onMouseLeave={()·=>·setIsHovered(false)}>` with `<div⏎··············className="relative"⏎··············onMouseEnter={()·=>·setIsHovered(true)}⏎··············onMouseLeave={()·=>·setIsHovered(false)}`
<button className="bg-sky-700 text-gray-800 px-4 py-2 rounded">More info</button>

Check failure on line 90 in src/pages/overview.tsx

View workflow job for this annotation

GitHub Actions / Continuous Integration

Replace `··············<button·className="bg-sky-700·text-gray-800·px-4·py-2·rounded">More·info` with `··········>⏎··············<button·className="bg-sky-700·text-gray-800·px-4·py-2·rounded">⏎················More·info⏎··············`
{isHovered && (

Check failure on line 91 in src/pages/overview.tsx

View workflow job for this annotation

GitHub Actions / Continuous Integration

Delete `··`
<div className="absolute bg-sky-700 text-gray-800 p-4 rounded shadow-md mt-2 dark:bg-white transition-all duration-500">

Check failure on line 92 in src/pages/overview.tsx

View workflow job for this annotation

GitHub Actions / Continuous Integration

Delete `··`
<p>A carbon footprint is a measurement of the various greenhouse gases, such as carbon dioxide (CO2), methane (CH4),

Check failure on line 93 in src/pages/overview.tsx

View workflow job for this annotation

GitHub Actions / Continuous Integration

Replace `··<p>A·carbon·footprint·is·a·measurement·of·the·various·greenhouse·gases,·such·as·carbon·dioxide·(CO2),·methane·(CH4),` with `<p>⏎····················A·carbon·footprint·is·a·measurement·of·the·various⏎····················greenhouse·gases,·such·as·carbon·dioxide·(CO2),·methane`
nitrous oxide (N2O), and others, caused by energy consumption. These gasses are combined into a common unit called carbon

Check failure on line 94 in src/pages/overview.tsx

View workflow job for this annotation

GitHub Actions / Continuous Integration

Replace `····nitrous·oxide·(N2O),·and·others,·caused·by·energy·consumption.·These·gasses·are·combined·into·a·common·unit·called·carbon` with `(CH4),·nitrous·oxide·(N2O),·and·others,·caused·by·energy⏎····················consumption.·These·gasses·are·combined·into·a·common·unit`
dioxide equivalent (CO2e), based on their global warming potential. The value for the carbon footprint is measured

Check failure on line 95 in src/pages/overview.tsx

View workflow job for this annotation

GitHub Actions / Continuous Integration

Replace `····dioxide·equivalent·(CO2e),·based·on·their·global·warming·potential.·The·value·for·the·carbon·footprint·is·measured·` with `called·carbon·dioxide·equivalent·(CO2e),·based·on·their⏎····················global·warming·potential.·The·value·for·the·carbon·footprint`
by: kW * 1h * 0.5kg CO2/kWh

Check failure on line 96 in src/pages/overview.tsx

View workflow job for this annotation

GitHub Actions / Continuous Integration

Replace `···` with `is·measured`
</p>
</div>
)}
</div>
<h4 className="text-lg text-gray-500 dark:text-slate-400 font-semibold">
Total Carbon Footprint
</h4>
<p className="mt-2 text-center text-5xl text-green-800 font-bold">
1kg CO2e
</p>
</div>
</div>
</div>
</>
)
Expand Down

0 comments on commit 73f27bd

Please sign in to comment.