Modern responsive layout with two distinct sections
This is the left side of the split screen layout with a gradient background.
This is the right side with a contrasting background and different content.
<div class="split-screen-container">
<div class="split-screen">
<div class="split-screen-half split-screen-left">
<div class="split-screen-content">
<h2 class="split-screen-title">Left Panel</h2>
<p class="split-screen-text">This is the left side of the split screen layout with a gradient background.</p>
<button class="split-screen-button split-screen-button-primary">Primary Action</button>
</div>
</div>
<div class="split-screen-half split-screen-right">
<div class="split-screen-content">
<h2 class="split-screen-title">Right Panel</h2>
<p class="split-screen-text">This is the right side with a contrasting background and different content.</p>
<button class="split-screen-button split-screen-button-secondary">Secondary Action</button>
</div>
</div>
</div>
</div>
.split-screen-container {
width: 100%;
max-width: 1200px;
margin: 0 auto;
overflow: hidden;
border-radius: 8px;
background-color: #fff;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}
.split-screen {
display: flex;
flex-direction: row;
min-height: 400px;
}
.split-screen-half {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 40px;
transition: all 0.3s ease;
}
.split-screen-left {
background: linear-gradient(135deg, #6a11cb, #2575fc);
color: white;
}
.split-screen-right {
background-color: #fff;
color: #333;
border-left: 1px solid #eee;
}
.split-screen-content {
max-width: 400px;
text-align: center;
}
.split-screen-title {
font-size: 24px;
font-weight: 600;
margin-bottom: 20px;
}
.split-screen-text {
margin-bottom: 25px;
line-height: 1.6;
}
.split-screen-button {
padding: 10px 20px;
border-radius: 4px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
border: none;
}
.split-screen-button-primary {
background-color: white;
color: #6a11cb;
}
.split-screen-button-primary:hover {
background-color: rgba(255, 255, 255, 0.9);
transform: translateY(-2px);
}
.split-screen-button-secondary {
background-color: #2575fc;
color: white;
}
.split-screen-button-secondary:hover {
background-color: #1c68e3;
transform: translateY(-2px);
}
/* Dark mode styles */
@media (prefers-color-scheme: dark) {
.split-screen-container {
background-color: #222;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.split-screen-right {
background-color: #222;
color: #fff;
border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.split-screen-left {
background: linear-gradient(135deg, #8a3eff, #3a7bd5);
}
}
/* Responsive styles */
@media (max-width: 768px) {
.split-screen {
flex-direction: column;
}
.split-screen-half {
padding: 30px;
}
.split-screen-right {
border-left: none;
border-top: 1px solid #eee;
}
@media (prefers-color-scheme: dark) {
.split-screen-right {
border-left: none;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
}
}
// Optional JavaScript for enhanced hover effects or animations
document.addEventListener('DOMContentLoaded', function() {
const leftPanel = document.querySelector('.split-screen-left');
const rightPanel = document.querySelector('.split-screen-right');
if (leftPanel && rightPanel) {
leftPanel.addEventListener('mouseenter', function() {
// Add a subtle grow effect on hover
this.style.flex = '1.2';
rightPanel.style.flex = '0.8';
});
leftPanel.addEventListener('mouseleave', function() {
// Reset to normal on mouse leave
this.style.flex = '1';
rightPanel.style.flex = '1';
});
rightPanel.addEventListener('mouseenter', function() {
// Add a subtle grow effect on hover
this.style.flex = '1.2';
leftPanel.style.flex = '0.8';
});
rightPanel.addEventListener('mouseleave', function() {
// Reset to normal on mouse leave
this.style.flex = '1';
leftPanel.style.flex = '1';
});
}
});