css绘制一个逼真手机效果代码

代码语言:html

所属分类:布局界面

代码描述:css绘制一个逼真手机效果代码

代码标签: 逼真 手机 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<html>
<head>
<style>
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700");
body {
  background-image: linear-gradient(45deg, #6e6f74, #202022);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: 'Open Sans', sans-serif;
}
.background-panels {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: 1800px;
  border: 2px solid #0f0f0f;
  flex-wrap: wrap;
  transform: translate(-50%, -50%) rotate(-30deg) skewX(30deg);
}
.background-panels div {
  height: 500px;
  width: 580px;
  border: 2px solid #0f0f0f;
  box-shadow: inset 3px 0 0px -1px #4b4c4f, inset 0 -3px 1px -1px #424346, inset 0 -4px 0 -1px #353639, inset 5px 0 1px -1px rgba(182,182,190,0.6), inset 0 -5px 1px -1px rgba(182,182,190,0.2);
}
.phone {
  position: absolute;
  left: calc(50% - 8px);
  top: calc(50% - 2px);
  transform: translate(-50%, -50%) rotate(-30deg) skewX(30deg);
}
@media screen and (max-width: 1400px) {
  .phone {
    transform: translate(-50%, -50%) rotate(-30deg) skewX(30deg) scale(0.8);
  }
}
.phone-back {
  position: absolute;
  top: -3px;
  transform: translate(-50%, -50%);
  height: 734px;
  width: 430px;
  background-image: linear-gradient(to bottom, #3a3b3f 70%, #1d1d1f);
  border-radius: 74px 40px 84px 50px;
  box-shadow: -26px 8px 8px -10px rgba(0,0,0,0.3), -6px 6px 6px 0 rgba(0,0,0,0.6), -30px 14px 10px -10px rgba(0,0,0,0.5), -20px 40px 8px 0 rgba(0,0,0,0.1), -20px 30px 8px 0 rgba(0,0,0,0.1), inset 20px 0 15px -6px rgba(0,0,0,0.6), inset 2px 0 4px -2px rgba(0,0,0,0.6), inset 2px 0 1px -2px rgba(255,255,255,0.1), inset 0 -15px 10px -10px rgba(255,255,255,0.15);
}
.phone-back:before {
  content: "";
  display: block;
  height: 300px;
  width: 100px;
  position: absolute;
  background-color: #fff;
  left: 16px;
  bottom: 40px;
  border-radius: 20px;
  filter: blur(5px);
  opacity: 0.1;
  transform: rotate(4deg);
}
.phone-back:after {
  content: "";
  display: block;
  height: 300px;
  width: 100px;
  position: absolute;
  background-color: #fff;
  left: 26px;
  bottom: 40px;
  border-radius: 20px;
  filter: blur(4px);
  opacity: 0.25;
  transform: rotate(2deg);
}
.phone-screen {
  position: absolute;
  top: -16px;
  left: 14px;
  transform: translate(-50%, -50%);
  height: 710px;
  width: 400px;
  background-color: #000;
  border-radius: 48px 40px 52px 45px;
  box-shadow: -2px 0 0px -1px rgba(255,255,255,0.4), -1px 3px 3px -3px rgba(255,255,255,0.7);
}
.phone-display {
  position: absolute;
  z-index: 1;
  top: -23px;
  left: 20px;
  transform: translate(-50%, -50%);
  height: 690px;
  width: 378px;
  background-color: #fbfbfb;
  border-radius: 45px 37px 41px 41px;
}
.phone-notch {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translate(-50%);
  width: 210px;
  background-color: #131313;
  border-top: 6px solid #000;
  height: 21px;
  z-index: 3;
  border-radius: 0 0 20px 20px;
}
.phone-notch:after {
  content: "";
  display: block;
  height: 12px;
  width: 12px;
  background-color: transparent;
  position: absolute;
  left: -12px;
  top: -5px;
  border-radius: 50%;
  box-shadow: 5px -5px 0 -3px #000;
}
.phone-notch:before {
  content: "";
  display: block;
  height: 12px;
  width: 12px;
  background-color: transparent;
  position: absolute;
  right: -12px;
  top: -5px;
  border-radius: 50%;
  box-shadow: -4px -4px 0 -3px #000;
}
.phone-speaker {
  position: absolute;
  top: 6px;
  width: 58px;
  height: 6px;
  border-radius: 20px;
  background-color: #2b2b2b;
  overflow: hidden;
  box-shadow: 0 0 0 1px #363637, inset -3px 3px 1px 0px #000, inset -3px 4px 0px -1px rgba(255,255,255,0.5);
  left: 50%;
  transform: translateX(-50%);
}
.phone-speaker:after {
  content: "";
  display: block;
  height: 4px;
  width: 4px;
  background-color: #87888c;
  position: absolute;
  right: -1px;
  border-radius: 50%;
  top: -1px;
}
.phone-speaker:before {
  content: "";
  display: block;
  height: 4px;
  width: 4px;
  background-color: #898a8e;
  position: absolute;
  right: -2px;
  border-radius: 50%;
  top: 4px;
}
.phone-left-side {
  position: absolute;
  left: 0;
  top: 60px;
  width: 30px;
  height: 100%;
}
.phone-left-side .phone-antena {
  position: absolute;
  height: 20px;
  width: 50px;
  left: -5px;
  top: 10px;
  border-radius: 50%;
  transform: rotate(-40deg) skewX(20deg);
  background-color: transparent;
  box-shadow: 0px -2px 1p.........完整代码请登录后点击上方下载按钮下载查看

网友评论0