QuantEcon / QuantEcon/quantecon-book-theme

ENH: Add sticky lecture series title to navbar on scroll

Open
#332 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Jupyter Notebook
Stars
56
Forks
24
Avg merge
4h 33m
Merged PRs (30d)
4

Description

Feature Request

Add a dynamic lecture series title to the top navbar that appears when the user scrolls past the page header, maintaining context for readers navigating long pages.

Behavior

  • Trigger: When the lecture series heading in the page header scrolls out of view
  • Display: Show the series title in the center of the top navbar
  • Animation: Fade in/out transition for smooth appearance
  • Responsive: Only active on desktop/tablet screens (disable on mobile due to space constraints)

Implementation Details

Technical Approach
  1. JavaScript: Use Intersection Observer API to detect when page header is visible/hidden
  2. Dynamic Content: Inject/show series title in navbar based on scroll position
  3. CSS: Add fade transitions and center positioning for navbar title
  4. Responsive: Use media queries to disable on mobile screens
Navbar Integration
  • Placement: Center of navbar
  • Styling: Match existing navbar style and typography
  • Space Management: Ensure it doesn't conflict with logo, search, or action buttons
Files to Modify
  • src/quantecon_book_theme/assets/scripts/index.js - Add scroll detection logic
  • src/quantecon_book_theme/theme/quantecon_book_theme/layout.html - Add navbar title container
  • src/quantecon_book_theme/assets/styles/index.scss - Add styling for dynamic title

Benefits

  • Improved navigation context for long-form content
  • Better user experience when scrolling through lectures
  • Maintains visual connection to lecture series while reading

Related

  • Part of ongoing header improvements from #328
  • Complements git metadata features from #331

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read src/quantecon_book_theme/assets/scripts/index.js, src/quantecon_book_theme/theme/quantecon_book_theme/layout.html, and src/quantecon_book_theme/assets/styles/index.scss. Start by tracing the existing navbar and page-header structure, then verify the title appears only after the heading leaves view, fades smoothly, remains centered without conflicts, and is disabled on mobile.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript, scss
Domain
frontend, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.