Certainly! I'll provide you with the complete HTML and CSS code for the "Your Journey at Longeva" section, modified to enhance the responsive design for mobile devices. Specifically, in the mobile view:
- Removed the vertical timeline line.
- Removed the connector arrows.
- Made the content boxes expand to full width, taking up the entire screen width.
Complete HTML and CSS Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Your Journey at Longeva</title>
<!-- Font Awesome CDN for Icons -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<!-- Styles -->
<style>
/* ====================================================
Global Styles
===================================================== */
:root {
--journey-primary-color: #ffffff; /* White */
--journey-accent-color: #D1C287; /* Gold Accent */
--journey-accent-dark: #4F3F02; /* Dark Gold/Brown Accent */
--journey-font-primary: 'Poppins', sans-serif;
--journey-font-secondary: 'Roboto', sans-serif;
--journey-border-radius: 8px;
--journey-transition-speed: 0.3s;
--journey-max-container-width: 1200px;
--journey-background-color: #121212; /* Dark Background for Contrast */
--journey-section-padding: 4rem 1rem;
--journey-content-padding: 2rem;
--journey-shadow-light: rgba(0, 0, 0, 0.1);
--journey-shadow-dark: rgba(0, 0, 0, 0.2);
}
body {
margin: 0;
padding: 0;
background-color: var(--journey-background-color);
font-family: var(--journey-font-primary);
color: var(--journey-primary-color);
}
/* ====================================================
Section: Your Journey at Longeva
Unique Class Prefix: journey-
===================================================== */
/* Container for the Your Journey Section */
.journey-section {
width: 100%;
padding: var(--journey-section-padding);
font-family: var(--journey-font-primary);
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
max-width: var(--journey-max-container-width);
margin: 0 auto;
position: relative;
color: var(--journey-primary-color);
}
/* Section Title */
.journey-title {
font-size: 2.8rem;
color: var(--journey-accent-color);
margin-bottom: 1rem;
text-align: center;
position: relative;
display: inline-block;
transition: color var(--journey-transition-speed);
}
/* Decorative Line Below Title */
.journey-title::after {
content: '';
width: 70px;
height: 4px;
background: var(--journey-accent-color);
display: block;
margin: 0.5rem auto 0 auto;
border-radius: var(--journey-border-radius);
transition: width var(--journey-transition-speed), background var(--journey-transition-speed);
}
/* Hover Effect on Title Line */
.journey-title:hover::after {
width: 120px;
background: linear-gradient(135deg, #4F3F02, #D1C287);
}
/* Horizontal Divider */
.journey-divider {
margin: 2rem 0;
border: none;
height: 2px;
background: var(--journey-accent-color);
width: 60px;
border-radius: var(--journey-border-radius);
transition: background var(--journey-transition-speed);
}
/* Hover Effect on Divider */
.journey-divider:hover {
background: linear-gradient(135deg, #4F3F02, #D1C287);
}
/* Timeline Container */
.journey-timeline {
position: relative;
width: 100%;
max-width: var(--journey-max-container-width);
padding: 0 2rem;
}
/* Vertical Line */
.journey-timeline::before {
content: '';
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 4px;
height: 100%;
background: var(--journey-accent-color);
}
/* Journey Item */
.journey-item {
position: relative;
width: 50%;
padding: 1rem 2rem;
box-sizing: border-box;
}
/* Left Side */
.journey-item-left {
left: 0;
text-align: right;
}
/* Right Side */
.journey-item-right {
left: 50%;
text-align: left;
}
/* Connector Arrow */
.journey-item::after {
content: '';
position: absolute;
top: 1.5rem;
width: 0;
height: 0;
border: 10px solid transparent;
}
.journey-item-left::after {
right: -20px;
border-left-color: var(--journey-accent-color);
}
.journey-item-right::after {
left: -20px;
border-right-color: var(--journey-accent-color);
}
/* Journey Content Box */
.journey-content {
background: transparent;
padding: 1.5rem;
border-radius: var(--journey-border-radius);
box-shadow: 0 4px 15px var(--journey-shadow-light);
border: 2px solid var(--journey-accent-color);
transition: transform var(--journey-transition-speed), box-shadow var(--journey-transition-speed), border-color var(--journey-transition-speed);
position: relative;
overflow: hidden;
}
/* Hover Effect on Journey Content */
.journey-content:hover {
transform: translateY(-5px);
box-shadow: 0 8px 25px var(--journey-shadow-dark);
border-color: var(--journey-accent-dark);
/* Changed to a solid color for border to prevent gradient issues */
}
/* Journey Icon */
.journey-icon {
font-size: 3rem;
color: var(--journey-accent-color);
margin-bottom: 1rem;
transition: color var(--journey-transition-speed);
position: relative;
z-index: 1;
}
.journey-content:hover .journey-icon {
color: #ffffff;
}
/* Journey Title */
.journey-title-item {
font-size: 1.75rem;
color: var(--journey-primary-color);
margin-bottom: 0.5rem;
font-weight: 700;
transition: color var(--journey-transition-speed);
}
/* Journey Description */
.journey-description {
font-size: 1rem;
color: var(--journey-primary-color);
line-height: 1.6;
}
/* Responsive Design */
@media (max-width: 768px) {
/* Remove the vertical timeline line */
.journey-timeline::before {
display: none;
}
/* Remove connector arrows */
.journey-item::after {
display: none;
}
/* Adjust journey items to full width */
.journey-item {
width: 100%;
padding: 1rem;
text-align: left;
margin-bottom: 2rem;
}
/* Adjust journey content box */
.journey-content {
border: 2px solid var(--journey-accent-color);
}
/* Optional: Adjust icons size for mobile */
.journey-icon {
font-size: 2.5rem;
}
/* Adjust section title for better mobile visibility */
.journey-title {
font-size: 2.2rem;
}
/* Adjust divider width */
.journey-divider {
width: 40px;
}
}
@media (min-width: 1024px) {
.journey-title {
font-size: 3.8rem;
}
.journey-title-item {
font-size: 2.2rem;
}
.journey-description {
font-size: 1.2rem;
}
}
@media (min-width: 768px) and (max-width: 1023px) {
.journey-title {
font-size: 3.2rem;
}
.journey-title-item {
font-size: 1.9rem;
}
.journey-description {
font-size: 1.1rem;
}
}
</style>
</head>
<body>
<!-- Your Journey at Longeva Section -->
<section class="journey-section" id="your-journey" aria-labelledby="your-journey-title">
<h2 id="your-journey-title" class="journey-title">Your Journey at Longeva</h2>
<hr class="journey-divider">
<div class="journey-timeline">
<!-- Subsection 1: Comprehensive Personal Consultation & Advanced Diagnostic Testing -->
<div class="journey-item journey-item-left">
<div class="journey-content">
<i class="journey-icon fas fa-user-md" aria-hidden="true"></i>
<h3 class="journey-title-item">Comprehensive Personal Consultation & Advanced Diagnostic Testing</h3>
<p class="journey-description">
In-depth personal consultation, home visits, telomere testing to evaluate cellular age.
</p>
</div>
</div>
<!-- Subsection 2: Targeted Interventions & Continuous Outcome Monitoring -->
<div class="journey-item journey-item-right">
<div class="journey-content">
<i class="journey-icon fas fa-bolt" aria-hidden="true"></i>
<h3 class="journey-title-item">Targeted Interventions & Continuous Outcome Monitoring</h3>
<p class="journey-description">
Personalized health strategies, home delivery by licensed professionals under DHA supervision.
</p>
</div>
</div>
<!-- Subsection 3: Enhanced Vitality & Progress Tracking -->
<div class="journey-item journey-item-left">
<div class="journey-content">
<i class="journey-icon fas fa-heartbeat" aria-hidden="true"></i>
<h3 class="journey-title-item">Enhanced Vitality & Progress Tracking</h3>
<p class="journey-description">
Follow-up assessments, repeat telomere testing to showcase health improvements.
</p>
</div>
</div>
<!-- Subsection 4: Ongoing Support & Maintenance -->
<div class="journey-item journey-item-right">
<div class="journey-content">
<i class="journey-icon fas fa-life-ring" aria-hidden="true"></i>
<h3 class="journey-title-item">Ongoing Support & Maintenance</h3>
<p class="journey-description">
Continuous support, follow-up consultations to sustain health advancements.
</p>
</div>
</div>
</div>
</section>
</body>
</html>
Explanation of Changes:
-
Removed Vertical Timeline Line on Mobile:
@media (max-width: 768px) {
.journey-timeline::before {
display: none;
}
}
This CSS rule hides the vertical line that runs through the timeline when the screen width is 768px or less (commonly mobile devices).
-
Removed Connector Arrows on Mobile:
@media (max-width: 768px) {
.journey-item::after {
display: none;
}
}
This hides the triangular connector arrows between timeline items on mobile devices.
-
Expanded Content Boxes to Full Width:
@media (max-width: 768px) {
.journey-item {
width: 100%;
padding: 1rem;
text-align: left;
margin-bottom: 2rem;
}
}
This ensures that each journey item takes up the full width of the screen on mobile devices, providing a more streamlined and readable layout.
-
Adjusted Icon Sizes for Better Visibility on Mobile:
@media (max-width: 768px) {
.journey-icon {
font-size: 2.5rem;
}
}
This slightly reduces the icon size on mobile devices to better fit the smaller screen.
-
Adjusted Section Title and Divider for Mobile:
@media (max-width: 768px) {
.journey-title {
font-size: 2.2rem;
}
.journey-divider {
width: 40px;
}
}
These adjustments ensure that the section title and divider proportionally fit the mobile screen without appearing too large or too small.
-
Hover Effect Adjustment:
.journey-content:hover {
transform: translateY(-5px);
box-shadow: 0 8px 25px var(--journey-shadow-dark);
border-color: var(--journey-accent-dark);
}
Changed the border color on hover to a solid dark accent to prevent issues with gradients in borders, ensuring consistent styling across devices.
Result:
On desktop and larger screens, the timeline will display with a vertical line in the center, alternating left and right aligned content boxes connected by arrows.
On mobile devices (screen width 768px or less), the vertical line and connector arrows will be removed, and the content boxes will expand to full width, providing a clean and easy-to-read layout tailored for smaller screens.
Preview:
To see the responsive design in action:
-
Desktop View:
- The timeline displays vertically centered with alternating left and right positioned content boxes.
- Connector arrows point from the vertical line to each content box.
-
Mobile View:
- The vertical timeline line and connector arrows are removed.
- All content boxes are stacked vertically, each taking up the full width of the screen for optimal readability.
Feel free to integrate this code into your project. If you have any further customization requests or need additional assistance, feel free to ask!