QuantEcon / QuantEcon/quantecon-book-theme
ENH: Add sticky lecture series title to navbar on scroll
Open
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
- JavaScript: Use Intersection Observer API to detect when page header is visible/hidden
- Dynamic Content: Inject/show series title in navbar based on scroll position
- CSS: Add fade transitions and center positioning for navbar title
- 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 logicsrc/quantecon_book_theme/theme/quantecon_book_theme/layout.html- Add navbar title containersrc/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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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