Skip to content
Ozone Lab — Interactive Ozone Layer Simulation
Back to Portfolio
Interactive Education2026Frontend Engineer

Ozone Lab — Interactive Ozone Layer Simulation

An interactive virtual lab where visitors damage and repair Earth's ozone layer and watch the chemistry, UV exposure and surface temperature respond in real time.

Next.jsReactTypeScriptTailwind CSSshadcn/uiRadix UIDockerJenkins
Overview

About This Project

Ozone Lab is an educational web experience about the stratospheric ozone layer. Visitors run a hands-on simulation, meet the chemicals responsible for depletion (CFCs, halons, nitrogen oxides), learn the consequences of a thinning layer, and see how the Montreal Protocol drove its recovery.
Challenge

The Problem

Atmospheric chemistry is abstract and hard to convey with static text. The simulation needed immediate cause-and-effect feedback, and the globe, controls, temperature readout and molecule views had to stay in sync so they never showed conflicting states.
Solution

How We Solved It

I modelled the simulation as a small typed domain module — five actions (factories, cars, planes, planting trees, reducing emissions), each with an ozone delta, a temperature delta and the real chemical reaction it represents. All state lives in one parent component and flows down to the controls, globe and readouts, so the views can't disagree. The globe is pure CSS and SVG: the ozone shell's opacity tracks the 0–10 level, UV rays break through below level 5, and land and polar caps react to heat or critical depletion. Toast alerts fire only when a threshold is crossed, not on every render.
Flow

How It Works

  1. 1

    Learn the basics

    The page opens with a hero and an About section that explains where the ozone layer sits in the atmosphere, what it absorbs and how it forms and breaks down.

  2. 2

    Pick a season

    The simulation starts at full ozone (10/10) in spring. Choosing a season resets the baseline temperature (winter 9°C to summer 25°C) and a toast confirms the change.

  3. 3

    Add harmful or beneficial actions

    Factories, cars and planes lower the ozone index and raise the temperature; planting trees and reducing emissions do the opposite. Values are clamped to 0–10 ozone and 0–50°C, and the ozone level can also be dragged with a slider.

  4. 4

    Watch the globe and chemistry react

    All state lives in one React component, so the globe, layer status (Healthy above 7, Damaged above 3, Critical otherwise), thermometer, ozone molecule colour and the reaction card for the last action update together. Toasts warn when the layer is destroyed or heating runs away.

  5. 5

    Meet the culprits

    Animated molecule diagrams for CFC-12, Halon-1301 and NO2 show each compound's structure and reaction chain, followed by the chlorine catalytic cycle that lets one atom destroy many ozone molecules.

  6. 6

    Consequences and recovery

    A timeline of UV, health, climate and crop effects leads into the Montreal Protocol, alternative technologies and monitoring, ending with a 1974–2023 recovery timeline. The simulation can be reset at any time.

Features

Key Capabilities

🌍

Live Ozone Simulation

Harmful and beneficial actions change ozone level and temperature, with Healthy, Damaged and Critical states.
🧪

Reaction Annotations

Each action shows the chemical reaction behind it, such as Cl· + O₃ → ClO· + O₂.
☀️

Season Model

A season picker sets baseline temperatures that combine with the user's actions.
⚛️

Molecule Diagrams

Animated SVG diagrams of O₃, CFC, halon and NOx molecules.
📖

Narrative Sections

Scroll-revealed sections on the culprits, the consequences and the path to recovery.
♿

Accessible Layout

Skip-to-content link, labelled controls and a responsive mobile navigation.
Gallery

Inside the Product

Landing heroEntry point of the virtual lab with key facts: layer altitude, share of UV-B absorbed, treaty parties and projected recovery year.
Simulation: critical stateAfter several harmful actions the ozone index hits 0/10: the globe glows red, the status turns Critical and a toast reports the layer as destroyed.
Simulation: damaged layerAdding factories drops ozone to 6/10 and raises the temperature; the reaction card shows the CFC photolysis and chlorine attack equations.
Simulation controlsDefault healthy state with the season picker, ozone slider and harmful and beneficial action buttons showing their ozone and temperature deltas.
Seasons and recoveryAfter repair actions the layer climbs back to 7/10; switching to winter lowers the baseline to 9°C and the status notes that cold air slows recovery.
Meet the CulpritsMolecule diagrams for CFC-12, Halon-1301 and nitrogen oxides, each with its formula, common source and reaction chain.
Chlorine catalytic cycleStep-by-step explanation of why a single chlorine atom can destroy around 100,000 ozone molecules.
What is the ozone layer?Explainer with an atmosphere-layer diagram highlighting the stratosphere and the ozone concentration peak.
Consequences of depletionTimeline of effects: more UV radiation, human health risks, shifted climate patterns and crop damage.
The path to recoveryCards on the Montreal Protocol, alternative refrigerants, global cooperation and ongoing monitoring, each with a key figure.
Technical

Under the Hood

Frontend
Next.js App Router with React 19, TypeScript, Tailwind CSS 4 and shadcn/ui (Radix) primitives, with Sonner for state-change notifications.
Simulation Model
A pure TypeScript module defines actions, seasons, clamped ranges and status thresholds, separate from the rendering components.
Rendering
Globe, ozone shell and UV rays drawn with CSS and SVG — no WebGL dependency — so the page stays light on any device.
Delivery
Multi-stage Docker image using Next.js standalone output and a non-root user, deployed to Kubernetes via Jenkins and Helm.
Results

Impact & Outcomes

Turned a textbook chemistry topic into a hands-on, cause-and-effect experience

Consistent globe, controls and readouts through a single source of state

Runs on modest hardware with no 3D engine required

Reflection

What I Learned

Educational interactives live or die by the feedback loop. Putting the rules in one small typed model before building any visuals made it easy to tune the behaviour and kept every view honest.

Other Projects