Projects

My two assignments

Both are finished and both are live at this same address.

ASSIGNMENT 1 — DONE

Five-page portfolio

Home, About, Services, Projects and Contact. Written in Notepad. All five pages link to style.css, so they share one design.

Built with: HTML and CSS

Go to Home
ASSIGNMENT 2 — DONE

Margin Notes bookshop

A bookshop selling six books. You can add a book to the cart, increase or decrease how many you want, remove a book, and see the total change. There is a checkout button that gives you an order number.

Built with: HTML, CSS and JavaScript

Go to the bookshop
The hard part

How the cart remembers things

When you add a book, the shop has to remember it. My first idea was to read the numbers off the screen whenever I needed them, but that quickly became confusing, because the screen and the real total kept disagreeing.

The answer was to keep one list in JavaScript, called cart, and treat it as the only truth. Nothing is ever read off the screen. When the list changes, I wipe the cart area and draw it again from the list. The screen is always just a picture of the list.

Unit Converter

Quick Unit Converter

Convert meters to kilometers and grams to kilograms.

Meter to Kilometer

Result will appear here.

Gram to Kilogram

Result will appear here.