item & dots enhancements #45
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this PR enhances the slideshow functionality, specifically regarding how the items displayed in the slideshow are sourced, and how the pagination dots are generated and updated
configuration for slideshow items: a new configuration option:
slideshowitems
is introduced to specify the desired number of items to display on the homepage. anenableRandom
option is also added to control whether missing slots should be filled with random items from the server.dynamic pagination dots: the number of pagination dots is no longer fixed at 5. instead, it is dynamically determined based on the configured
slideshowItems
. the code now ensures that the correct number of dots is created.dot click functionality: event listeners are added to the pagination dots, allowing users to jump directly to a specific slide by clicking the corresponding dot. CSS rules have been added to accomodate for this. i mainly focused on desktop/web for the CSS changes. it works on mobile, but some mobile-specific rules might need to be added to account for the smaller screen space
improved dot updating: updateDots function refined to handle cases where there might be no dots, and to correctly determine the active dot index based on the total number of items being shown and the configured number of dots. it also includes an option to hide dots if the actual number of slideshow items is less than the configured number of dots.
flexible slideshow data loading: the loadSlideshowData function is significantly refactored to prioritize fetching item IDs from a local list.txt file. if the list is empty or doesn't provide enough items, and
enableRandom
is true, it will now fetch additional random item IDs from the server to meet the desiredslideshowItems
count. the final list of items is then shuffled and potentially sliced to match the configuredslideshowItems