Skip to content

feat: Add instant topic filtering for facts (fixes #116)#119

Open
umamanipraharshitha wants to merge 2 commits intominhaj-313:mainfrom
umamanipraharshitha:main
Open

feat: Add instant topic filtering for facts (fixes #116)#119
umamanipraharshitha wants to merge 2 commits intominhaj-313:mainfrom
umamanipraharshitha:main

Conversation

@umamanipraharshitha
Copy link
Copy Markdown

What this PR does

  • Implements instant topic filtering for facts using data attributes and JavaScript.
  • Adds data-topic attributes to each topic button.
  • Adds data-category attributes to every fact card (.wrapper).
  • Updates JavaScript to filter and display only the relevant facts when a topic button is clicked.
  • Removes the need for scrolling or using Previous/Next buttons to view facts from different topics.

Why

  • Fixes the issue where clicking a topic button did not filter facts, requiring users to scroll or use navigation buttons.
  • Significantly improves user experience by making topic selection seamless and intuitive.

How to test

  1. Click any topic button at the top of the homepage (e.g., Coding, Food, Science).
  2. Only facts from the selected topic should be displayed instantly.
  3. Navigation buttons are no longer needed for topic switching.

Related issue

Fixes #116

@umamanipraharshitha
Copy link
Copy Markdown
Author

Note: This replaces an earlier PR from my other account (@Praha289), which I have closed to keep all contributions under my main account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Topic Button Functionality to Display Relevant Facts Without Scrolling

1 participant