console
window.setTimeout(function(){
window.location.reload();
},20000);
$(".button").one( "click", function() {
activateAnimation($(this).parent(), $(this));
});
function activateAnimation(parent, button) {
var backgroundcolor = "#99B898";
if (button.hasClass("cancel")){
backgroundcolor = "#E84A5F";
}
if (parent.next().length) {
var next = parent.nextAll();
var tl = new TimelineMax();
tl.to(parent, 1, { backgroundColor: backgroundcolor, ease: Power4.easeOut })
.to(parent, 0.5, {
x: "-400px",
ease: Bounce.easeOut
}).to(next, 1, {
y: "+=-68px",
ease: Bounce.easeOut})
} else {
var next = parent.nextAll();
var tl = new TimelineMax();
tl.to(parent, 1, { backgroundColor: backgroundcolor, ease: Power4.easeOut })
.to(parent, 0.5, {
x: "-400px",
ease: Bounce.easeOut
})
}
}
<body><div class="content">
<div class="container">
<div class="header">
List
</div>
<div class="row_container">
<div class="row">
<div class="text">
This is item 1
</div>
<div class="button cancel"><i class="fa fa-times fa-2x" aria-hidden="true"></i></div>
<div class="button check"><i class="fa fa-check fa-2x" aria-hidden="true"></i></div>
</div>
<div class="row">
<div class="text">
This is item 2
</div>
<div class="button cancel"><i class="fa fa-times fa-2x" aria-hidden="true"></i></div>
<div class="button check"><i class="fa fa-check fa-2x" aria-hidden="true"></i></div>
</div>
<div class="row">
<div class="text">
Therefore, this is item 3
</div>
<div class="button cancel"><i class="fa fa-times fa-2x" aria-hidden="true"></i></div>
<div class="button check"><i class="fa fa-check fa-2x" aria-hidden="true"></i></div>
</div>
<div class="row">
<div class="text">
You guessed it, item 4
</div>
<div class="button cancel"><i class="fa fa-times fa-2x" aria-hidden="true"></i></div>
<div class="button check"><i class="fa fa-check fa-2x" aria-hidden="true"></i></div>
</div>
<div class="row">
<div class="text">
Item 5, am I right?
</div>
<div class="button cancel"><i class="fa fa-times fa-2x" aria-hidden="true"></i></div>
<div class="button check"><i class="fa fa-check fa-2x" aria-hidden="true"></i></div>
</div>
</div>
</div>
</div></body>
body {
background: #C33764;
/* fallback for old browsers */
background: -webkit-linear-gradient(to right, #1D2671, #C33764);
/* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #1D2671, #C33764);
/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}
.add_button{
float:right;
display:inline;
border-radius:50%;
height:30px;
width:30px;
border:2px solid white;
margin-top: 15px;
margin-right: 10px;
text-align: center;
cursor:pointer;
line-height:25px;
vertical-align:middle;
}
.container {
height: 400px;
width: 320px;
overflow: hidden;
font-family: 'Quicksand', sans-serif;
color: white;
padding: 20px;
background-color: rgba(0, 0, 0, 0.15);
border-radius: 10px;
-webkit-box-shadow: 10px 10px 60px 10px rgba(0,0,0,0.5);
-moz-box-shadow: 10px 10px 60px 10px rgba(0,0,0,0.5);
box-shadow: 10px 10px 60px 10px rgba(0,0,0,0.5);
}
.fa-check,
.fa-times, .fa-plus {
color: white;
vertical-align: middle;
line-height: 30px;
font-size: 20px;
}
.fa-times, .fa-plus{
left:0.5px;
position:relative;
}
.header {
width: 100%;
position: relative;
height: 65px;
background-color: rgba(50, 51, 75, 0.5);
text-align: center;
vertical-align: middle;
line-height: 65px;
font-size: 20px;
margin-bottom: 3px;
}
.row {
width: 100%;
position: relative;
height: 65px;
background-color: rgba(95, 94, 158, 0.35);
margin-bottom: 3px;
position: relative;
}
.text {
float: left;
text-align: center;
vertical-align: middle;
line-height: 65px;
width: 65%;
font-size: 16px;
}
.check {
border: 2px solid white;
float: right;
height: 30px;
width: 30px;
border-radius: 50%;
margin-top: 15px;
margin-right: 10px;
text-align: center;
cursor:pointer;
}
.cancel {
border: 2px solid white;
float: right;
height: 30px;
width: 30px;
border-radius: 50%;
margin-top: 15px;
margin-right: 10px;
text-align: center;
cursor:pointer;
}
.content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: block;
}