Pixel 2 XL

In this example below you will see how to do a Pixel 2 XL with some HTML / CSS and Javascript

Pixel 2 XL White Edition using CSS

Thumbnail
This awesome code was written by AsyrafHussin, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright AsyrafHussin ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Pixel 2 XL</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div class="pixel2-xl">
  <div class="bazzel">
    <div class="screen"></div>
  </div>
  <div class="header">
    <div class="sensors"></div>
  </div>
  <div class="volume"></div>
  <div class="power"></div>
</div>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/AsyrafHussin/pixel-2-xl-rGRXKy */
/*------------------------------------------------*/
body {
  display: flex;
  justify-content: center;
  padding: 5%;
}

.pixel2-xl {
  z-index: 1;
  position: relative;
  height: 744px;
  width: 360px;
}
.pixel2-xl *, .pixel2-xl *::before, .pixel2-xl *::after {
  box-sizing: border-box;
  display: block;
}
.pixel2-xl .bazzel {
  height: 740px;
  width: 360px;
  padding: 51px 20px;
  background: #121212;
  border-radius: 36px;
  box-shadow: inset 0 0 0 2px #bfbfbf, inset 0 0 0 6px #f2f2f2;
}
.pixel2-xl .screen {
  height: 650px;
  width: 320px;
  background: url("https://www.nibbleng.com/wp-content/uploads/2017/10/Pixel-2-wallpaper.jpg") no-repeat;
  background-position: center center;
  background-size: cover;
  border-radius: 24px;
  position: relative;
}
.pixel2-xl .header {
  height: 720px;
  width: 349px;
  left: 50%;
  top: 0;
  z-index: 199;
  position: absolute;
  border-radius: 40px;
  margin: 15px 0 0 -175px;
  background: transparent;
  box-shadow: 0 -10px 10px -10px #bfbfbf;
  border-bottom: 8px solid #2c2c2c;
}
.pixel2-xl .header::after {
  content: "";
  position: absolute;
  height: 5px;
  width: 130px;
  background: #333;
  border-radius: 2.5px;
  margin: -15px 0 0 -65px;
  left: 50%;
  top: 20px;
}
.pixel2-xl .header::before {
  content: "";
  position: absolute;
  height: 5px;
  width: 130px;
  background: #333;
  border-radius: 2.5px;
  margin: 0 0 0 -65px;
  left: 50%;
  bottom: 0px;
}
.pixel2-xl .sensors::before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;
  background: #333;
  border-radius: 5px;
  margin: -20px 0 0 50px;
  left: 0;
  top: 32px;
}
.pixel2-xl .volume {
  background: #bfbfbf;
  height: 94px;
  position: absolute;
  right: -2px;
  top: 274px;
  width: 3px;
}
.pixel2-xl .power {
  background: #ec865a;
  height: 48px;
  position: absolute;
  right: -2px;
  top: 174px;
  width: 3px;
}

Comments