coders-club / src /components /SpotlightCard.css
kumar-aditya's picture
Upload 108 files
a7b8df9 verified
.card-spotlight {
position: relative;
border-radius: 1.5rem;
border: 1px solid rgba(255, 255, 255, 0.1);
background: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
padding: 2rem;
overflow: hidden;
--mouse-x: 50%;
--mouse-y: 50%;
--spotlight-color: rgba(255, 255, 255, 0.08);
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.3),
inset 0 1px 0 rgba(255, 255, 255, 0.1);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-spotlight::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), var(--spotlight-color), transparent 70%);
opacity: 0;
transition: opacity 0.4s ease;
pointer-events: none;
}
.card-spotlight:hover::before,
.card-spotlight:focus-within::before {
opacity: 0.8;
}
.card-spotlight:hover {
transform: translateY(-4px);
border-color: rgba(255, 255, 255, 0.2);
background: rgba(0, 0, 0, 0.4);
box-shadow:
0 16px 48px rgba(0, 0, 0, 0.4),
inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
/* Enhanced text visibility within spotlight cards */
.card-spotlight h1,
.card-spotlight h2,
.card-spotlight h3,
.card-spotlight h4,
.card-spotlight h5,
.card-spotlight h6 {
color: rgba(255, 255, 255, 0.95) !important;
text-shadow:
0 2px 4px rgba(0, 0, 0, 0.8),
0 4px 8px rgba(0, 0, 0, 0.4);
position: relative;
z-index: 2;
}
.card-spotlight p,
.card-spotlight span,
.card-spotlight div,
.card-spotlight li {
color: rgba(255, 255, 255, 0.85) !important;
text-shadow:
0 1px 2px rgba(0, 0, 0, 0.8),
0 2px 4px rgba(0, 0, 0, 0.4);
position: relative;
z-index: 2;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.card-spotlight {
padding: 1.5rem;
border-radius: 1rem;
}
.card-spotlight:hover {
transform: translateY(-2px);
}
.card-spotlight::before {
background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), var(--spotlight-color), transparent 60%);
}
}
@media (max-width: 480px) {
.card-spotlight {
padding: 1rem;
}
}
/* High contrast mode support */
@media (prefers-contrast: high) {
.card-spotlight {
background: rgba(0, 0, 0, 0.6);
border: 2px solid rgba(255, 255, 255, 0.3);
}
.card-spotlight h1,
.card-spotlight h2,
.card-spotlight h3,
.card-spotlight h4,
.card-spotlight h5,
.card-spotlight h6 {
color: white !important;
text-shadow:
0 0 0 rgba(0, 0, 0, 1),
0 2px 4px rgba(0, 0, 0, 1);
}
.card-spotlight p,
.card-spotlight span,
.card-spotlight div,
.card-spotlight li {
color: rgba(255, 255, 255, 0.95) !important;
text-shadow:
0 0 0 rgba(0, 0, 0, 1),
0 1px 2px rgba(0, 0, 0, 1);
}
}