homepage scroller
by pphheerroonn
HTML
<style>
h3.browse-all-header {
padding-left: calc(var(--gap)* 2);
margin-bottom: 0;
font-size: 2em;
}
/* Container for the entire component */
.scroll-menu-container {
position: relative;
/*max-width: 1200px;*/
margin: 20px auto;
padding: 0 15px;
}
/* Styles for the scrollable container */
.scroll-menu-container .container {
overflow-x: auto;
white-space: nowrap;
padding: 10px 0 20px 0;
margin-top: -10px;
scroll-behavior: smooth;
-ms-overflow-style: none; /* Hide scrollbar for IE and Edge */
scrollbar-width: none; /* Hide scrollbar for Firefox */
cursor: grab; /* Show grab cursor to indicate draggable */
user-select: none; /* Prevent text selection during drag */
}
/* When actively grabbing the scroll container */
.scroll-menu-container .container.grabbing {
cursor: grabbing;
}
/* Hide scrollbar for Chrome, Safari and Opera */
.scroll-menu-container .container::-webkit-scrollbar {
display: none;
}
/* Styles for each tile */
.scroll-menu-container .tile {
display: inline-block;
width: 200px;
margin-right: 20px;
border-radius: 12px;
overflow: hidden;
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08);
background-color: #ffffff;
transition: transform 0.3s ease, box-shadow 0.3s ease;
vertical-align: top; /* Align tiles at the top */
}
.scroll-menu-container .tile:hover {
transform: translateY(-5px);
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
}
/* Disable hover effect during dragging */
.scroll-menu-container .grabbing .tile:hover {
transform: none;
}
/* Styles for the image */
.scroll-menu-container.scroll-menu-container .tile img {
width: 100%;
height: 190px;
object-fit: contain;
...