JSFiddle - React, Tailwind, and code Playground

by sathish panduga p

HTML

<div class="clickshowinfo" data-id="100">Click show info</div>
<div class="global-message-container">

  <div class="chat-container">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It
   </div>
  <div class="user-info">
      <div class="user-info-in"><div class="cc">Close</div>Showing info</div>
  </div>
</div>

CSS

body{
    background-color:#000;
}
.clickshowinfo{
  margin:0px auto;
  width:150px;
  margin-top:10px;
  cursor:pointer;
  background-color:Red;
}
.global-message-container {
  display: block;
  position: absolute;
  height: auto;
  bottom: 0;
  top: 0;
  left: 0;
  right: 0;
  max-width: 980px;
  min-width:300px;
  margin-top: 80px;
  margin-bottom: 20px;
  margin-right: auto;
  margin-left: auto;
  background-color: green;
  box-shadow: 0 1px 1px 0 rgba(0,0,0,.06),0 2px 5px 0 rgba(0,0,0,.2);
  -webkit-box-shadow: rgba(0, 0, 0, 0.0588235) 0px 1px 1px 0px, rgba(0, 0, 0, 0.2) 0px 2px 5px 0px;
  border-radius: 3px;
  -webkit-border-radius: 3px;
  -o-border-radius: 3px;
  -moz-border-radius: 3px;
  min-height: 140px;
}
.chat-list-container {
  display: block;
  position: absolute;
  float: left;
  width: 30%;
  overflow: hidden;
  padding: 0px;
  bottom: 0;
  top: 0;
  left: 0;
  background-color: yellow;
  border-right: 1px solid #d8dbdf;
  -webkit-border-top-left-radius: 3px;
  -webkit-border-bottom-left-radius: 3px;
  -moz-border-radius-topleft: 3px;
  -moz-border-radius-bottomleft: 3px;
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
  transition: opacity 2s, width 2s, left 2s, font-size 2s, color 2s;
}
.chat-container {
  display: block;
  position: absolute;
  width: 70%;
  bottom: 0;
  top: 0;
  right: 0;
  background-color: #f7f9fa;
  -webkit-border-top-right-radius: 3px;
  -webkit-border-bottom-right-radius: 3px;
  -moz-border-radius-topright: 3px;
  -moz-border-radius-bottomright: 3px;
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
}
@media all and (max-width: 640px){
  .chat-list-container {
    display:none;
  }
  .secret{
    float:left;
    display:block;
  }
  .chat-container{
    width:100%;
  }
}
.user-info {
	  transform: translateX(0px);
    right: 0!important;
    left: auto;
	-webkit-box-flex: 0;
  -webkit-flex: 0 0 auto;
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
  right: auto;
  z-index: 1000!important;
 ...

JavaScript

$(".clickshowinfo").click(function(){
    var id = $(this).data("id");
    $(".user-info").animate({width:"80%"}, 300).find(".user-info-in").animate({width:"100%"}, 300);   
});

$(".user-info").click(function(){
    $(".user-info-in").animate({width:"0%"},300);
    $(".user-info").animate({width:"0%"},300);      
});

$(".cc").click(function(e){ 
    e.stopPropagation();
    
});