Skip to content

Commit

Permalink
Mostly finish foodprints article
Browse files Browse the repository at this point in the history
  • Loading branch information
brodysmith1 committed Feb 17, 2024
1 parent c93b292 commit 0a31280
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 31 deletions.
3 changes: 2 additions & 1 deletion src/lib/components/Progress.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
export let min = 0
export let max = isPercent ? 1 : 100
export let errorBars: [number, number] | [] = []
export let valuePrecision = 0
export let delay = 0
export let duration = 400
Expand Down Expand Up @@ -44,7 +45,7 @@
>
{#if showValue}
<div class="progress-bar-value-label" class:visible={$width > 10}>
<Number {value} {delay} {duration} {easing} {isPercent} />
<Number {value} {delay} {duration} {easing} {isPercent} precision={valuePrecision} />
</div>
{/if}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/data/articles.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "Planet of the plates",
"slug": "overview",
"description": "Why do foods have different ‘foodprints’?",
"lede": "Your dining choices hold surprising power. Everyday meals make a global difference through the resources they demand."
"lede": "A food footprint is comprised of land use, water use and pollution, and greenhouse gas emissions. In this article, we break down those hidden costs across four major protein sources."
},
{
"title": "Vegans and climate carnivores",
Expand Down
3 changes: 3 additions & 0 deletions src/routes/learn/(posts)/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import ArticleMenu from "$lib/components/ArticleMenu.svelte"
import Tooltip from "$lib/components/Tooltip.svelte"
export let data
Expand All @@ -26,6 +27,8 @@
<ArticleMenu />
</section>

<Tooltip />

<style lang="sass">
article
Expand Down
37 changes: 20 additions & 17 deletions src/routes/learn/(posts)/diet-types/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
impact will be comparable to going vegan alone.
</p>

<figure id="diets-by-emissions" class="flex-col">
<figure id="diets-by-emissions">
<div>
<h2 class="figure-title text-xl">
Demand-side greenhouse gas mitigation potential of different diets
Expand All @@ -33,21 +33,23 @@
Measured in gigatonnes of CO<sub>2</sub> equivalents (GtCO<sub>2</sub>-eq) mitigated per year.
</h4>
</div>
{#each dietsByEmissions as diet, i}
<div class="diet-item flex-col">
<div class="bold">{diet.label}</div>
<div class="label">{diet.summary}</div>
<div class="progress-bar text-base">
<Progress
value={diet.value}
max={8}
showLabels={!i}
errorBars={diet.error}
showValue={false}
/>
<div class="diet-items flex-col">
{#each dietsByEmissions as diet, i}
<div class="diet-item flex-col">
<div class="bold">{diet.label}</div>
<div class="label">{diet.summary}</div>
<div class="progress-bar">
<Progress
value={diet.value}
max={8}
showLabels={!i}
errorBars={diet.error}
showValue={false}
/>
</div>
</div>
</div>
{/each}
{/each}
</div>
<figcaption class="label">
Adapted from the IPCC’s <a
href="https://www.ipcc.ch/srccl/chapter/chapter-5/5-5-mitigation-options-challenges-and-opportunities/5-5-2-demand-side-mitigation-options/5-5-2-1-mitigation-potential-of-different-diets/figure-5-12/"
Expand Down Expand Up @@ -86,9 +88,10 @@

<style lang="sass">
#diets-by-emissions
gap: 1rem
.diet-items
gap: 1rem
.progress-bar
font-size: 0.75rem
font-size: 0.875rem
margin-top: 0.25rem
</style>
138 changes: 127 additions & 11 deletions src/routes/learn/(posts)/overview/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,19 +1,135 @@
<script lang="ts">
import Progress from "$lib/components/Progress.svelte"
import { foodItems } from "$lib/data/foods"
import FoodprintBarChart from "./FoodprintBarChart.svelte"
const foods = foodItems.filter((o) => ["🐄", "🐓", "🫘", "🥜"].includes(o.emoji))
const charts = {
land: {
title: "Land use per 100 grams of protein",
subtitle: "Land measured in m<sup>2</sup>",
unit: "",
fv: (f: Food) => (100 * f.landPerKg) / f.proteinRatio
},
water: {
title: "Water use per 100 grams of protein",
subtitle: "Water measured in liters",
unit: "L",
fv: (f: Food) => (100 * f.waterPerKg) / f.proteinRatio
},
eutrophy: {
title: "Water eutrophy per 100 grams of protein",
subtitle: "Water measured in liters",
unit: "L",
fv: (f: Food) => (100 * f.eutrophyPerKg) / f.proteinRatio
},
emissions: {
title: "Emissions per 100 grams of protein",
subtitle: "Greenhouse gas emissions measured in kgCO<sub>2</sub>eq",
unit: "kgCO₂eq",
fv: (f: Food) => (100 * f.ghgPerKg) / f.proteinRatio
}
}
</script>

<div class="emoji-block flex-center text-2xl">
{#each foods as { emoji, name }}
<div class="flex-col">
<span>{emoji}</span>
<span class="label">{name}</span>
</div>
{/each}
</div>

<p class="label text-center">
(Peanuts are technically legumes, but for simplicity we group them together in the Nuts category)
</p>

<h2>Land use</h2>

<p>
Half the world's habitable land is used to feed humans. Beef (and other grazing animals) is a
highly inefficient converter of land to protein because of the vast area needed for grazing and
growing feed crops. It requires 30 times the land per gram of protein as poultry and nearly 20
times that of legumes.
</p>

<p>
This is important because clearing more forests to meet future demands could accelerate
biodiversity loss, degrade soil health, intensify flood/drought risk, and contribute to climate
change through carbon release.
</p>

<FoodprintBarChart {foods} {...charts.land} />

<hr class="spacer" />

<h2>Water use and water pollution</h2>

<p>
Food isn't just about taste; it's about impact. Our daily choices in the kitchen hold unexpected
power over the health of our planet. Agriculture, from field to table, comes with a climate cost.
Agriculture is responsible for 70% of global freshwater withdrawals and 78% of ocean and
freshwater pollution. Nuts are particularly thirsty: some almond varieties need about four liters
per nut! In water-stressed California, where 80% of the world's almonds are grown, this has
significant environmental and economic implications.
</p>

<p>
Animal agriculture, particularly beef and dairy, stands as a top offender. Herds emit vast
quantities of greenhouse gases, comparable to fleets of vehicles. It takes staggering amounts of
water to produce a single pound of beef – more than the average person uses for showering in a
week! Vast amounts of land go towards sustaining livestock, not people.
Beef is close behind, requiring more than the average person uses for showering in a week per 100g
of protein. In contrast, legumes are remarkably water efficient. Eating more water-efficient
proteins is important because water-intensive agriculture intensifies scarcity, diminishes healthy
rivers and lakes, and pollutes crucial waterways through fertilizer and pesticide runoff.
</p>

<FoodprintBarChart {foods} {...charts.water} />

<hr class="spacer" />

<h2>Greenhouse gas emissions</h2>

<p>
Agriculture accounts for a staggering 26% of global greenhouse gas emissions. Methane, with
roughly 80 times the global warming potential of CO2 over a 20-year period, underscores the
serious climate challenges posed by ruminants – methane-emitting animals like cattle and sheep.
</p>

<p>
What we eat is more important than where it's from. Emissions from transport, processing, and
packaging are often dwarfed by deforestation driven by agriculture, fertilizer use, methane
emissions, and food waste. Across most foods – both plant and animal – these factors typically
account for over 50% of total supply-chain emissions.
</p>

<FoodprintBarChart {foods} {...charts.emissions} />

<hr class="spacer" />

<h3>Conclusion</h3>

<p>
This isn't about eliminating choice, but about conscious consumption. Even switching out a few
meals a week for plant-based options makes a difference. Imagine your plate as a tool for change.
Opting for vibrant, plant-forward meals a few times a week transforms your plate into a tiny but
potent act of stewardship. Each thoughtfully chosen meal supports a more sustainable future for us
all.
Legumes are a valuable protein source, boasting the lowest emissions, water use, and land
requirements. Integrate more beans, lentils, and peas into your diet for a lower footprint! Nuts,
despite their water needs, hold advantages over animal proteins when it comes to land use and are
almost carbon-neutral. Although animal proteins underperform environmentally, the disparity
between poultry and beef is vast – the choice of meat is important.
</p>

<p class="bold">
To learn more about what to eat, read <a href="/learn/diet-types"
>Which diets are best for the planet?</a
>
</p>

<figure class="label">
<div><b>Sources</b></div>
<a href="https://ourworldindata.org/grapher/food-emissions-supply-chain" target="_blank"
>Greenhouse gas emissions across the food chain</a
> (Our World in Data)
</figure>

<style lang="sass">
.emoji-block
gap: 0.75rem
font-weight: bold
margin: 3rem auto
</style>
31 changes: 31 additions & 0 deletions src/routes/learn/(posts)/overview/FoodprintBarChart.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<script lang="ts">
import Progress from "$lib/components/Progress.svelte"
export let foods: Food[]
export let unit: string
export let title: string
export let subtitle: string
export let fv: (item: Food) => number
$: max = Math.ceil(Math.max(...foods.map(fv)))
</script>

<figure class="food-bar-chart">
<div>
<div class="figure-title">{@html title}</div>
<div class="figure-subtitle label">{@html subtitle}</div>
</div>
{#each foods.sort((a, b) => fv(b) - fv(a)) as food, i}
<div class="flex align-end" data-tooltip="{Math.round(fv(food))}&thinsp;{unit}">
<span class="food-bar-chart-label label bold">{food.emoji} {food.name}</span>
<div class="flex-grow">
<Progress value={Math.round(fv(food))} {max} showLabels={!i} showValue={false} />
</div>
</div>
{/each}
</figure>

<style lang="sass">
.food-bar-chart-label
min-width: 11ch
</style>
6 changes: 5 additions & 1 deletion src/styles/core/figure.sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ figure
background: var(--color-secondary-2)
border-radius: var(--border-radius)

+ p
+ p, + h2, + h3
margin-top: 2.5em

.figure-title
line-height: 1.25
font-size: 1.75rem
font-weight: bold
margin-bottom: 0.4em

.figure-subtitle
font-size: 1rem
margin-top: -0.25rem
margin-bottom: 1rem
9 changes: 9 additions & 0 deletions src/styles/core/layout.sass
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ main
max-width: 550px
min-height: 100vh
min-height: 100lvh

hr
margin: 3rem auto
border: none
border-top: 1px solid var(--color-secondary-3)

&.spacer
margin: 2rem auto
border-top: none
Binary file added static/brand/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0a31280

Please sign in to comment.