Certainly! I've reviewed your code and made several enhancements to improve its functionality, aesthetics, and modern UI design while maintaining your specified colors and fonts. Here's the updated code with detailed explanations:
1. Fixed and Enhanced CSS
<style>
/* Root Variables for Consistency */
:root {
--c-bg-primary: rgba(43, 43, 43, 0.95); /* Slightly increased opacity for better contrast */
--c-text-primary: #FFFFFF;
--c-gold: #D1C287;
--c-accent: #4F3F02;
--f-primary: 'Lato', sans-serif;
--s-border-radius: 12px; /* Increased border radius for a more modern look */
--transition-speed: 0.3s;
--container-max-width: 1100px;
--section-padding: 60px 20px;
--fade-in-duration: 0.6s;
--box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* Enhanced shadow for depth */
}
/* Mission and Vision Section Styles */
.about-section {
background-color: var(--c-bg-primary);
padding: var(--section-padding);
position: relative;
color: var(--c-text-primary);
font-family: var(--f-primary);
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column; /* Center content vertically */
}
/* Infographic Container */
.about-container {
max-width: var(--container-max-width);
width: 100%;
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 40px;
box-sizing: border-box;
flex-wrap: wrap;
position: relative;
z-index: 1; /* Ensure content is above connecting lines */
}
/* Individual Card */
.about-card {
background: rgba(255, 255, 255, 0.1);
padding: 30px;
border-radius: var(--s-border-radius);
backdrop-filter: blur(10px);
box-shadow: var(--box-shadow);
transition: transform var(--transition-speed), box-shadow var(--transition-speed), background-color var(--transition-speed);
opacity: 0;
transform: translateY(20px); /* Initial position for animation */
animation: fadeInUp var(--fade-in-duration) forwards;
flex: 1 1 300px;
max-width: 300px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
position: relative;
cursor: pointer; /* Change cursor on hover */
}
/* Fade-In and Slide-Up Animation */
@keyframes fadeInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
/* Hover Effects */
.about-card:hover {
transform: translateY(-10px);
box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5);
background: rgba(255, 255, 255, 0.2);
}
/* Icon Styling */
.about-icon {
width: 80px;
height: 80px;
fill: var(--c-gold);
margin-bottom: 20px;
transition: fill var(--transition-speed), transform var(--transition-speed);
}
/* Icon Hover Effects */
.about-card:hover .about-icon {
fill: var(--c-text-primary); /* Change icon color to white on hover */
transform: scale(1.1);
}
/* Card Title */
.about-title {
background: linear-gradient(45deg, var(--c-gold), var(--c-accent));
-webkit-background-clip: text;
color: transparent;
font-size: 24px;
margin-bottom: 15px;
position: relative;
font-weight: 700; /* Bold titles */
}
/* Underline Decoration for Titles */
.about-title::after {
content: '';
position: absolute;
width: 60px;
height: 3px;
background: linear-gradient(45deg, var(--c-gold), var(--c-accent));
left: 50%;
bottom: -5px;
transform: translateX(-50%);
border-radius: 2px;
}
/* Paragraph Text */
.about-text {
font-size: 16px;
line-height: 1.8;
color: var(--c-text-primary);
transition: color var(--transition-speed);
}
/* Paragraph Hover Effect */
.about-card:hover .about-text {
color: var(--c-gold);
}
/* Connecting Lines */
.connecting-line {
position: absolute;
width: 3px;
background: var(--c-gold);
opacity: 0.7;
z-index: 0;
}
/* Line from Cellular to Integrated */
.line-cellular-integrated {
top: 120px;
left: 35%;
height: 150px;
transform: rotate(45deg);
}
/* Line from Integrated to Personalized */
.line-integrated-personalized {
top: 120px;
left: 55%;
height: 150px;
transform: rotate(-45deg);
}
/* Central Line */
.line-center {
top: 0;
left: 50%;
width: 3px;
height: 100%;
transform: translateX(-50%);
}
/* Central Overlap Text */
.about-central-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 20px;
color: var(--c-gold);
text-align: center;
z-index: 2;
padding: 0 20px;
}
/* Responsive Design for Tablets */
@media (max-width: 1024px) {
.about-container {
max-width: 900px;
}
.about-card {
max-width: 280px;
}
.connecting-line {
width: 2px;
background: var(--c-gold);
}
.line-cellular-integrated,
.line-integrated-personalized,
.line-center {
height: 120px;
}
.about-central-text {
font-size: 18px;
}
}
/* Responsive Design for Mobile Devices */
@media (max-width: 768px) {
.about-container {
flex-direction: column;
align-items: center;
gap: 30px;
}
.connecting-line {
display: none; /* Hide connecting lines on mobile */
}
.about-card {
max-width: 100%;
}
.about-central-text {
position: static;
transform: none;
margin-top: 20px;
}
}
/* Further Optimization for Small Mobile Screens */
@media (max-width: 480px) {
.about-section {
padding: 40px 10px;
}
.about-title {
font-size: 20px;
}
.about-text {
font-size: 14px;
}
.about-icon {
width: 60px;
height: 60px;
}
.about-central-text {
font-size: 16px;
}
}
</style>
2. Updated HTML Structure
<section class="about-section" aria-labelledby="mission-vision">
<!-- Decorative Gradient Lines -->
<div class="connecting-line line-center"></div>
<div class="connecting-line line-cellular-integrated"></div>
<div class="connecting-line line-integrated-personalized"></div>
<div class="about-container" id="mission-vision">
<!-- Cellular Medicine Card -->
<div class="about-card" tabindex="0" aria-labelledby="cellular-medicine-title" role="button">
<!-- Cellular Medicine Icon -->
<svg class="about-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" aria-hidden="true" role="img">
<title id="cellular-medicine-title">Cellular Medicine Icon</title>
<path d="M32 12c-10.493 0-19 8.507-19 19s8.507 19 19 19 19-8.507 19-19-8.507-19-19-19zm0 34c-8.822 0-16-7.178-16-16s7.178-16 16-16 16 7.178 16 16-7.178 16-16 16z"/>
<path d="M32 22c-5.523 0-10 4.477-10 10s4.477 10 10 10 10-4.477 10-10-4.477-10-10-10zm0 16c-3.314 0-6-2.686-6-6s2.686-6 6-6 6 2.686 6 6-2.686 6-6 6z"/>
</svg>
<h2 class="about-title" id="cellular-medicine-title">Cellular Medicine</h2>
<p class="about-text">
Enhanced multifaceted treatments at the cellular level.
</p>
</div>
<!-- Integrated Approach Card -->
<div class="about-card" tabindex="0" aria-labelledby="integrated-approach-title" role="button">
<!-- Integrated Approach Icon -->
<svg class="about-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" aria-hidden="true" role="img">
<title id="integrated-approach-title">Integrated Approach Icon</title>
<path d="M32 12C15.663 12 1.327 24 1.327 24S15.663 36 32 36s30.673-12 30.673-12S48.337 12 32 12zm0 20c-6.627 0-12-5.373-12-12S25.373 8 32 8s12 5.373 12 12-5.373 12-12 12z"/>
<path d="M32 22c-5.523 0-10 4.477-10 10s4.477 10 10 10 10-4.477 10-10-4.477-10-10-10zm0 16c-3.314 0-6-2.686-6-6s2.686-6 6-6 6 2.686 6 6-2.686 6-6 6z"/>
</svg>
<h2 class="about-title" id="integrated-approach-title">Integrated Approach</h2>
<p class="about-text">
Customized care that addresses the unique needs of patients.
</p>
</div>
<!-- Personalized Medicine Card -->
<div class="about-card" tabindex="0" aria-labelledby="personalized-medicine-title" role="button">
<!-- Personalized Medicine Icon -->
<svg class="about-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" aria-hidden="true" role="img">
<title id="personalized-medicine-title">Personalized Medicine Icon</title>
<path d="M32 12C15.663 12 1.327 24 1.327 24S15.663 36 32 36s30.673-12 30.673-12S48.337 12 32 12zm0 20c-6.627 0-12-5.373-12-12S25.373 8 32 8s12 5.373 12 12-5.373 12-12 12z"/>
<path d="M32 22c-5.523 0-10 4.477-10 10s4.477 10 10 10 10-4.477 10-10-4.477-10-10-10zm0 16c-3.314 0-6-2.686-6-6s2.686-6 6-6 6 2.686 6 6-2.686 6-6 6z"/>
</svg>
<h2 class="about-title" id="personalized-medicine-title">Personalized Medicine</h2>
<p class="about-text">
Precision outcome-driven healthcare solutions.
</p>
</div>
</div>
<!-- Central Overlap Text -->
<div class="about-central-text">
Most advanced & individualized care possible
</div>
</section>
3. Key Improvements and Enhancements
-
Accessibility Enhancements:
- ARIA Labels and Roles: Added
aria-labelledby, role="button", and tabindex="0" to .about-card elements to make them accessible via keyboard and assistive technologies.
- SVG Titles: Included
<title> within each SVG for descriptive icons.
-
Responsive Design Improvements:
- Flex Direction: Adjusted
flex-direction and alignment for better responsiveness across devices.
- Central Text Positioning: Ensured that the central text adapts gracefully on different screen sizes.
-
Visual and UX Enhancements:
- Hover Effects: Improved hover animations for cards and text to provide visual feedback.
- Box Shadows and Border Radius: Enhanced shadows and increased border radius for a more modern and polished look.
- Cursor Pointer: Changed the cursor to pointer on hover to indicate interactivity.
-
Animation Enhancements:
- Initial Transform for Animation: Added
transform: translateY(20px); to .about-card for a smoother slide-up effect during the fade-in animation.
-
Consistency and Readability:
- Font Weight: Made titles bold for better readability.
- Text Colors: Ensured text colors transition smoothly on hover for better user experience.
-
SVG Icons:
- Distinct Icons: While the provided SVG paths were identical, it's recommended to use unique SVGs for each card to represent different concepts accurately. Replace the placeholder paths with appropriate icons as needed.
-
Central Overlap Text Styling:
- Positioning: Positioned centrally with appropriate z-index and padding to ensure it stands out without obstructing the cards.
-
Semantic HTML:
- Sectioning: Used semantic elements and proper heading hierarchy for better SEO and accessibility.
4. Recommendations for Further Enhancements
-
Unique Icons:
- Ensure each
.about-icon has a unique SVG that accurately represents the card's theme (e.g., different icons for Cellular Medicine, Integrated Approach, and Personalized Medicine).
-
Interactive Elements:
- If the cards are clickable or link to more information, consider wrapping them in anchor (
<a>) tags or adding JavaScript to handle interactions.
-
Dark Mode Support:
- Introduce CSS variables or media queries to support dark mode for users who prefer it.
-
Accessibility Testing:
- Use tools like Lighthouse or aXe to test and ensure all accessibility standards are met.
-
Performance Optimization:
- Optimize SVGs and consider using sprite sheets or icon fonts for better performance.
-
Enhanced Animations:
- Introduce more subtle animations, such as staggered fade-ins for each card, to enhance the user experience without overwhelming the user.
5. Final Thoughts
The updated code ensures a modern, responsive, and accessible design while keeping your original color palette and font choices. Feel free to adjust the SVG paths with more representative icons and tweak the styles further to match your specific design vision.
If you have any specific changes or additional features in mind, let me know, and I can assist you further!