Changelog

Every feature, fix and improvement to BrainHub — documented in detail.

5 releases 55+ features shipped Built for Zambian students GitHub
v4.1 Latest Minor

A focused quality-of-life update shipping a fully playable 100-question quiz system, a motivational quotes carousel, Supabase user accounts, service worker reliability improvements, critical JavaScript bug fixes, and multilingual support across every page.

New Features
Quiz System — 100 Questions — Fully rebuilt /pages/quizzes.html with 100 real academic questions across 5 categories: Biology, Chemistry, Mathematics, Physics, and General Knowledge (20 questions each). Features a category picker, animated progress bar, instant answer feedback with explanations, a streak counter that activates after 3 correct answers in a row, a final results screen with grade and emoji, and XP awards on correct answers and quiz completion.
Motivational Quotes Carousel — New homepage section featuring 100 curated motivational quotes about education, perseverance, and success. Auto-advances every 8 seconds with smooth fade and slide animation. Includes Previous/Next controls, animated dot indicators, and two custom BrainHub/Zambia-specific quotes. Designed to give users enough reading time before changing.
User Accounts — Supabase Auth — Full authentication system via src/supabase.js. Supports email/password sign-up and Google OAuth. User profiles, progress, bookmarks, and XP are synced to a PostgreSQL database (Supabase) on login and every 5 minutes. Includes a dedicated /welcome.html with sign-in, sign-up, password reset, and update password flows. Navbar dynamically shows Sign In or avatar based on session state.
Analytics Dashboard — New /pages/analytics.html showing study statistics, XP history, session data, and usage patterns for logged-in users.
Bug Fixes
Critical JS Crash Fixed — A broken regular expression in main.js at line 564 contained literal newline characters embedded inside a regex literal, causing a SyntaxError: Invalid regular expression that crashed JavaScript entirely on every page load. This prevented all cards, the weekly challenge, the chatbot, and all dynamic content from rendering. Fixed by replacing the regex with proper escape sequences (/\n\n/g).
Flashcard Flip Broken — The global transition: background-color, border-color, color rule added for theme switching was overriding .flashcard-inner's transform transition, causing the card to invert the question face rather than flip to the answer. Fixed by explicitly restoring transition: transform 0.55s cubic-bezier(...) on .flashcard-inner with !important and disabling conflicting transitions on .flashcard-front and .flashcard-back.
Weekly Challenge Not Showing — The challenge widget HTML is injected dynamically by initStudyChallenge(), but the IntersectionObserver in initScrollReveal() runs earlier and never observes the newly inserted element. The widget was stuck at opacity: 0 indefinitely. Fixed by removing the reveal class from the dynamically injected widget and forcing opacity: 1 immediately after injection.
AI Chatbot Not Opening — Side effect of the JS crash above. Once the regex fix was applied the chatbot resumed working normally.
AI Responses Cut Off Mid-Sentencemax_tokens in the Cloudflare Worker AI call was set to 1000, truncating longer explanations. Raised to 4000.
AI Chatbot Rendering Raw Markdown — The AI was returning responses with **bold**, ## headings, and --- table separators displayed as raw text. Fixed by updating the system prompt to instruct the model to respond in clean HTML only, and adding a renderChatContent() function that renders HTML directly with a markdown fallback converter.
Improvements
Service Worker Reliability — Bumped to brainhub-v4. JavaScript and CSS files now use a network-first strategy instead of cache-first, ensuring code changes always take effect immediately without requiring a hard refresh (Ctrl+Shift+R). HTML pages remain network-first with cache fallback. Images and fonts remain cache-first for performance.
v4.0 Major

The biggest BrainHub update yet. Introduces a full global search engine, a gamification system with XP and badges, a personal profile page, major dark mode improvements, accessibility upgrades, and performance optimisations across the board.

New Features
Bugs Fixes - Resolved several bugs and other known issues. Workspace-Fix
Global Search — Full-text search across all 30+ pages and resources at /pages/search.html. Supports live filtering by type (Courses, Notes, Past Papers, Flashcards, Pages), keyword highlighting, recent search history, popular shortcuts, and URL query params.
Gamification System — New gamification.js awards XP for page visits, opening resources, completing docs, sharing, searching and weekly challenges. Includes 6 levels (Freshman → BrainHub Pro) and 12 unlockable badges.
Live XP HUD — Floating heads-up display on every page showing current level, XP, streak, and progress to next level. Expandable to show full stats.
Profile Page — New /pages/profile.html with full XP breakdown, streak tracking, badge gallery (earned vs locked), level roadmap, XP activity log, and progress reset.
Study Streaks — Daily visit tracking with streak counter, max streak record, and +20 XP bonus for consecutive study days.
Testimonials Section — Fully designed student review section on the homepage with animated cards, star ratings, verified badges, gradient avatars, and a share CTA.
Improvements
Dark Mode Polish — Richer dark backgrounds for every component: navbar, hero, cards, doc viewer, chat window, timer, bottom nav, HUD, and more. Custom dark scrollbar styling.
Mobile UX — Tap targets upgraded to ≥44px (Apple/Google standard). Cards stack better on small screens. Breadcrumbs scroll horizontally. Toast repositioned to bottom-centre on mobile.
Accessibility — Skip-to-content link added. Focus rings visible on keyboard navigation, hidden for mouse users. prefers-reduced-motion support disables all animations for users who need it.
Mobile Bottom Nav — Updated with Search and Profile tabs replacing the old AI Tutor slot. Active state highlighting improved.
Performance
Layout containment — Added contain: layout style to cards and result items to reduce repaint scope and improve scroll performance.
GPU accelerationwill-change: transform, opacity added to animated elements. Automatically removed after animation completes to free GPU memory.
Skeleton loaders — Shimmer placeholder CSS ready for dynamic content areas so pages feel fast while loading.
Design
Progress bar animation — Reading progress bar now has a moving gradient shimmer effect.
Page fade-in — Smooth fade and slide-up entrance animation on every page load.
Card hover refinement — Lift effect increased to 6px with stronger shadow on hover. Bottom accent line animates in from left on hover.
Navbar blur — Frosted glass blur (backdrop-filter: blur(12px)) added to navbar background.
v3.0 Minor

Professional and standout features — mobile bottom navigation, keyboard shortcuts, weekly study challenge, resource suggestion, completion certificates, and "students also viewed" recommendations.

New Features
Mobile Bottom Navigation — Fixed bottom nav bar for mobile users with Home, Study, Cards, Quizzes, and AI Tutor quick access. Active page highlighted automatically.
Keyboard Shortcuts — Full shortcut system: K search, T theme, C chat, P timer, ? shortcuts panel, G+H/U/F/Q navigate, Esc close all.
Weekly Study Challenge — Rotating weekly quiz with 5 questions covering all Natural Sciences courses, countdown timer to next reset, and streak tracking.
Course Completion Certificates — Auto-triggered when all resources in a course are marked done. Canvas-drawn certificate with student name, course, date, and BrainHub seal, downloadable as PNG.
Suggest a Resource — Students can submit resource suggestions per course. Submits to Formspree with course and university pre-filled.
Students Also Viewed — Related course recommendations shown on notes pages, data-driven from JSON attributes on the container element.
v2.0 Minor

Major feature expansion adding AI tutoring, PDF viewing, PWA support, SEO, progress tracking, bookmarks, social sharing, newsletter, and a 404 page.

New Features
AI Tutor Chatbot — Context-aware AI assistant powered by the Claude API (via Cloudflare Worker proxy), with course context from page meta tags, typing animation, and conversation history.
In-Browser PDF Viewer — Documents open in a modal overlay using Google Docs viewer. Includes download, share, and close actions.
Progress Tracker — Mark individual resources as done. Progress bar and completion percentage shown per course. State persisted in localStorage.
Bookmarks — Save any document or page to a bookmark panel, accessible from any page. State persisted in localStorage.
PWA Supportmanifest.json, service worker with cache-first strategy, offline fallback, install prompt banner. BrainHub is installable on Android and desktop.
Social Sharing — Share any page to WhatsApp, Twitter, Facebook, or copy link. Available on all doc pages and the homepage.
Newsletter Signup — Email subscription form integrated with Formspree, with local deduplication and success message.
Full SEO — Open Graph, Twitter Card, JSON-LD structured data, sitemap.xml, robots.txt, canonical URLs added to all pages.
v1.0 Initial

Initial public launch of BrainHub. A free, no-login university study platform for Zambian students, starting with CBU Natural Sciences resources.

Initial Release
University Resources — BIO110 Biology notes and resources for CBU Natural Sciences. Document viewer with PDF download support.
Flashcards — Interactive flip-card study tool with 5 topic decks: Geography, Science, Mathematics, History, and General Knowledge.
Pomodoro Timer — Built-in 25-minute study timer with pause, reset, and session counter. Accessible from every page via the footer toggle.
Dark / Light Mode — System preference detection with manual toggle. Theme persisted to localStorage.
Responsive Design — Mobile-first layout with hamburger nav, flexible grids, and optimised touch targets.
Scroll Animations — IntersectionObserver-based reveal animations on all cards and sections. Reading progress bar at top of page.
Pages — About, Contact (Formspree), Privacy Policy, Terms & Conditions, Universities browser with search.

🚀 What's coming next

Features currently in development or planned for future releases.

More universities (UNZA, MU) More course content Study groups Push notifications Discussion threads per document Full profile dashboard with real Supabase data