JSFiddle - React, Tailwind, and code Playground
HTML
<div id="iphone-x" class="container grid-xl text-center">
<h3 class="s-title">iPhone X</h3>
<div class="columns">
<div class="column col-12">
<div class="device device-iphone-x">
<div class="device-frame">
<img src="https://picsum.photos/375/812" class="img">
</div>
<div class="device-stripe"></div>
<div class="device-header"></div>
<div class="device-sensors"></div>
<div class="device-btns"></div>
<div class="device-power"></div>
<div class="device-home"></div>
</div>
</div>
</div>
CSS
/*! Devices.css v0.1.16 | MIT License | github.com/picturepan2/devices.css */
.device,
.device::before,
.device::after,
.device *,
.device *::before,
.device *::after {
box-sizing: border-box;
display: block;
}
.device {
position: relative;
transform: scale(1);
z-index: 1;
}
.device .device-frame {
z-index: 1;
}
.device .device-content {
background-color: #fff;
background-position: center center;
background-size: cover;
object-fit: cover;
position: relative;
}
.device-iphone-x {
height: 868px;
width: 428px;
}
.device-iphone-x .device-frame {
background: #222;
border-radius: 68px;
box-shadow: inset 0 0 2px 2px #c8cacb, inset 0 0 0 7px #e2e3e4;
height: 868px;
padding: 28px;
width: 428px;
}
.device-iphone-x .device-content {
border-radius: 40px;
height: 812px;
width: 375px;
}
.device-iphone-x .device-stripe::after,
.device-iphone-x .device-stripe::before {
border: solid rgba(51, 51, 51, .25);
border-width: 0 7px;
content: "";
height: 7px;
left: 0;
position: absolute;
width: 100%;
z-index: 9;
}
.device-iphone-x .device-stripe::after {
top: 85px;
}
.device-iphone-x .device-stripe::before {
bottom: 85px;
}
.device-iphone-x .device-header {
background: #222;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
height: 30px;
left: 50%;
margin-left: -102px;
position: absolute;
top: 28px;
width: 204px;
}
.device-iphone-x .device-header::after,
.device-iphone-x .device-header::before {
content: "";
height: 10px;
position: absolute;
top: 0;
width: 10px;
}
.device-iphone-x .device-header::after {
background: radial-gradient(circle at bottom left, transparent 0, transparent 75%, #222 75%, #222 100%);
left: -10px;
}
.device-iphone-x .device-header::before {
background: radial-gradient(circle at bottom right, transparent 0, transparent 75%, #222 75%, #222...