PageSourceSearch

https://gb-carbon-intensity.netlify.app/static.js

js gb-carbon-intensity.netlify.app collected 2026-10-03 10:49:17 UTC 4,761 bytes, 119 lines download raw bytes

1export const regions = {
2  1: "North Scotland",
3  2: "South Scotland",
4  3: "North West England",
5  4: "North East England",
6  5: "Yorkshire",
7  6: "North Wales",
8  7: "South Wales",
9  8: "West Midlands",
10  9: "East Midlands",
11  10: "East England",
12  11: "South West England",
13  12: "South England",
14  13: "London",
15  14: "South East England",
16  N: "National",
17  15: "England",
18  16: "Scotland",
19  17: "Wales",
20};
21
22export const fuelIcons = {
23  Biomass: `<img src="./icons/bio4.svg" alt="biomass" />`,
24  Coal: `<img src="./icons/coal.svg" alt="coal">`,
25  Imports: `<img src="./icons/import2.svg" alt="imports">`,
26  Gas: `<img src="./icons/flame.svg" alt="gas" />`,
27  Nuclear: `<img src="./icons/nuclear2.svg" alt="nuclear" />`,
28  Other: `<img src="./icons/other2.svg" alt="other" />`,
29  Hydro: `<img src="./icons/hydro.svg" alt="hydro" />`,
30  Solar: `<img src="./icons/sun3.svg" alt="solar" />`,
31  Wind: `<img src="./icons/wind.svg" alt="wind" />`,
32};
33
34export const intensityIcons = {
35  "very high": ` <svg width="50" height="50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">
36                    <path d="M 25 10 L 40 30 L 35 30 L 35 42 L 25 42 L 25 50 L 25 42 L 15 42 L 15 30 L 10 30 L 25 10 Z" fill="red"/>
37                  </svg>
38
39                  <svg width="50" height="50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">
40                      <path d="M 25 10 L 40 30 L 35 30 L 35 42 L 25 42 L 25 50 L 25 42 L 15 42 L 15 30 L 10 30 L 25 10 Z" fill="red"/>
41                  </svg>`,
42
43  high: `<svg width="50" height="50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">
44            <path d="M 25 10 L 40 30 L 35 30 L 35 42 L 25 42 L 25 50 L 25 42 L 15 42 L 15 30 L 10 30 L 25 10 Z" fill="red"/>
45        </svg>`,
46
47  moderate: `<svg xmlns="http://www.w3.org/2000/svg" width="30" height="6" viewBox="0 0 30 6">
48                <rect x="0" y="0" width="30" height="6" fill="#FFBF00"/>
49              </svg>`,
50
51  low: `<svg width="50" height="50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">
52            <path d="M 25 40 L 40 20 L 35 20 L 35 10 L 15 10 L 15 20 L 10 20 L 25 40 Z" fill="green"/>
53        </svg>`,
54
55  "very low": `<svg width="50" height="50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">
56                    <path d="M 25 40 L 40 20 L 35 20 L 35 10 L 15 10 L 15 20 L 10 20 L 25 40 Z" fill="green"/>
57                </svg>
58
59                <svg width="50" height="50" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">
60                    <path d="M 25 40 L 40 20 L 35 20 L 35 10 L 15 10 L 15 20 L 10 20 L 25 40 Z" fill="green"/>
61                </svg>`,
62};
63
64// set a variable with the API URL for POSTCODES
65export const POSTCODE_API_URL = `https://api.carbonintensity.org.uk/regional/postcode/{postcode}`;
66
67// set a regional API URL
68export const REGIONAL_API_URL = `https://api.carbonintensity.org.uk/regional/regionid/{regionid}`;
69
70// set a national API URL for intensity
71export const NATIONAL_API_URL_INTENSITY = `https://api.carbonintensity.org.uk/intensity`;
72
73export const PLACEHOLDER = `check`;
74
75// set a national API URL for generation mix
76export const NATIONAL_API_URL_GENERATION = `https://api.carbonintensity.org.uk/generation`;
77
78// set the geocoding API
79export const GEOCODING_API_URL = `https://geocode.maps.co/search?q={address}`;
80
81export const GEO_TO_POSTCODE_API_URL = `https://api.postcodes.io/postcodes?lon={longitude}&lat={latitude}`;
82
83// validate UK postcode
84export const UK_POSTCODE_VALIDATOR =
85  "https://api.postcodes.io/postcodes/{postcode}";
86
87// select the html element(s)
88export const container = document.getElementById("container");
89
90// geolocation button
91export const geolocationButton = document.getElementById("geolocationButton");
92
93// selecting a select tag in html
94export const regionDropDown = document.getElementById("regionsList");
95
96// selecting the compare button in html
97export const compareButton = document.getElementById("compareButton");
98
99// selecting clear button from html
100export const clearButton = document.getElementById("clearButton");
101
102// selecting error message element
103export const errorMessage = document.getElementById("errorMessage");
104
105// select html element input box
106export const inputBox = document.getElementById("inputBox");
107
108// select html element input box
109export const spinner = document.getElementById("spinner");
110
111// select sort dropdown
112export const sortList = document.getElementById("sort");
113
114// error texts
115export const errorText = [
116  "Please enter a valid area name or postcode in Britain.",
117  "Something has gone wrong. Apologies for the inconvenience.",
118  "Please select a valid UK region to compare.",
119];

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.