react-spotlight-tour-cct
Version:
A lightweight and customizable React component for creating guided tours in your web applications. Highlight elements and display step-by-step instructions to guide users through your app's features.
202 lines (177 loc) • 4.99 kB
CSS
.tour-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(1, 0, 0, 0.6); /* Dark overlay effect */
z-index: 1000;
pointer-events: all;
}
.tour-guide-popup {
position: absolute;
background: #57677f;
border: 1px solid #000000;
border-radius: 11px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
height: auto;
width: 50%;
max-width: 410px;
z-index: 1001;
padding: 12px;
box-sizing: border-box;
transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
min-height: 100px;
word-wrap: break-word; /* Ensure long words break and wrap */
display: flex;
flex-direction: column;
justify-content: flex-start; /* Ensure content starts from top */
transition: top 0.5s ease, left 0.5s ease, height 0.5s ease, opacity 0.3s ease;
}
/* Adjustments to prevent the popup from overlapping with content */
.tour-guide-popup.bottom {
margin-top: 10px;
}
.tour-guide-popup.top {
margin-bottom: 10px;
}
.tour-guide-popup.left,
.tour-guide-popup.right {
margin-left: 10px;
margin-right: 10px;
}
.popup-arrow {
position: absolute;
width: 0;
height: 0;
border-style: solid;
transition: top 0.3s ease, left 0.3s ease, transform 0.3s ease;
}
/* Progress bar container at the top of the screen */
.progress-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 6px;
background-color: #f0f0f0;
border-radius: 3px;
z-index: 1050; /* Make sure it's above everything else */
margin-top: 0; /* Remove any top margin */
}
/* Progress bar itself */
.progress-bar {
height: 100%;
background-color: #4caf50;
border-radius: 3px;
transition: width 0.3s ease;
}
/* Tour guide popup styles (unchanged) */
.tour-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(1, 0, 0, 0.6);
z-index: 1000;
pointer-events: all;
}
/*
/* Other existing styles... */
-----------------------------------------
/* Arrow */
.popup-arrow {
position: absolute;
width: 0;
height: 0;
border-style: solid;
}
.popup-arrow.top {
bottom: -9px;
left: 50%;
transform: translateX(-50%);
border-width: 10px 10px 0 10px;
border-color: white transparent transparent transparent;
}
.popup-arrow.bottom {
top: -9px;
left: 50%;
transform: translateX(-50%);
border-width: 0 10px 10px 10px;
border-color: transparent transparent white transparent;
}
.popup-arrow.left {
top: var(--arrow-offset, 50%);
right: -9px;
transform: translateY(-50%);
border-width: 10px 0 10px 10px;
border-color: transparent transparent transparent white;
}
.popup-arrow.right {
top: var(--arrow-offset, 50%);
left: -9px;
transform: translateY(-50%);
border-width: 10px 10px 10px 0;
border-color: transparent white transparent transparent;
}----------------------------- */
.popup-content {
text-align: center;
font-size: 14px;
color: #000000d6;
line-height: 1.2;
margin-bottom: 0px;
}
/* Responsive styles for screens below 600px */
@media (max-width: 600px) {
/* Adjust the popup for smaller screens */
.tour-guide-popup {
width: 85%; /* Increase the width for smaller screens */
padding: 10px;
min-width: 280px; /* Ensure the popup doesn't become too narrow */
max-width: 90%; /* Limit the width */
font-size: 12px; /* Slightly smaller font size for better readability */
}
/* Adjust the arrow size */
.tooltip-arrow {
border-width: 8px; /* Smaller arrows on smaller screens */
}
/* Adjust the content within the popup */
.popup-content {
font-size: 12px; /* Smaller font size for smaller screens */
color: black;
line-height: 1.4; /* More line spacing for better readability */
margin-bottom: 15px; /* Add some space between text and buttons */
}
/* Adjust margins for popup positioning */
.tour-guide-popup.top {
margin-bottom: 20px; /* Increase margin from top for better spacing */
}
.tour-guide-popup.bottom {
margin-top: 20px; /* Increase margin from bottom */
}
.tour-guide-popup.left,
.tour-guide-popup.right {
margin-left: 10px; /* Reduce margin on sides */
margin-right: 10px; /* Reduce margin on sides */
}
/* Adjust progress bar */
.progress-container {
height: 4px; /* Thinner progress bar for smaller screens */
}
.progress-bar {
background-color: #4caf50;
border-radius: 2px; /* Slightly smaller border-radius for the progress bar */
}
/* Adjust the close button */
.button-close {
font-size: 18px; /* Smaller close button */
}
/* Handle button padding on smaller screens */
.button-restart,
.button-next,
.button-prev {
padding: 8px 16px; /* Adjust padding for smaller buttons */
font-size: 12px; /* Smaller font size for buttons */
}
}