Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Shuffle showcase books on login page
This commit refactors the ShowcaseBooks component on the login page to shuffle the order of the books displayed. Instead of using the original order from the API response, the books are now randomly shuffled using the Fisher-Yates algorithm. This provides a more dynamic and engaging experience for users. The code changes include: - Updating the v-for loop in the template to use the shuffledShowcase array instead of the original showcase.getShowcase array. - Adding a new ref variable, shuffledShowcase, to store the shuffled array of books. - Implementing the shuffleArray function to shuffle the array using the Fisher-Yates algorithm. - Adding the secureRandom function to generate secure random numbers for shuffling. These changes improve the user experience by presenting a different order of books each time the login page is loaded, making it more visually appealing and interesting.
- Loading branch information