LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code









  
CSS
#container {
  width: 500px;
  margin: auto !important;
  display: block;
  height: 500px;
  position: relative;
  list-style-type: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.buddy {
  display: none;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  color: #fff;
  padding: 20px;
  width: 360px;
  height: 360px;
  top: 50px;
  left: 50px;
  position: absolute;
  cursor: hand;
}
.rotate-left {
  transform: rotate(30deg) scale(0.8);
  transition: 1s;
  margin-left: 400px;
  cursor: e-resize;
  opacity: 0;
  z-index: 10;
}
.rotate-right {
  transform: rotate(-30deg) scale(0.8);
  transition: 1s;
  opacity: 0;
  margin-left: -400px;
  cursor: w-resize;
  z-index: 10;
}
.avatar {
  background: #222;
  width: 340px;
  height: 340px;
  display: block;
  margin-top: 10px;
  margin-left: 10px;
  background-size: auto 160% !important;
  background-position: center;
 background-repeat: no-repeat;
}
.like {
  border-radius: 5px;
  padding: 5px 10px;
  border: 2px solid green;
  color: green;
  text-transform: uppercase;
  font-size: 15px;
  position: absolute;
  top: 50px;
  right: 40px;
  text-shadow: none;
}
.dislike {
  border-radius: 5px;
  padding: 5px 10px;
  border: 2px solid red;
  color: red;
  text-transform: uppercase;
  font-size: 15px;
  position: absolute;
  top: 50px;
  left: 40px;
  text-shadow: none;
}
JS
$(document).ready(function(){

    $(".buddy").on("swiperight",function(){
      $(this).addClass('rotate-left').delay(700).fadeOut(1);
      $('.buddy').find('.status').remove();

      $(this).append('');      
      if ( $(this).is(':last-child') ) {
        $('.buddy:nth-child(1)').removeClass ('rotate-left rotate-right').fadeIn(300);
       } else {
          $(this).next().removeClass('rotate-left rotate-right').fadeIn(400);
       }
    });  

   $(".buddy").on("swipeleft",function(){
    $(this).addClass('rotate-right').delay(700).fadeOut(1);
    $('.buddy').find('.status').remove();
    $(this).append('
Dislike!
'); if ( $(this).is(':last-child') ) { $('.buddy:nth-child(1)').removeClass ('rotate-left rotate-right').fadeIn(300); alert('OUPS'); } else { $(this).next().removeClass('rotate-left rotate-right').fadeIn(400); } }); });
Host Instantly Drag and Drop Website Builder

 

Term
Mon, 11/27/2017 - 21:36

Related Codes

Pen ID
Pen ID
Pen ID