diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7ed615e --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +# OS files +.DS_Store +Thumbs.db + +# Editor files +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# Temporary files +*.tmp +*.log +/tmp/ + +# Python +__pycache__/ +*.pyc + +# Node (if added later) +node_modules/ +package-lock.json + +# Build artifacts (if added later) +dist/ +build/ diff --git a/AI_HANDOFF.md b/AI_HANDOFF.md new file mode 100644 index 0000000..b55cef1 --- /dev/null +++ b/AI_HANDOFF.md @@ -0,0 +1,311 @@ +# AI Handoff Documentation + +**Project:** Bookstore / Library Layout +**Date:** 2026-01-23 +**Repository:** CaptainFredric/Bookstore +**Status:** Production Ready + +## Quick Start for AI Agents + +This is a **single-page HTML + CSS + vanilla JavaScript** bookstore catalog website. No build process, no dependencies, no frameworks. + +### Primary Files +- **Books.html** — Main application (638 lines) + - Complete page structure (header, hero, sections, footer) + - Inline JavaScript for all interactivity + - Book data array at the end of the file + - All rendering, filtering, sorting logic + +- **styles.css** — All styling (814 lines) + - CSS custom properties for theming + - Responsive layout + - Component styles (cards, buttons, forms, footer) + - Motion-safe animations + +- **index.html** — GitHub Pages entrypoint (19 lines) + - Redirects to Books.html + - Preserves hash navigation + +### Supporting Files +- **.nojekyll** — Prevents Jekyll processing on GitHub Pages +- **.gitignore** — Standard ignores for OS, editor, and build artifacts +- **README.md** — User-facing project overview +- **DAN_DEBUGGER_PROJECT_REVIEW.md** — Comprehensive technical review +- **DEPLOYMENT.md** — Deployment instructions (GitHub Pages, Netlify, Vercel) +- **SESSION_NOTES_2026-01-23.md** — Session changelog and quick reference + +## Architecture Overview + +### Data Model +All book data is stored in the `books` array in Books.html (around line 300-600): +```javascript +const books = [ + { + title: "Book Title", + author: "Author Name", + genre: "Genre", + format: "Hardcover|Paperback|Ebook|Audiobook", + isbn13: "9781234567890", + rating: 4.5, + year: 2024, + featured: true|false, + listPriceUsd: 29.99, // optional + priceUsd: 24.99 // optional + }, + // ... more books +] +``` + +### Key Functions (all in Books.html) +- `renderBooks()` — Main rendering function, generates book cards +- `renderStats()` — Updates statistics (total books, average rating) +- `applyFilters()` — Filters books by search, genre, format +- `sortBooks()` — Sorts by featured, rating, price, title +- `bindControls()` — Wires up all event listeners +- `coverUrlFromIsbn()` — Generates Open Library cover URL +- `openLibraryUrlFromIsbn()` — Generates Open Library details URL + +### External Dependencies +**None.** This is intentional for portability. + +However, the project relies on: +- **Open Library API** for book covers: `https://covers.openlibrary.org/b/isbn/{ISBN}-M.jpg` +- **Open Library details** for book links: `https://openlibrary.org/isbn/{ISBN}` + +If Open Library is down, covers will fail gracefully (alt text shown). + +## How to Make Changes + +### Add a Book +1. Open **Books.html** +2. Find the `books` array (around line 300-600) +3. Add a new object with required fields: `title`, `author`, `genre`, `format`, `isbn13`, `rating`, `year` +4. Optional: add `featured`, `listPriceUsd`, `priceUsd` +5. Save and open Books.html in a browser + +### Change the Theme +1. Open **styles.css** +2. Find the `:root` section (lines 1-20) +3. Modify CSS custom properties: + - `--bg` (background) + - `--surface` (card background) + - `--text` (text color) + - `--primary` (brand color) + - etc. + +### Add a New Section +1. Open **Books.html** +2. Add a new `
` inside `
` +3. Add corresponding styles in **styles.css** +4. Add navigation link in the header if needed + +### Modify Filtering/Sorting Logic +1. All logic is in the `