nexora / frontend /src /components /HeroSection.css
ChandimaPrabath's picture
0.0.0.2 Alpha
3b85fd7
raw
history blame
3.45 kB
/* Fade-in animation for the hero section */
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.hero-container {
position: relative;
width: 100%;
overflow: hidden;
}
.hero-section {
display: flex;
flex-direction: column;
min-height: 480px;
position: relative;
border-radius: 12px;
padding: 1rem;
padding-bottom: 2.5rem;
justify-content: flex-end;
animation: fadeIn 1s ease-in-out; /* Add fade-in animation */
}
.hero-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
transition: opacity 1s ease-in-out; /* Smooth transition */
opacity: 0;
}
.hero-image.active {
opacity: 1;
}
.hero-text {
display: flex;
flex-direction: column;
gap: 0.5rem;
text-align: left;
position: relative;
z-index: 1;
}
.hero-title {
color: white;
font-size: 2.5rem;
font-weight: 900;
line-height: 1.2;
transition: font-size 0.3s ease-in-out;
}
.hero-description {
color: white;
font-size: 1rem;
font-weight: normal;
line-height: 1.4;
overflow: hidden; /* Hide text overflow */
display: -webkit-box; /* Use flexbox layout */
-webkit-line-clamp: 3; /* Limit text to 3 lines */
-webkit-box-orient: vertical; /* Set box orientation to vertical */
text-overflow: ellipsis; /* Add ellipsis (...) */
transition: font-size 0.3s ease-in-out;
}
.hero-indicators {
position: absolute;
bottom: 1rem;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 0.5rem;
}
.indicator {
width: 20px;
height: 10px;
border-radius: 5px;
background-color: gray;
cursor: pointer;
transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.indicator.active {
background-color: white;
transform: scale(1.2);
}
/* Responsive Styles */
@media (max-width: 1200px) {
.hero-title {
font-size: 2rem;
}
.hero-description {
font-size: 0.875rem;
}
.hero-button {
height: 2rem;
font-size: 0.75rem;
padding: 0 0.75rem;
}
.indicator {
width: 15px;
height: 7px;
}
}
@media (max-width: 992px) {
.hero-section {
min-height: 400px;
}
.hero-title {
font-size: 1.75rem;
}
.hero-description {
font-size: 0.75rem;
}
.hero-button {
height: 1.75rem;
font-size: 0.675rem;
padding: 0 0.5rem;
}
.indicator {
width: 12px;
height: 6px;
}
}
@media (max-width: 768px) {
.hero-section {
min-height: 300px;
padding: 0.5rem;
padding-bottom: 2rem;
}
.hero-title {
font-size: 1.5rem;
}
.hero-description {
font-size: 0.875rem;
}
.hero-button {
height: 1.5rem;
font-size: 0.75rem;
padding: 0 0.5rem;
}
.indicator {
width: 15px;
height: 8px;
}
}
@media (max-width: 576px) {
.hero-section {
min-height: 200px;
}
.hero-title {
font-size: 1.25rem;
}
.hero-description {
font-size: 0.75rem;
}
.hero-button {
height: 1.25rem;
font-size: 0.625rem;
padding: 0 0.5rem;
}
.indicator {
width: 12px;
height: 6px;
}
}