<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<article class="card fl-left">
<section class="date">
<span class="label label-warning">LIMITED</span><br>
<small>Created: 20/03/2020</small>
<time>
<span>FLASHSALE50</span>
<span class="value-show">40%</span>
</time>
</section>
<section class="card-cont">
<div class="header">
<small>Activated: 20/03/2020</small>
<div class="switch-wrap">
<label class="switch ">
<input type="checkbox" class="default">
<span class="slider round"></span>
</label>
</div>
</div>
<h3>Đã qua thật rồi đã xa thật rồi sao cứ vẫn mộng mơ</h3>
<div class="even-date">
<i class="fa fa-calendar"></i>
<small class="valid-until">Valid until 20/03/2020</small>
</div>
<div class="even-info">
<i class="fa fa-map-marker"></i>
<p>
</p>
</div>
<a href="#" class="edit-voucher" data-target="#voucher-edit-17">Edit</a>
</section>
<section class="card-back" id="voucher-edit-17">
<form id="voucher-abc">
<section class="date">
<span class="label label-warning">LIMITED</span><br>
<time>
<div class="form-group date-first">
<label>Activated at</label>
<input class="form-control" name="activated_at" type="date" value="2020-03-03">
<span class="Error"></span>
</div> <div class="form-group">
<label>Expired at:</label>
<input class="form-control" name="expired_at" type="date" value="2020-03-03">
<span class="Error"></span>
</div>
</time>
</section>
<section class="card-cont">
<div class="form-group name">
<label>Name:</label>
<input class="form-control" type="text" name="name" required value="FLASHSALE50"/>
<span class="Error"></span>
</div>
<div class="form-group value">
<label>Value:</label>
<input class="form-control" name="value" type="text" value="0.4">
<span class="Error"></span>
</div>
<div class="form-group desc">
<label>Description:</label>
<input class="form-control" name="description" type="text" value="Đã qua thật rồi đã xa thật rồi sao cứ vẫn mộng mơ">
<span class="Error"></span>
</div>
<div class="even-info">
<i class="fa fa-map-marker"></i>
<p>
</p>
</div>
<a href="#" class="submit-edit-voucher">Submit</a>
<a href="#" class="cancle-edit">Cancel</a>
</section>
</form>
</section>
</article>
<article class="card fl-left">
<section class="date">
<span class="label label-warning">LIMITED</span><br>
<small>Created: 20/02/2020</small>
<time>
<span>FLASHSALE20</span>
<span class="value-show">20%</span>
</time>
</section>
<section class="card-cont">
<div class="header">
<small>Activated: 20/02/2020</small>
<div class="switch-wrap">
<label class="switch ">
<input type="checkbox" class="default">
<span class="slider round"></span>
</label>
</div>
</div>
<h3>Người lạ ơi, xin cho tôi mượn bờ vai</h3>
<div class="even-date">
<i class="fa fa-calendar"></i>
<small class="valid-until">Valid until 20/02/2020</small>
</div>
<div class="even-info">
<i class="fa fa-map-marker"></i>
<p>
</p>
</div>
<a href="#" class="edit-voucher" data-target="#voucher-edit-15">Edit</a>
</section>
<section class="card-back" id="voucher-edit-15">
<form id="voucher-abc">
<section class="date">
<span class="label label-warning">LIMITED</span><br>
<time>
<div class="form-group date-first">
<label>Activated at</label>
<input class="form-control" name="activated_at" type="date" value="2020-02-02">
<span class="Error"></span>
</div> <div class="form-group">
<label>Expired at:</label>
<input class="form-control" name="expired_at" type="date" value="2020-02-02">
<span class="Error"></span>
</div>
</time>
</section>
<section class="card-cont">
<div class="form-group name">
<label>Name:</label>
<input class="form-control" type="text" name="name" required value="FLASHSALE20"/>
<span class="Error"></span>
</div>
<div class="form-group value">
<label>Value:</label>
<input class="form-control" name="value" type="text" value="0.2">
<span class="Error"></span>
</div>
<div class="form-group desc">
<label>Description:</label>
<input class="form-control" name="description" type="text" value="Người lạ ơi, xin cho tôi mượn bờ vai">
<span class="Error"></span>
</div>
<div class="even-info">
<i class="fa fa-map-marker"></i>
<p>
</p>
</div>
<a href="#" class="submit-edit-voucher">Submit</a>
<a href="#" class="cancle-edit">Cancel</a>
</section>
</form>
</section>
</article>
<article class="card fl-left">
<section class="date">
<span class="label label-warning">LIMITED</span><br>
<small>Created: 08/08/2020</small>
<time>
<span>SALEOFF80</span>
<span class="value-show">80%</span>
</time>
</section>
<section class="card-cont">
<div class="header">
<small>Activated: 08/08/2020</small>
<div class="switch-wrap">
<label class="switch ">
<input type="checkbox" class="default">
<span class="slider round"></span>
</label>
</div>
</div>
<h3>Người tôi yêu tỉnh giấc vào lúc trưa hay ban chiều</h3>
<div class="even-date">
<i class="fa fa-calendar"></i>
<small class="valid-until">Valid until 08/08/2020</small>
</div>
<div class="even-info">
<i class="fa fa-map-marker"></i>
<p>
</p>
</div>
<a href="#" class="edit-voucher" data-target="#voucher-edit-4">Edit</a>
</section>
<section class="card-back" id="voucher-edit-4">
<form id="voucher-abc">
<section class="date">
<span class="label label-warning">LIMITED</span><br>
<time>
<div class="form-group date-first">
<label>Activated at</label>
<input class="form-control" name="activated_at" type="date" value="2020-08-08">
<span class="Error"></span>
</div> <div class="form-group">
<label>Expired at:</label>
<input class="form-control" name="expired_at" type="date" value="2020-08-08">
<span class="Error"></span>
</div>
</time>
</section>
<section class="card-cont">
<div class="form-group name">
<label>Name:</label>
<input class="form-control" type="text" name="name" required value="SALEOFF80"/>
<span class="Error"></span>
</div>
<div class="form-group value">
<label>Value:</label>
<input class="form-control" name="value" type="text" value="0.8">
<span class="Error"></span>
</div>
<div class="form-group desc">
<label>Description:</label>
<input class="form-control" name="description" type="text" value="Người tôi yêu tỉnh giấc vào lúc trưa hay ban chiều">
<span class="Error"></span>
</div>
<div class="even-info">
<i class="fa fa-map-marker"></i>
<p>
</p>
</div>
<a href="#" class="submit-edit-voucher">Submit</a>
<a href="#" class="cancle-edit">Cancel</a>
</section>
</form>
</section>
</article>
<article class="card fl-left">
<section class="date">
<span class="label label-warning">LIMITED</span><br>
<small>Created: 01/09/2020</small>
<time>
<span>BANLOVON99</span>
<span class="value-show">99%</span>
</time>
</section>
<section class="card-cont">
<div class="header">
<small>Activated: 01/09/2020</small>
<div class="switch-wrap">
<label class="switch ">
<input type="checkbox" class="default">
<span class="slider round"></span>
</label>
</div>
</div>
<h3>Người đừng lặng im đến thế</h3>
<div class="even-date">
<i class="fa fa-calendar"></i>
<small class="valid-until">Valid until 01/09/2020</small>
</div>
<div class="even-info">
<i class="fa fa-map-marker"></i>
<p>
</p>
</div>
<a href="#" class="edit-voucher" data-target="#voucher-edit-1">Edit</a>
</section>
<section class="card-back" id="voucher-edit-1">
<form id="voucher-abc">
<section class="date">
<span class="label label-warning">LIMITED</span><br>
<time>
<div class="form-group date-first">
<label>Activated at</label>
<input class="form-control" name="activated_at" type="date" value="2020-01-09">
<span class="Error"></span>
</div> <div class="form-group">
<label>Expired at:</label>
<input class="form-control" name="expired_at" type="date" value="2020-01-09">
<span class="Error"></span>
</div>
</time>
</section>
<section class="card-cont">
<div class="form-group name">
<label>Name:</label>
<input class="form-control" type="text" name="name" required value="BANLOVON99"/>
<span class="Error"></span>
</div>
<div class="form-group value">
<label>Value:</label>
<input class="form-control" name="value" type="text" value="0.99">
<span class="Error"></span>
</div>
<div class="form-group desc">
<label>Description:</label>
<input class="form-control" name="description" type="text" value="Người đừng lặng im đến thế">
<span class="Error"></span>
</div>
<div class="even-info">
<i class="fa fa-map-marker"></i>
<p>
</p>
</div>
<a href="#" class="submit-edit-voucher">Submit</a>
<a href="#" class="cancle-edit">Cancel</a>
</section>
</form>
</section>
</article>
*
{
margin: 0;
padding: 0;
border: 0;
box-sizing: border-box
}
body
{
background-color: #ccc;
font-family: arial
}
.header{
width: 100%;
height: 20px;
display: flex;
align-items: center;
justify-content: space-between
}
.fl-left{float: left}
.fl-right{float: right}
.card
{
width: 45%;
background-color: #fff;
color: #989898;
margin-bottom: 10px;
border-radius: 4px;
position: relative;
margin: 10px;
min-height: 170px;
max-height: 170px;
overflow: hidden;
border: solid 1px #dadde6;
}
.date
{
display: table-cell;
width: 40%;
position: relative;
text-align: center;
border-right: 2px dashed #dadde6;
height: 160px;
}
.date:before,
.date:after
{
content: "";
display: block;
width: 30px;
height: 30px;
background-color: #DADDE6;
position: absolute;
top: -15px ;
right: -15px;
z-index: 1;
border-radius: 50%;
}
.date:after
{
top: auto;
bottom: -15px
}
.date time
{
display: block;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%)
}
.date time span{display: block}
.date time span:first-child
{
color: #2b2b2b;
font-weight: 600;
font-size: 150%
}
.date time span:last-child
{
text-transform: uppercase;
font-weight: 600;
margin-top: -10px
}
.card-cont
{
display: table-cell;
width: 100%;
padding: 10px 10px 20px 50px
}
.card-cont h3
{
color: #3C3C3C;
font-size: 130%
}
.row:last-child .card:last-of-type .card-cont h3
{
text-decoration: line-through
}
.card-cont .even-date i,
.card-cont .even-info i,
.card-cont .even-date time,
.card-cont .even-info p
{
display: table-cell
}
.card-cont .even-date i,
.card-cont .even-info i
{
padding: 5% 5% 0 0
}
.card-cont .even-info p
{
padding: 30px 50px 0 0
}
.card-cont .even-date time span
{
display: block
}
.card-cont a
{
display: block;
text-decoration: none;
width: 80px;
height: 30px;
background-color: #D8DDE0;
color: #fff;
text-align: center;
line-height: 30px;
border-radius: 2px;
position: absolute;
right: 15px;
bottom: 20px
}
.card .card-cont a
{
background-color: #037FDD
}
.card.editing .card-cont a,
.card .card-cont a.cancle-edit
{
background-color: #F8504C
}
@media screen and (max-width: 860px)
{
.card
{
display: block;
float: none;
width: 100%;
margin-bottom: 10px
}
.card + .card{margin-left: 0}
.card-cont .even-date,
.card-cont .even-info
{
font-size: 75%
}
}
small:not(.valid-until){
color: rgba(0, 0, 0, 0.2);
}
.value-show{
position: absolute;
top: 150%;
width: 60px;
height: 30px;
color: #fff !important;
background: #69beff;
border-radius: 20px;
font-size: 20px;
left: calc(50% - 30px);
}
.card-back {
position: absolute;
width: 100%;
height: 100%;
top: 0;
background: #fff;
z-index: 999;
transition: all 0.5s ease-in-out;
transform: translateX(-100%);
background-image: initial;
opacity: 0;
visibility: hidden;
border-radius: 20px;
max-height: 170px;
overflow: hidden;
}
.card:nth-child(2n) .card-back {
transform: translateX(100%);
}
a.submit-edit-voucher {
bottom: 60px;
}
.card-back .date {
width: 46%;
}
.form-group.value {
position: absolute;
right: 10px;
top: 10px;
}
.card-back span.label.label-warning {
position: absolute;
top: 150px;
left: calc(50% - 25px);
}
.card-back time {
top: 48%;
}
.form-group.date-first {
margin-top: -10px;
margin-bottom: 25px;
}
.desc input.form-control {
width: 280px;
/* margin-left: -100px; */
position: absolute;
}
.switch-wrap
{
position: absolute;
right: 15px;
top: 10px;
}
/*switch*/
.switch {
position: relative;
display: inline-block;
width: 35px;
height: 20.5px;
float:right;
}
/* Hide default HTML checkbox */
.switch input {display:none;}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 13px;
width: 13px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input.default:checked + .slider {
background-color: #037FDD;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(13px);
-ms-transform: translateX(13px);
transform: translateX(13px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
$('.edit-voucher').click(function(e){
var voucher = $($(this).data('target'));
voucher.css({ visibility: 'visible', opacity: 1, transform: 'translateX(0)' })
})
$('.cancle-edit').click(function(e){
var voucher = $(this).closest('form').parent('.card-back');
var transform = 'translateX(-100%)';
if($('.card').index($(this).closest('.card')) % 2){
transform = 'translateX(100%)';
}
voucher.css({ visibility: 'hidden', opacity: 0, transform })
})