Skip to content

item & dots enhancements #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

prism2001
Copy link

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. an enableRandom 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 desired slideshowItems count. the final list of items is then shuffled and potentially sliced to match the configured slideshowItems

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. an `enableRandom` 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.

- **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 desired `slideshowItems` count. the final list of items is then shuffled and potentially sliced to match the configured `slideshowItems`
Copy link

This pull request has been marked as stale due to inactivity. It will be closed in 7 days unless there is activity.

@github-actions github-actions bot added the stale label Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant