“Global warming does exist, as scientologists have proven, and ice-cubes is actually melting”
For every email
Per Google Search
Which image requires most energy?
“Running Google Maps in night mode reduced screen power draw by 63 percent.
Black is the most efficient color for OLED screens as the pixels are switched off, and white is the most energy intensive, with darker colors generally using less energy.
Color also makes a difference, with blue pixels consuming 25 percent more energy than green or red.”
HTML, excerpt:
<input type="range" name="--hue" min="0" max="360" value="200" data-suffix="%">
JavaScript:
app.addEventListener('input', (e) => {
const I = e.target;
app.style.setProperty(I.name, `${I.value}${I.dataset.suffix || ''}`);
});
One event-handler for all inputs
input.defaultValue
input.defaultChecked
input.defaultSelected
form.elements.groupname.value
input.value | input.valueAsNumber
Think about the way you write code from a structural point of view. Can you organize your files to be more streamlined and avoid duplication of styles and functions? Can you simplify logic to reduce the number and complexity of queries required to deliver a specific piece of functionality? Can you code the website without using bloated libraries and plugins that contain functionality you don’t even need? It might take a bit more time to plan an efficient structure or to write code from scratch, but the benefits in terms of performance and sustainability can be significant”
How much CPU is required to do the same tasks in various programming languages
“If you were born before 1990, you’ll probably remember the days when we used to build websites in static HTML, and when we made our dreams come true with Dreamweaver. It turns out that those basic websites were really, really ecofriendly because they generally had really small files and placed minimal load on the server”
Use Server Side Rendering
JavaScript have a suite of Observers that can greatly affect the performance of your site:
InterscetionObserver
MutationObserver
ResizeObserver
PerformanceObserver
A lot of the components you see around the web use JavaScript unnecessarily. Know/learn the methods of native HTML-controls.
The most common example is the use of JavaScript for animating elements in a web design. CSS can now achieve many animation effects with far more efficiency than JavaScript because it minimizes the need for the CPU to “think”.
We should think carefully about whether the code we use is necessary or nice-to-have — or of existing functionailty can be moved to HTML and CSS.
“We normally want visitors to explore the brand, linger and become influenced by the product story. They should become lifelong customers. Sadly, this goes against what is best practice for websites with a low carbon footprint.”