Files
Blink/src/components/carousel/carousel.scss
T

188 lines
3.4 KiB
SCSS

.carousel {
position: relative;
overflow: visible;
height: 65vh;
margin-bottom: 3em;
display: grid;
grid-template-areas: "main sidebar";
grid-template-columns: 1fr 340px;
gap: 1.5em;
&-sidebar {
overflow-y: auto;
height: 100%;
position: relative;
@include glass-effect($bg-color: rgba(10, 10, 14, 0.4));
border-radius: 24px;
grid-area: sidebar;
display: flex;
flex-direction: column;
padding: 12px;
gap: 8px;
// Ensure programmatic scroll respects padding
scroll-padding-block: 24px;
// Hide scrollbar but keep functionality
scrollbar-width: none;
-ms-overflow-style: none;
&::-webkit-scrollbar {
width: 0;
height: 0;
display: none;
}
}
&-button {
position: absolute !important;
top: 50%;
transform: translateY(-50%);
z-index: 100;
&.right {
right: 0.5em;
}
&.left {
left: 0.5em;
}
}
&-ticker{
overflow: hidden;
height: 72px;
display: flex;
padding: 8px;
align-items: center;
gap: 12px;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
border-radius: 12px; // Slightly smaller radius to work with the bar
background: transparent;
border: 1px solid transparent;
&:hover {
background: rgba(255, 255, 255, 0.05);
cursor: pointer;
}
&.active {
background: rgba(255, 255, 255, 0.08); // Subtle background
// Vertical Progress Bar
&::after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 4px;
background-color: var(--mui-palette-primary-main, #fff);
height: 0%;
animation: ticker-v-progress 8s linear;
}
}
&-image {
height: 56px;
width: 100px;
flex-shrink: 0;
border-radius: 8px;
object-fit: cover;
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
&.placeholder {
display: flex;
align-items: center;
justify-content: center;
background: rgb(100 100 100 / 0.1);
color: rgb(200 200 200 / 0.7);
font-size: 2rem;
}
}
& > div {
display: flex;
flex-direction: column;
justify-content: center;
min-width: 0; // flexible text truncation
padding-left: 4px; // compensate for visual weight of potential bar
.carousel-ticker-title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500; // Slightly lighter
font-size: 0.95rem;
line-height: 1.2;
margin-bottom: 2px;
opacity: 0.9;
}
.carousel-ticker-year {
font-size: 0.8rem;
opacity: 0.6;
}
}
}
// Pause progress when carousel is paused
&.paused {
.carousel-ticker.active::after {
animation-play-state: paused;
}
}
@keyframes ticker-v-progress {
from { height: 0%; }
to { height: 100%; }
}
&-indicator {
aspect-ratio: 1.77777;
overflow: hidden;
border-radius: 2px;
padding: 2px;
transition: opacity $transition-time-fast;
opacity: 0.5;
width: auto;
&:hover {
cursor: pointer;
opacity: 0.8;
}
&-container {
display: flex;
gap: 1em;
align-items: center;
justify-content: center;
}
&-image {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 4px;
}
&-icon {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
background: rgb(155 155 155 / 0.4);
border-radius: 4px;
}
&.active {
opacity: 1;
.material-symbols-rounded {
--fill: 1;
}
}
}
}
.carousel-ticker-wrapper {
scroll-margin-block: 24px;
}