Web Animations Medium
Split Screen Reveal
Two-panel layout where right scene reveals progressively on scroll.
scrollcss-clip-path
Targets: JS HTML
Code
:root {
--bg: #040913;
--bg-soft: #091a35;
--text: #edf4ff;
--muted: #b5c8e8;
--line: rgba(178, 203, 244, 0.24);
--accent-cyan: #86e7ff;
--accent-blue: #4f7fff;
--accent-gold: #ffbe78;
--split-progress: 0;
--split-reveal: 8%;
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
min-height: 100%;
}
body {
font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
color: var(--text);
background:
radial-gradient(circle at 9% 8%, rgba(134, 231, 255, 0.11), transparent 34%),
radial-gradient(circle at 88% 86%, rgba(255, 190, 120, 0.1), transparent 38%),
linear-gradient(180deg, #061025 0%, var(--bg) 64%);
overflow-x: clip;
}
.back {
position: fixed;
left: 14px;
top: 12px;
z-index: 35;
display: inline-flex;
align-items: center;
gap: 0.35rem;
border-radius: 999px;
border: 1px solid rgba(255, 255, 255, 0.22);
padding: 0.38rem 0.7rem;
color: #dff0ff;
background: rgba(7, 14, 28, 0.72);
text-decoration: none;
font-size: 0.78rem;
font-weight: 600;
backdrop-filter: blur(8px);
}
.scroll-track {
min-height: 280vh;
}
.sticky-shell {
position: sticky;
top: 0;
height: 100vh;
display: grid;
grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
}
.panel {
min-height: 100vh;
position: relative;
}
.left-panel {
padding: clamp(4.2rem, 8vw, 5.6rem) clamp(1.1rem, 4vw, 3.2rem) clamp(2rem, 4vw, 3rem);
border-right: 1px solid rgba(255, 255, 255, 0.08);
background:
linear-gradient(120deg, rgba(10, 28, 57, 0.9), rgba(6, 16, 33, 0.9)),
linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 58%);
display: grid;
align-content: start;
gap: 1.15rem;
}
.eyebrow {
margin: 0;
letter-spacing: 0.12em;
text-transform: uppercase;
color: #c5ddfc;
font-size: 0.72rem;
}
.left-panel h1 {
margin: 0;
font-size: clamp(2rem, 5.6vw, 3.8rem);
line-height: 0.95;
letter-spacing: -0.02em;
}
.lead {
margin: 0;
max-width: 52ch;
color: var(--muted);
line-height: 1.62;
}
.progress-wrap {
margin-top: 0.2rem;
display: grid;
gap: 0.52rem;
}
.progress-bar {
width: min(480px, 100%);
height: 9px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.11);
border: 1px solid rgba(255, 255, 255, 0.18);
overflow: hidden;
}
.progress-fill {
display: block;
height: 100%;
width: var(--split-reveal);
min-width: 8%;
border-radius: inherit;
background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue), var(--accent-gold));
box-shadow: 0 0 16px rgba(134, 231, 255, 0.55);
transition: width 140ms linear;
}
.progress-label {
margin: 0;
color: #d0e2fb;
font-size: 0.88rem;
}
#progressLabel {
font-weight: 700;
color: #f7fbff;
}
.story-steps {
list-style: none;
padding: 0;
margin: 0.2rem 0 0;
display: grid;
gap: 0.62rem;
}
.story-step {
border-radius: 14px;
border: 1px solid var(--line);
background: rgba(12, 26, 50, 0.56);
padding: 0.75rem 0.8rem;
opacity: 0.62;
transform: translateX(0);
transition: opacity 260ms ease, border-color 260ms ease, transform 260ms ease, background 260ms ease;
}
.story-step.active {
opacity: 1;
border-color: rgba(134, 231, 255, 0.46);
background: rgba(16, 33, 63, 0.86);
transform: translateX(4px);
}
.story-step h2 {
margin: 0;
font-size: 0.95rem;
}
.story-step p {
margin: 0.35rem 0 0;
color: var(--muted);
line-height: 1.45;
font-size: 0.83rem;
}
.right-panel {
background: linear-gradient(165deg, #101f3f, #0a1730 62%, #081426);
overflow: hidden;
}
.right-mask {
position: absolute;
inset: 0;
clip-path: inset(0 calc(100% - var(--split-reveal)) 0 0);
transition: clip-path 130ms linear;
border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.right-atmosphere {
position: absolute;
inset: 0;
pointer-events: none;
}
.blob {
position: absolute;
border-radius: 999px;
filter: blur(30px);
opacity: 0.42;
}
.blob-a {
width: 240px;
height: 240px;
top: 10%;
left: 14%;
background: rgba(134, 231, 255, 0.44);
}
.blob-b {
width: 300px;
height: 300px;
top: 45%;
left: 46%;
background: rgba(79, 127, 255, 0.34);
}
.blob-c {
width: 220px;
height: 220px;
top: 62%;
left: 10%;
background: rgba(255, 190, 120, 0.28);
}
.blob-d {
width: 170px;
height: 170px;
top: 24%;
left: 68%;
background: rgba(190, 150, 255, 0.26);
}
.right-content {
position: relative;
z-index: 2;
height: 100%;
padding: clamp(4.1rem, 7vw, 5.2rem) clamp(1rem, 4vw, 2.4rem) 2.2rem;
display: grid;
gap: 1rem;
align-content: start;
opacity: calc(0.5 + (var(--split-progress) * 0.5));
transform: translate3d(calc((1 - var(--split-progress)) * 30px), calc((1 - var(--split-progress)) * 10px), 0);
transition: transform 220ms linear, opacity 220ms linear;
}
.board-head {
display: grid;
gap: 0.48rem;
}
.board-kicker {
margin: 0;
letter-spacing: 0.12em;
text-transform: uppercase;
font-size: 0.7rem;
color: #cbe4ff;
}
.board-head h2 {
margin: 0;
font-size: clamp(1.35rem, 3vw, 2.2rem);
}
.board-head p {
margin: 0;
color: var(--muted);
line-height: 1.55;
}
.board-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.62rem;
}
.tile {
border-radius: 15px;
border: 1px solid var(--line);
background: rgba(8, 17, 34, 0.62);
padding: 0.72rem;
display: grid;
gap: 0.44rem;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
transform: translateY(calc((1 - var(--split-progress)) * 12px));
transition: transform 220ms linear, border-color 220ms linear;
}
.tile:hover {
border-color: rgba(134, 231, 255, 0.48);
}
.tile-large {
grid-column: 1 / -1;
}
.tile-label {
margin: 0;
color: #9fd5ff;
text-transform: uppercase;
letter-spacing: 0.08em;
font-size: 0.67rem;
}
.tile h3 {
margin: 0;
font-size: 1rem;
}
.tile p {
margin: 0;
color: var(--muted);
font-size: 0.84rem;
line-height: 1.48;
}
.reveal-line {
position: absolute;
top: 0;
left: calc(var(--split-reveal) * 1);
width: 2px;
height: 100%;
background: linear-gradient(180deg, rgba(134, 231, 255, 0), rgba(134, 231, 255, 0.85), rgba(134, 231, 255, 0));
box-shadow: 0 0 18px rgba(134, 231, 255, 0.66);
pointer-events: none;
}
.reveal-line::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 10px;
height: 10px;
transform: translate(-50%, -50%);
border-radius: 50%;
background: #d2f6ff;
box-shadow: 0 0 18px rgba(134, 231, 255, 0.9);
}
html.global-reduce-motion .progress-fill,
html.global-reduce-motion .right-mask,
html.global-reduce-motion .story-step,
html.global-reduce-motion .right-content,
html.global-reduce-motion .tile {
transition: none !important;
}
@media (max-width: 1000px) {
.sticky-shell {
grid-template-columns: 1fr;
position: relative;
height: auto;
}
.scroll-track {
min-height: 100%;
}
.panel {
min-height: auto;
}
.left-panel {
border-right: 0;
min-height: 68vh;
padding-top: 4.8rem;
}
.right-panel {
min-height: 74vh;
}
.right-mask {
clip-path: none;
border-left: 0;
}
.reveal-line {
display: none;
}
.right-content,
.tile {
opacity: 1;
transform: none;
}
}
@media (max-width: 640px) {
.board-grid {
grid-template-columns: 1fr;
}
.tile-large {
grid-column: auto;
}
}Split Screen Reveal
Two-panel layout where right scene reveals progressively on scroll.
Source
- Repository:
libs-gen - Original demo id:
08-split-screen-reveal
Notes
Two-panel layout where right scene reveals progressively on scroll.