Skip to content
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

Merged
merged 6 commits into from
Dec 17, 2024
Merged

Travel Information Slider #458

merged 6 commits into from
Dec 17, 2024

Conversation

Justinabes007
Copy link
Contributor

@Justinabes007 Justinabes007 commented Dec 13, 2024

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:

  • Refactored the CSS code to SASS for better maintainability and structure.
  • Updated styles for .slick-list and .slick-slide under the .travel-information class:
    • max-width and width properties for the .slick-list element.
    • padding and margin properties for the .slick-slide elements, removing unnecessary spacing and ensuring a clean layout.

2. custom.js Functionality:

  • Added JavaScript functionality to implement a 4-column slider for the Travel Information section using the Slick slider.
  • The slider will display four columns by default, with the ability to adapt for different screen sizes:
    • 4 columns on desktop
    • 3 columns on tablets (breakpoint: 1024px)
    • 2 columns on mobile devices (breakpoint: 768px)
    • 1 column on very small screens (breakpoint: 480px)
  • Slick slider is configured to include navigation arrows and dots for better user interaction and navigation.

3. Responsive Design:

  • Added responsive settings to ensure the slider adjusts based on the screen size, improving user experience across devices.

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:

  • New Feature: Enhanced the Travel Information section with a responsive 4-column slider, providing a better user experience across various devices.
  • Refactor: Transitioned from CSS to SASS for improved maintainability and efficiency in the .travel-information class.
  • Bug Fix: Improved pattern matching functionality and added debug actions in class-registration.php for more robust error handling.
  • Documentation: Updated plugin metadata including contributors, tags, version requirements, stable tag, Plugin URI, Description, Version, Author URI, Requires PHP version, Tested up to version, and Tags in readme.txt and tour-operator.php. Also updated License information and added an Update URI.

custom JS for Travel Information
SASS CSS
@Justinabes007 Justinabes007 added [Dev] CSS Styling Related to editor and front end styles, CSS-specific issues. javascript Pull requests that update Javascript code labels Dec 13, 2024
@Justinabes007 Justinabes007 added this to the 2.1.0 milestone Dec 13, 2024
@Justinabes007 Justinabes007 self-assigned this Dec 13, 2024
Copy link

coderabbitai bot commented Dec 13, 2024

Warning

CodeRabbit GitHub Action detected

The 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 skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Dec 13, 2024

Image description CodeRabbit

Walkthrough

This 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

Files Summary
assets/css/scss/_slider.scss, assets/css/style.css, assets/js/src/custom.js Refactored the slider implementation from CSS to SASS, improving layout and responsiveness. Adjusted properties like max-width, width, padding, and margin for .slick-list and .slick-slide elements within the .travel-information class. Added responsive settings for a 4-column slider using Slick slider.
includes/classes/blocks/class-registration.php Enhanced pattern matching in a function, added debug actions, and made adjustments to handle specific cases within the function.
readme.txt, tour-operator.php Updated plugin metadata including contributors, tags, version requirements, stable tag, Plugin URI, Description, Version, Author URI, Requires PHP version, Tested up to version, and Tags. License information updated and an Update URI added. The plugin is now tagged as version 2.0.0.

🐇💻

"In the land of code where the shadows lie,

We refactor, enhance, and amplify.

From CSS to SASS, we take our stride,

With sliders slick and wide.

Pattern matches find their place,

In the heart of the registration space.

And as we dance the version two jig,

Our plugin grows big and big!" 🎉🚀


Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If 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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between e93103c and e018fe7 commits.
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 Image description 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.

Comment on lines +7 to +11

.slick-slide {
padding: 0 !important;
margin: 0 10px !important;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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;
+ }

Comment on lines +200 to +242
// 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,
}
}
]
} );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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,
+ 							}
+ 						}
+ 					]

Comment on lines 246 to 282
// 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,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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,
+ 							}
+ 						}
+ 					]

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between e018fe7 and 0406cff commits.
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 Image description 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.

Comment on lines +8 to +11
.slick-slide {
padding: 0 !important;
margin: 0 10px !important;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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;
+ }

Comment on lines +246 to 282
// 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,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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

Comment on lines 255 to 262
.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;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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;

Comment on lines 296 to 297
.wp-block-query.lsx-to-slider .slick-slide,
.lsx-travel-information-wrapper.lsx-to-slider .slick-slide {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The padding value here seems to be inconsistent with the one defined on line 260. If the intention is to override the previous value, then it's fine. Otherwise, consider making them consistent.

-   padding: 15px !important;
+   padding: 0 !important;

Comment on lines 426 to 431

/* 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 */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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 */

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 0406cff and 8250fb9 commits.
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 Image description 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.

Comment on lines +1 to +13
.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;
}
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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%;

Comment on lines +47 to +51
}
}

.wp-block-query {
&.lsx-to-slider {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Similar to the previous comment, the use of !important should be avoided if possible. If there's no other way to override the styles, then it's acceptable.

- padding: 15px !important;
+ padding: 15px;

Comment on lines +255 to +262
.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;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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;

Comment on lines 426 to +431

/* 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 */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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 */

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 8250fb9 and 3deaa0b commits.
Files selected (1)
  • assets/js/src/custom.js (8)
Review comments generated (6)
  • Review: 5
  • LGTM: 1

Tips

Chat with Image description 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.

Comment on lines +54 to +58

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') );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The console.log statements should be removed from production code as they can expose sensitive information to the end user and are generally used for debugging purposes.

-			console.log($(this));
-			console.log($(this).parent( '.wp-block-group' ).find('.wp-block-post-content'));

Comment on lines +244 to +285
} );
}
} );

// 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,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

It seems like the function set_read_more_itinerary() has been commented out. If this function is no longer needed, it's better to remove the line entirely to keep the code clean.

- 		//lsx_to.set_read_more_itinerary();

Comment on lines 361 to 367
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

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 @@
});
}
});
});
});*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

This closing comment tag appears to be part of a larger block of commented-out code. If the code is not needed, it should be removed to improve readability and maintainability.

- 	});*/

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 3deaa0b and dc325c5 commits.
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 Image description 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.

@krugazul krugazul merged commit 19ae5d5 into 2.0-beta-3 Dec 17, 2024
6 of 8 checks passed
@krugazul krugazul deleted the Travel-Information branch December 17, 2024 13:43
@ZaredRogers ZaredRogers linked an issue Jan 9, 2025 that may be closed by this pull request
53 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Dev] CSS Styling Related to editor and front end styles, CSS-specific issues. javascript Pull requests that update Javascript code
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Parent: Tour Operator Blocks
2 participants