CSS Message Box Icons

CSS Message Box Icons

HTML
<div class="phone">
  <div class="phone-top">
    <div class="camera"></div> 
  </div>
  <div class="phone-body">
      <div class="green-box">
        <div class="message-box">
           <div class="message-row"></div>
           <div class="message-row"></div> 
           <div class="message-row"></div> 
           <div class="message-row"></div> 
        </div> 
    </div>
      <div class="pink-box">
        <div class="message-box">
           <div class="message-row"></div>
           <div class="message-row"></div> 
           <div class="message-row"></div> 
           <div class="message-row"></div> 
        </div> 
    </div>
  </div>
  <div class="phone-bottom"></div>
</div>
SCSS
.phone{
  position: absolute;
  top: 50%;
  left: 50%;
  transform:  translate(-50%,-50%);
  width: 200px; 
  .phone-top{
    background: #93a3af;
    height: 50px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: inset -15px 0px #7a8c98;
    display: flex;
    align-items: center;
    justify-content: center;
    .camera{
      background: #7a8c98;
      border-radius: 20px;
      width: 50px;
      height: 15px; 
    }
  }
  .phone-body{
     background: #ebeef2;
     box-shadow: inset -15px 0px #d3d8df;
     height: 270px;
     display: flex;
     align-items:center;
     position: relative;
    .green-box{
      background: #4fceb7;
      width: 220px;
      height: 120px;
      border-radius: 10px;
      position: absolute;
      top: 60%;
      transform: translateY(-60%);
      left: -100px;
      z-index: 1;
      &:after{
        content:'';
        position: absolute;
        top: 100%;
        right: 20%; 
        border-top: solid 20px #4fceb7;
        border-left: solid 20px transparent;
        border-right: solid 20px transparent;
      }
      .message-box{
        position: absolute;
        top: 50%;
        left: 20%;
        transform: translate(-20%,-50%); 
        .message-row{
         background: #3db5a0;
         height: 12px;
         margin: 10px 0px;
         border-radius: 10px;
         &:first-child{
           width: 100px;
         }
         &:nth-child(2){
           width: 80px;
         }
         &:nth-child(3){
           width: 90px;
         }
         &:last-child{
           width: 70px;
         }
       } 
      }
    }
    .pink-box{
      background: #eb5776;
      width: 220px;
      height: 120px;
      border-radius: 10px;
      position: absolute;
      top: 30%;
      transform: translateY(-30%);
      right: -100px;
      z-index: 2; 
      &:after{
        content:'';
        position: absolute;
        top: 100%;
        left: 15%; 
        border-top: solid 20px #eb5776;
        border-left: solid 20px transparent;
        border-right: solid 20px transparent;
       }
      .message-box{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        width: 80%;
        .message-row{
          background: #ce3f63;
          height: 12px;
          margin: 10px 0px;
          border-radius: 10px;
          &:first-child{
            width: 90%;
          }
          &:nth-child(2){
            width: 70%;
          }
          &:nth-child(3){
            width: 80%;
          }
          &:last-child{
            width: 60%;
          }
        } 
      }
    }
  }
  .phone-bottom{
    background: #93a3af;
    height: 50px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: inset -15px 0px #7a8c98;
  }
}
524 Views
64800cookie-checkCSS Message Box Icons

Leave a Reply

Your email address will not be published. Required fields are marked *