StealThis .dev
Pages Hard

Cookbook — Weekly Meal Planner (drag recipes)

An editorial weekly meal planner where you drag recipe cards from a pantry tray into a 7-day grid of Breakfast, Lunch, and Dinner slots. Drop highlights, a fully keyboard-accessible pick-and-place alternative, per-day time and serving tallies, localStorage persistence, a clear-week reset, and a one-click shopping list that counts ingredients across the week. Warm cream surfaces, gradient food photos, and serif headings give it a real cookbook feel.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Weekly Meal Planner (drag recipes)

A two-pane cookbook planner. On the left, a sticky pantry tray holds recipe cards with gradient “photo” thumbnails, cook time, and serving counts. On the right, a seven-day by three-meal grid (Breakfast, Lunch, Dinner) waits for you to drag a card into any slot — drop targets light up in saffron as you hover, and each day’s header keeps a running tally of total cook time and servings.

Everything works without a mouse. Press Enter on a recipe card to pick it up, move to a slot, and press Enter again to place it; placed recipes can be picked up the same way to move them, and Delete clears a focused slot. An aria-live region narrates every pick, place, and removal. The whole week persists to localStorage, so a refresh keeps your plan.

Two header actions round it out: Clear week wipes the grid, and Generate shopping list opens a sheet that aggregates and counts every ingredient across your planned meals. The layout reflows from a side-by-side board into stacked, card-style day blocks under 720px, and hides the chrome for clean printing.

Illustrative UI only — recipes & nutrition data are fictional, not dietary advice.