
Carbon Trigger is a lightweight browser extension designed to provide real-time carbon intensity data for electricity consumption in different regions. By utilizing the CO2 Signal API, this extension allows users to monitor carbon usage and fossil fuel percentage used in power generation for their selected region. The extension also visually represents the data with dynamic color changes, making it easier for users to assess the environmental impact of their energy consumption.
- Fetches real-time carbon intensity data from the CO2 Signal API
- Displays carbon usage (grams of CO2 emitted per kilowatt-hour)
- Shows fossil fuel percentage in the energy mix
- Dynamically changes text colors based on carbon intensity levels
- Stores user input (region and API key) for a personalized experience
- Provides an easy reset option to change region settings
- Clone the repository:
git clone https://github.com/HiT-T/Web-Carbon-Trigger.git
- Open Chrome and navigate to
chrome://extensions/
. - Enable "Developer mode" (toggle in the top-right corner).
- Click "Load unpacked" and select the dist folder.
- The extension will now be ready to use!
- Open the extension popup.
- Enter your region name and CO2 Signal API key.
- Click submit to fetch the latest carbon intensity data.
- The extension will display the region's carbon usage and fossil fuel percentage.
- Color-coded values help visualize environmental impact:
- Green (
#2AA364
): Low emissions - Yellow (
#F5EB4D
): Moderate emissions - Dark Red (
#9E4229
): High emissions - Brown (
#381D02
): Very high emissions
- Green (
- Click "Change Region" to update your settings.
- JavaScript: Handles API requests and DOM manipulation.
- Axios: Fetches data from the CO2 Signal API.
- Chrome Extension APIs: Manages local storage and icon updates.
- HTML & CSS: Structures and styles the user interface.
index.html
: Main UI layoutindex.js
: Handles form submissions, API calls, and UI updatesstyles.css
: Defines styles for the extension UImanifest.json
: Chrome extension configuration
To use this extension, you need an API key from CO2 Signal. Sign up for an account and retrieve your key from their developer portal.
This project is open-source and available under the MIT License.
- Developed following the Web-Dev-For-Beginners curriculum by Microsoft.
- Special thanks to the open-source community for assets and resources.