-
Notifications
You must be signed in to change notification settings - Fork 0
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
Travel Information Slider #458
Conversation
custom JS for Travel Information SASS CSS
Warning CodeRabbit GitHub Action detectedThe repository is using both CodeRabbit Pro and CodeRabbit Open Source (via GitHub Actions), which is not recommended as it may lead to duplicate comments and extra noise. Please remove the CodeRabbit GitHub Action. Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
WalkthroughThis update brings a significant overhaul to the slider implementation, transitioning from CSS to SASS for improved layout and responsiveness. It also includes pattern matching enhancements in the registration class and updates to plugin metadata, marking the transition to version 2.0.0. Changes
Uplevel your code reviews with CodeRabbit ProCodeRabbit ProIf you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files selected (2)
- assets/css/scss/_slider.scss (1)
- assets/js/src/custom.js (2)
Review comments generated (6)
- Review: 3
- LGTM: 3
Tips
Chat with CodeRabbit Bot (@coderabbitai
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@coderabbitai
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
|
||
.slick-slide { | ||
padding: 0 !important; | ||
margin: 0 10px !important; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of !important
is generally discouraged in CSS as it increases the specificity of a rule, making it harder to override if needed. It's better to increase specificity in a more controlled way, such as by using more specific selectors or by structuring your CSS so that the most specific rules are declared last.
- .slick-slide {
- padding: 0 !important;
- margin: 0 10px !important;
- }
+ .wp-block-query.lsx-to-slider.travel-information .slick-slide {
+ padding: 0;
+ margin: 0 10px;
+ }
// First slider: .lsx-to-slider | ||
$( '.lsx-to-slider .wp-block-post-template:not(.slider-disabled)' ).each( function() { | ||
var $this = $( this ); | ||
|
||
|
||
lsx_to.pre_build_slider( $this ); | ||
|
||
if ( 1 < $this.children.length ) { | ||
|
||
|
||
if ( 1 < $this.children().length ) { | ||
$this.slick( { | ||
draggable: false, | ||
infinite: true, | ||
swipe: false, | ||
dots: false, | ||
slidesToShow: 3, // Show 3 items at a time | ||
slidesToScroll: 1, // Scroll 1 item at a time | ||
autoplay: false, | ||
autoplaySpeed: 0, | ||
appendArrows: $this.parent(), // Ensure arrows are appended correctly | ||
appendDots: $this.parent(), // Append dots in the right container | ||
responsive: [ | ||
{ | ||
breakpoint: 1028, | ||
settings: { | ||
slidesToShow: 2, | ||
slidesToScroll: 1, | ||
draggable: true, | ||
arrows: true, | ||
swipe: true, | ||
dots: true, | ||
} | ||
}, | ||
{ | ||
breakpoint: 782, | ||
settings: { | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
draggable: true, | ||
arrows: true, | ||
swipe: true, | ||
dots: true, | ||
} | ||
} | ||
] | ||
} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes made to the first slider look good. The addition of appendArrows
and appendDots
ensures that navigation arrows and dots are appended correctly, improving user interaction. The responsive settings have been updated to show different numbers of slides based on the screen size, which will enhance the user experience across various devices.
+ appendArrows: $this.parent(), // Ensure arrows are appended correctly
+ appendDots: $this.parent(), // Append dots in the right container
+ responsive: [
+ {
+ breakpoint: 1028,
+ settings: {
+ slidesToShow: 2,
+ slidesToScroll: 1,
+ draggable: true,
+ arrows: true,
+ swipe: true,
+ dots: true,
+ }
+ },
+ {
+ breakpoint: 782,
+ settings: {
+ slidesToShow: 1,
+ slidesToScroll: 1,
+ draggable: true,
+ arrows: true,
+ swipe: true,
+ dots: true,
+ }
+ }
+ ]
assets/js/src/custom.js
Outdated
// Second slider: .lsx-to-slider.travel-information | ||
$( '.lsx-to-slider .travel-information:not(.slider-disabled)' ).each( function() { | ||
var $this = $( this ); | ||
|
||
lsx_to.pre_build_slider( $this ); | ||
|
||
// Ensure the second slider has 4 slides showing | ||
if ( 1 < $this.children().length ) { | ||
$this.slick( { | ||
draggable: false, | ||
infinite: true, | ||
swipe: false, | ||
dots: false, | ||
slidesToShow: 3, | ||
slidesToScroll: 1, | ||
slidesToShow: 4, // Show 4 items at a time | ||
slidesToScroll: 1, // Scroll 1 item at a time | ||
autoplay: false, | ||
autoplaySpeed: 0, | ||
//appendArrows: $this.parent(), | ||
//appendDots: $this.parent(), | ||
appendArrows: $this.parent(), // Ensure arrows are appended correctly for this slider | ||
appendDots: $this.parent(), // Append dots in the correct place | ||
responsive: [ | ||
{ | ||
breakpoint: 1028, | ||
settings: { | ||
slidesToShow: 2, | ||
slidesToShow: 3, | ||
slidesToScroll: 1, | ||
draggable: true, | ||
arrows: false, | ||
arrows: true, | ||
swipe: true, | ||
dots: true, | ||
} | ||
}, | ||
{ | ||
breakpoint: 782, | ||
settings: { | ||
slidesToShow: 1, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
draggable: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes made to the second slider also look good. The number of slides shown at a time has been increased from 3 to 4, which aligns with the PR description. The responsive settings have been updated similarly to the first slider, ensuring a consistent user experience across different screen sizes.
+ slidesToShow: 4, // Show 4 items at a time
+ appendArrows: $this.parent(), // Ensure arrows are appended correctly for this slider
+ appendDots: $this.parent(), // Append dots in the correct place
+ responsive: [
+ {
+ breakpoint: 1028,
+ settings: {
+ slidesToShow: 3,
+ slidesToScroll: 1,
+ draggable: true,
+ arrows: true,
+ swipe: true,
+ dots: true,
+ }
+ },
+ {
+ breakpoint: 782,
+ settings: {
+ slidesToShow: 1,
+ slidesToScroll: 1,
+ draggable: true,
+ arrows: true,
+ swipe: true,
+ dots: true,
+ }
+ }
+ ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files selected (4)
- assets/css/scss/_slider.scss (1)
- assets/css/style.css (2)
- assets/js/src/custom.js (2)
- includes/classes/blocks/class-registration.php (2)
Review comments generated (10)
- Review: 5
- LGTM: 5
Tips
Chat with CodeRabbit Bot (@coderabbitai
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@coderabbitai
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
.slick-slide { | ||
padding: 0 !important; | ||
margin: 0 10px !important; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of !important
is generally discouraged in CSS as it breaks the natural cascading in your stylesheets. It's better to increase specificity of the selector or rethink your class structure instead.
- .slick-slide {
- padding: 0 !important;
- margin: 0 10px !important;
- }
+ .lsx-to-slider.travel-information .slick-slide {
+ padding: 0;
+ margin: 0 10px;
+ }
// Second slider: .lsx-to-slider.travel-information | ||
$( '.lsx-travel-information-wrapper.lsx-to-slider .travel-information:not(.slider-disabled)' ).each( function() { | ||
var $this = $( this ); | ||
|
||
lsx_to.pre_build_slider( $this ); | ||
|
||
// Ensure the second slider has 4 slides showing | ||
if ( 1 < $this.children().length ) { | ||
$this.slick( { | ||
draggable: false, | ||
infinite: true, | ||
swipe: false, | ||
dots: false, | ||
slidesToShow: 3, | ||
slidesToScroll: 1, | ||
slidesToShow: 4, // Show 4 items at a time | ||
slidesToScroll: 1, // Scroll 1 item at a time | ||
autoplay: false, | ||
autoplaySpeed: 0, | ||
//appendArrows: $this.parent(), | ||
//appendDots: $this.parent(), | ||
appendArrows: $this.parent(), // Ensure arrows are appended correctly for this slider | ||
appendDots: $this.parent(), // Append dots in the correct place | ||
responsive: [ | ||
{ | ||
breakpoint: 1028, | ||
settings: { | ||
slidesToShow: 2, | ||
slidesToShow: 3, | ||
slidesToScroll: 1, | ||
draggable: true, | ||
arrows: false, | ||
arrows: true, | ||
swipe: true, | ||
dots: true, | ||
} | ||
}, | ||
{ | ||
breakpoint: 782, | ||
settings: { | ||
slidesToShow: 1, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
draggable: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes made to the second slider, .lsx-to-slider.travel-information
, look good. The number of slides shown at different breakpoints has been updated according to the PR description. However, I noticed that the autoplaySpeed
is set to 0 which means the autoplay speed is essentially non-existent. If you want to disable autoplay, you should set autoplay: false
(which you've already done). But if you want autoplay to work, you should set autoplaySpeed
to a positive integer representing the delay between auto slides in milliseconds.
- autoplaySpeed: 0,
+ autoplaySpeed: 3000, // for example, change slides every 3 seconds
assets/css/style.css
Outdated
.lsx-to-slider.travel-information .slick-list { | ||
max-width: 100% !important; | ||
width: 100% !important; | ||
} | ||
.lsx-to-slider.travel-information .slick-slide { | ||
padding: 0 !important; | ||
margin: 0 10px !important; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of !important
is generally discouraged in CSS as it breaks the natural cascading in your stylesheets. It's better to increase specificity of the selector or refactor the code to avoid conflicts. However, if this is necessary due to third-party CSS that you can't control, then it's understandable.
- max-width: 100% !important;
- width: 100% !important;
+ max-width: 100%;
+ width: 100%;
- padding: 0 !important;
- margin: 0 10px !important;
+ padding: 0;
+ margin: 0 10px;
assets/css/style.css
Outdated
.wp-block-query.lsx-to-slider .slick-slide, | ||
.lsx-travel-information-wrapper.lsx-to-slider .slick-slide { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assets/css/style.css
Outdated
|
||
/* Styling for the label (e.g., "Special Interests:") */ | ||
.fast-facts-wrapper > .wp-block-group .wp-block-group:first-child p { | ||
margin: 0; | ||
white-space: nowrap; /* Prevent wrapping for label */ | ||
vertical-align: middle; /* Align text with the middle of the icon */ | ||
line-height: 1.2; /* Improve readability */ | ||
display: inline-block; /* Keep text inline */ | ||
} | ||
|
||
/* Styling for the flowing text */ | ||
.fast-facts-wrapper > .wp-block-group .wp-block-group:last-child { | ||
display: flex; | ||
flex-wrap: nowrap; /* Keep the text flowing inline */ | ||
white-space: normal; /* Allow wrapping for text if it overflows */ | ||
overflow-wrap: break-word; /* Ensure long words wrap correctly */ | ||
word-break: break-word; /* Break long words when needed */ | ||
flex: 1; /* Allow the container to use available space */ | ||
align-items: flex-start; /* Ensure text starts at the top */ | ||
} | ||
|
||
/* Specific styling for the text content */ | ||
.fast-facts-wrapper > .wp-block-group .wp-block-group:last-child p { | ||
white-space: normal; /* Allow wrapping for long text */ | ||
overflow-wrap: break-word; /* Break words when needed */ | ||
word-break: break-word; /* Break words on legacy browsers */ | ||
line-height: 1.4; /* Improve readability */ | ||
text-transform: capitalize; /* Capitalize text */ | ||
padding: 0; /* Ensure no unnecessary padding */ | ||
margin: 0; /* Remove extra margins */ | ||
display: inline; /* Ensure the text flows inline with the label */ | ||
} | ||
|
||
.facilities-list li::marker{display:none;} | ||
.facilities-list{padding-left:0!important;} | ||
|
||
.facilities-list li { | ||
margin-left: 10px; | ||
list-style: none; /* Remove default list marker */ | ||
position: relative; /* Position for pseudo-element */} | ||
|
||
.facilities-list li::before{ | ||
content: ''; | ||
position: absolute; | ||
left: 0; | ||
top: 50%; | ||
transform: translateY(-50%); /* Center the icon vertically */ | ||
width: 20px; /* Adjust the size of the tick icon */ | ||
height: 20px; | ||
background-image: url('../img/tick.svg'); /* Replace with the path to your tick.svg */ | ||
background-size: contain; | ||
background-repeat: no-repeat; | ||
left:-28px | ||
} | ||
@media (min-width: 800px) { | ||
.single-tour-operator .toggle-button {display:none;} | ||
} | ||
|
||
/* Optional: Responsive adjustments for smaller screens */ | ||
@media (max-width: 768px) { | ||
|
||
/* Styling for the toggle button */ | ||
.single-tour-operator .toggle-button { | ||
display: inline-flex; | ||
align-items: center; | ||
padding: 5px; | ||
background: none; | ||
border: none; | ||
cursor: pointer; | ||
font-size: 14px; | ||
color: var(--wp--preset--color--contrast); | ||
} | ||
|
||
/* Styling for the SVG icons */ | ||
.single-tour-operator .toggle-icon { | ||
width: 16px; | ||
height: 16px; | ||
fill: var(--wp--preset--color--contrast); | ||
margin-left: 5px; | ||
} | ||
|
||
/* Collapsed state for the second wp-block-group */ | ||
.single-tour-operator section.wp-block-group .wp-block-group.collapsed { | ||
display: none; /* Hide the content */ | ||
} | ||
|
||
|
||
.fast-facts-wrapper > .wp-block-group { | ||
flex-wrap: wrap; /* Allow wrapping for better readability */ | ||
gap: 5px; | ||
} | ||
|
||
.fast-facts-wrapper > .wp-block-group .wp-block-group.is-layout-flex:last-child { | ||
flex-wrap: wrap; /* Allow text to wrap on smaller screens */ | ||
} | ||
.lsx-itinerary-wrapper .hidden, | ||
.lsx-units-wrapper .hidden { | ||
display: none; | ||
} | ||
/*# sourceMappingURL=style.css.map */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like there's a missing newline at the end of the file. It's a common convention to end files with a newline because some tools might not handle or display the last line correctly if it doesn't end with a newline.
- /*# sourceMappingURL=style.css.map */
- \ No newline at end of file
+ /*# sourceMappingURL=style.css.map */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files selected (4)
- assets/css/scss/_slider.scss (2)
- assets/css/style.css (2)
- readme.txt (1)
- tour-operator.php (1)
Files skipped from review due to trivial changes (2)
- readme.txt
- tour-operator.php
Review comments generated (6)
- Review: 4
- LGTM: 2
Tips
Chat with CodeRabbit Bot (@coderabbitai
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@coderabbitai
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
.lsx-to-slider { | ||
&.lsx-travel-information-wrapper { | ||
.slick-list { | ||
max-width: 100% !important; | ||
width: 100% !important; | ||
} | ||
|
||
.slick-slide { | ||
padding: 0 !important; | ||
margin: 0 10px !important; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes made to the .lsx-to-slider
class and its child classes are good for improving the layout of the slider. The use of !important
is generally discouraged as it can make debugging difficult and increase CSS specificity unnecessarily. However, in this case, it seems necessary to override the styles from the Slick library or other conflicting styles.
- max-width: 100% !important;
- width: 100% !important;
+ max-width: 100%;
+ width: 100%;
} | ||
} | ||
|
||
.wp-block-query { | ||
&.lsx-to-slider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.lsx-to-slider.lsx-travel-information-wrapper .slick-list { | ||
max-width: 100% !important; | ||
width: 100% !important; | ||
} | ||
.lsx-to-slider.lsx-travel-information-wrapper .slick-slide { | ||
padding: 0 !important; | ||
margin: 0 10px !important; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of !important
is generally discouraged as it increases the specificity of a rule and can lead to difficulties in overriding it later. If possible, consider increasing the specificity of your selectors instead.
- max-width: 100% !important;
- width: 100% !important;
+ max-width: 100%;
+ width: 100%;
- padding: 0 !important;
- margin: 0 10px !important;
+ padding: 0;
+ margin: 0 10px;
|
||
/* Specific styling for the text content */ | ||
.fast-facts-wrapper > .wp-block-group .wp-block-group:last-child p { | ||
white-space: normal; /* Allow wrapping for long text */ | ||
overflow-wrap: break-word; /* Break words when needed */ | ||
word-break: break-word; /* Break words on legacy browsers */ | ||
line-height: 1.4; /* Improve readability */ | ||
text-transform: capitalize; /* Capitalize text */ | ||
padding: 0; /* Ensure no unnecessary padding */ | ||
margin: 0; /* Remove extra margins */ | ||
display: inline; /* Ensure the text flows inline with the label */ | ||
} | ||
|
||
.facilities-list li::marker{display:none;} | ||
.facilities-list{padding-left:0!important;} | ||
|
||
.facilities-list li { | ||
margin-left: 10px; | ||
list-style: none; /* Remove default list marker */ | ||
position: relative; /* Position for pseudo-element */} | ||
|
||
.facilities-list li::before{ | ||
content: ''; | ||
position: absolute; | ||
left: 0; | ||
top: 50%; | ||
transform: translateY(-50%); /* Center the icon vertically */ | ||
width: 20px; /* Adjust the size of the tick icon */ | ||
height: 20px; | ||
background-image: url('../img/tick.svg'); /* Replace with the path to your tick.svg */ | ||
background-size: contain; | ||
background-repeat: no-repeat; | ||
left:-28px | ||
} | ||
@media (min-width: 800px) { | ||
.single-tour-operator .toggle-button {display:none;} | ||
} | ||
|
||
/* Optional: Responsive adjustments for smaller screens */ | ||
@media (max-width: 768px) { | ||
|
||
/* Styling for the toggle button */ | ||
.single-tour-operator .toggle-button { | ||
display: inline-flex; | ||
align-items: center; | ||
padding: 5px; | ||
background: none; | ||
border: none; | ||
cursor: pointer; | ||
font-size: 14px; | ||
color: var(--wp--preset--color--contrast); | ||
} | ||
|
||
/* Styling for the SVG icons */ | ||
.single-tour-operator .toggle-icon { | ||
width: 16px; | ||
height: 16px; | ||
fill: var(--wp--preset--color--contrast); | ||
margin-left: 5px; | ||
} | ||
|
||
/* Collapsed state for the second wp-block-group */ | ||
.single-tour-operator section.wp-block-group .wp-block-group.collapsed { | ||
display: none; /* Hide the content */ | ||
} | ||
|
||
|
||
.fast-facts-wrapper > .wp-block-group { | ||
flex-wrap: wrap; /* Allow wrapping for better readability */ | ||
gap: 5px; | ||
} | ||
|
||
.fast-facts-wrapper > .wp-block-group .wp-block-group.is-layout-flex:last-child { | ||
flex-wrap: wrap; /* Allow text to wrap on smaller screens */ | ||
} | ||
.lsx-itinerary-wrapper .hidden, | ||
.lsx-units-wrapper .hidden { | ||
display: none; | ||
} | ||
/*# sourceMappingURL=style.css.map */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good practice to end files with a newline character. This helps with version control systems like Git and tools like cat
, echo
, and others that might not correctly display or handle the file otherwise.
- /*# sourceMappingURL=style.css.map */
- \ No newline at end of file
+ /*# sourceMappingURL=style.css.map */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files selected (1)
- assets/js/src/custom.js (8)
Review comments generated (6)
- Review: 5
- LGTM: 1
Tips
Chat with CodeRabbit Bot (@coderabbitai
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@coderabbitai
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
|
||
console.log($(this)); | ||
console.log($(this).parent( '.wp-block-group' ).find('.wp-block-post-content')); | ||
|
||
lsx_to.readMoreSet( $(this), $(this).parent( '.wp-block-group' ).find('.wp-block-post-content') ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} ); | ||
} | ||
} ); | ||
|
||
// Second slider: .lsx-to-slider.travel-information | ||
$( '.lsx-travel-information-wrapper.lsx-to-slider .travel-information:not(.slider-disabled)' ).each( function() { | ||
var $this = $( this ); | ||
|
||
lsx_to.pre_build_slider( $this ); | ||
|
||
// Ensure the second slider has 4 slides showing | ||
if ( 1 < $this.children().length ) { | ||
$this.slick( { | ||
draggable: false, | ||
infinite: true, | ||
swipe: false, | ||
dots: false, | ||
slidesToShow: 3, | ||
slidesToScroll: 1, | ||
slidesToShow: 4, // Show 4 items at a time | ||
slidesToScroll: 1, // Scroll 1 item at a time | ||
autoplay: false, | ||
autoplaySpeed: 0, | ||
//appendArrows: $this.parent(), | ||
//appendDots: $this.parent(), | ||
appendArrows: $this.parent(), // Ensure arrows are appended correctly for this slider | ||
appendDots: $this.parent(), // Append dots in the correct place | ||
responsive: [ | ||
{ | ||
breakpoint: 1028, | ||
settings: { | ||
slidesToShow: 2, | ||
slidesToShow: 3, | ||
slidesToScroll: 1, | ||
draggable: true, | ||
arrows: false, | ||
arrows: true, | ||
swipe: true, | ||
dots: true, | ||
} | ||
}, | ||
{ | ||
breakpoint: 782, | ||
settings: { | ||
slidesToShow: 1, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
draggable: true, | ||
arrows: false, | ||
arrows: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The autoplaySpeed
is set to 0, which means the slides will change instantly. This could lead to a poor user experience as users may not have enough time to read or interact with the content of each slide. Consider setting a reasonable value for autoplaySpeed
.
- autoplaySpeed: 0,
+ autoplaySpeed: 3000, // 3 seconds
@@ -297,7 +346,7 @@ | |||
$document.ready( function() { | |||
lsx_to.set_read_more(); | |||
lsx_to.set_read_more_travel_info(); | |||
lsx_to.set_read_more_itinerary(); | |||
//lsx_to.set_read_more_itinerary(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lsx_to.build_slider_lightbox(); | ||
} ); | ||
|
||
document.addEventListener('DOMContentLoaded', function () { | ||
/*document.addEventListener('DOMContentLoaded', function () { | ||
const paragraphs = document.querySelectorAll('.additional-info .wp-block-group.content p'); | ||
|
||
paragraphs.forEach(function (p) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [364-403]
There's a large block of commented-out code. If this code is not needed, it should be removed to improve readability and maintainability.
- /*document.addEventListener('DOMContentLoaded', function () {
- const paragraphs = document.querySelectorAll('.additional-info .wp-block-group.content p');
-
- paragraphs.forEach(function (p) {
- ...
- });
- });*/
@@ -399,6 +448,6 @@ | |||
}); | |||
} | |||
}); | |||
}); | |||
});*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files selected (1)
- includes/patterns/travel-information.php (1)
Files not summarized due to errors (1)
- includes/patterns/travel-information.php (diff tokens exceeds limit)
Files skipped from review due to trivial changes (1)
- includes/patterns/travel-information.php (diff too large)
Review comments generated (0)
- Review: 0
- LGTM: 0
Tips
Chat with CodeRabbit Bot (@coderabbitai
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@coderabbitai
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
Title: Refactor CSS to SASS and Implement 4-Column Slider for Travel Information
Description:
Summary of Changes:
This pull request includes the following updates to enhance the Travel Information section:
1. CSS Refactor to SASS:
.slick-list
and.slick-slide
under the.travel-information
class:max-width
andwidth
properties for the.slick-list
element.padding
andmargin
properties for the.slick-slide
elements, removing unnecessary spacing and ensuring a clean layout.2. custom.js Functionality:
3. Responsive Design:
Motivation:
The changes aim to enhance the visual appearance and usability of the Travel Information section, ensuring that the content is displayed optimally on all screen sizes. The refactoring of CSS to SASS also improves the maintainability of the styles in the long term.
Summary by CodeRabbit
Release Notes:
.travel-information
class.class-registration.php
for more robust error handling.readme.txt
andtour-operator.php
. Also updated License information and added an Update URI.