<div class="demo demo-1-2" style="margin-top: 2rem">
<div class="progress">
<div class="progress__value"></div>
</div>
</div>
<div class="demo demo-1-3" style="margin-top: 2rem">
<div class="progress">
<div class="progress__value"><span></span></div>
</div>
</div>
.demo {
--progress: 50%;
}
.demo-1-2 {
display: flex;
justify-content: center;
.progress {
position: relative;
width: 300px;
background-color: #d3eef7;
height: 16px;
border-radius: 100px;
display: flex;
align-items: center;
overflow: hidden;
}
.progress__value {
--progress-thumb-width: 40px;
position: absolute;
left: clamp(
0%,
var(--progress),
var(--progress) - var(--progress-thumb-width)
);
top: 0;
width: var(--progress-thumb-width);
height: 16px;
background-color: #4555b2;
border-radius: 100px;
box-shadow: 0 3px 10px 0 rgba(#4555b2, 0.5);
}
}
.demo-1-3 {
display: flex;
justify-content: center;
.progress {
position: relative;
width: 300px;
background-color: #d3eef7;
height: 16px;
border-radius: 100px;
display: flex;
align-items: center;
}
.progress__value {
--progress-thumb-width: 60px;
position: absolute;
left: 0;
top: 0;
width: clamp(9px, var(--progress), var(--progress) - 10px);
height: 16px;
background-color: #4555b2;
border-radius: 100px;
box-shadow: 0 3px 10px 0 rgba(#4555b2, 0.5);
span {
position: absolute;
right: -10px;
top: -2px;
width: 20px;
height: 20px;
background-color: #222;
border-radius: 50%;
}
}
}
.demo-2 {
max-width: clamp(40ch, 65ch + 2vw, 80ch);
margin: 1rem auto;
p + p {
margin-top: 1rem;
}
}
.hero {
display: flex;
flex-direction: column;
align-items: center;
min-height: clamp(250px, 50vmax, 600px);
background-color: #fff4e5;
padding: 2rem 1rem;
text-align: center;
@media (min-width: 850px) {
flex-direction: row;
justify-content: center;
text-align: initial;
}
> * {
flex: 1;
}
h2,
p {
all: revert;
margin: 0;
}
h2 {
font-size: clamp(1rem, 5vw, 2rem);
margin-bottom: clamp(0.7rem, 2vw, 1rem);
}
.content {
display: flex;
flex-direction: column;
justify-content: center;
padding: 1rem;
}
.visual {
position: relative;
flex: 1.5;
outline: solid 2px rgba(#000, 0.25);
text-align: center;
width: 100%;
max-width: 600px;
border-radius: 20px;
}
img {
border-radius: 12px;
}
.phone {
margin: auto;
width: clamp(11.25rem, 10.341rem + 4.55vw, 13.75rem);
height: auto;
}
.thumb {
position: absolute;
width: clamp(70px, 80px + 15%, 180px);
aspect-ratio: 4 / 3;
object-fit: cover;
box-shadow: 0 3px 10px 0 rgba(#000, 0.2);
}
.thumb-1 {
left: 13%;
left: clamp(1.25rem, -0.341rem + 7.95vw, 5.625rem);
top: 45%;
}
.thumb-2 {
right: 13%;
top: 15%;
}
&.no-clamp {
.thumb {
width: 180px;
}
}
}
*,
*:before,
*:after {
box-sizing: border-box;
}
body {
font-family: "Inter", sans-serif;
line-height: 1.5;
display: flex;
flex-direction: column;
gap: 3rem 0;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.