پیشنمایش زنده
کد HTML
<div class="phone-card">
<div class="phone">
<div class="front-cam"></div>
<div class="side-buttons">
<div class="side-btn top"></div>
<div class="side-btn bottom"></div>
</div>
<input type="checkbox" id="toggleScreen" hidden="" />
<label class="screen" for="toggleScreen"></label>
</div>
</div>
کد CSS
.phone-card {
width: 180px;
margin: 0 auto;
transform: scale(1);
transition: transform 0.3s ease;
}
.phone {
position: relative;
width: 80%;
height: 250px;
background-color: #fff6ee;
border-radius: 20px;
box-shadow: inset -4px -4px 10px rgba(0, 0, 0, 0.2);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.front-cam {
position: absolute;
width: 7px;
height: 7px;
background: gray;
border-radius: 50%;
top: 8px;
left: 50%;
transform: translateX(-50%);
z-index: 2;
}
.side-buttons {
position: absolute;
top: 18%;
right: -3px;
display: flex;
flex-direction: column;
gap: 4px;
}
.side-btn {
width: 4px;
height: 18px;
background-color: pink;
border-radius: 0 50px 50px 0;
box-shadow: inset -2px -2px 5px rgba(0, 0, 0, 0.2);
}
.side-btn.bottom {
background-color: #f4a6c4;
}
.screen {
width: 88%;
height: 85%;
background-color: #383838;
border: 2px solid lightgray;
border-radius: 12px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
transition: background 0.4s ease;
cursor: pointer;
}
#toggleScreen:checked + .screen {
background: linear-gradient(135deg, #ffd6e0, #cce7ff, #fff4c2);
}