vue电商商品添加购物车结账自适应页面代码
代码语言:html
所属分类:电商
代码描述:vue电商商品添加购物车结账自适应页面代码,可以增加数量、清空购物车,商品图片可放大轮换
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css">
<style>
@import url(https://fonts.googleapis.com/css?family=Bitter:400,400italic,700);
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Bitter";
}
@-webkit-keyframes openUp {
0% {
-webkit-transform: translate(-50%, -50%) scale(0.5);
transform: translate(-50%, -50%) scale(0.5);
}
100% {
-webkit-transform: translate(-50%, -50%) scale(1);
transform: translate(-50%, -50%) scale(1);
}
}
@keyframes openUp {
0% {
-webkit-transform: translate(-50%, -50%) scale(0.5);
transform: translate(-50%, -50%) scale(0.5);
}
100% {
-webkit-transform: translate(-50%, -50%) scale(1);
transform: translate(-50%, -50%) scale(1);
}
}
button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding: 0.5em;
margin: 0.5em 0;
background: white;
border: 1px solid black;
-webkit-transition: all 0.1s;
transition: all 0.1s;
font-size: 14px;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
button .fa {
font-size: 1em !important;
vertical-align: middle;
}
button:hover {
color: white;
background: black;
}
input {
display: inline-block;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding: 0.5em;
margin: 0.5em 0.5em 0.5em 0;
width: 50px;
background: white;
border: 1px solid black;
-webkit-transition: all 0.1s;
transition: all 0.1s;
font-size: 14px;
}
label {
font-size: 0.75em;
margin-right: 0.5em;
}
.checkout-area table {
margin: 0 auto;
padding: 0.5em;
width: 100%;
max-width: 40em;
text-align: left;
}
.checkout-area table th, .checkout-area table td {
padding: 0 0.25em;
}
@media (max-width: 600px) {
.checkout-area table th:nth-child(3), .checkout-area table td:nth-child(3) {
display: none;
}
}
.align-left {
text-align: left;
}
.align-center {
text-align: center;
}
.align-right {
text-align: right;
}
.vert-bottom {
vertical-align: bottom;
}
.vert-middle {
vertical-align: middle;
}
.main-wrapper .header {
position: relative;
background: -webkit-gradient(linear, right top, left top, from(#16222A), to(#3A6073));
background: linear-gradient(to left, #16222A, #3A6073);
background-size: cover;
height: 25em;
width: 100vw;
box-shadow: inset -1px -3px 5px rgba(0, 0, 0, 0.5), inset 1px 3px 5px rgba(0, 0, 0, 0.5);
}
.main-wrapper .header h1 {
position: absolute;
text-align: center;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
color: white;
font-size: 3em;
text-shadow: 1px 3px 5px rgba(0, 0, 0, 0.5), -1px -3px 5px rgba(0, 0, 0, 0.5);
}
.main-wrapper #vue {
margin: 0 auto;
padding: 0.5em;
text-align: center;
}
.main-wrapper #vue .cart {
position: fixed;
right: 0em;
top: 0em;
text-align: right;
background: rgba(0, 0, 0, 0.85);
color: white;
z-index: 1;
}
.main-wrapper #vue .cart .fa-shopping-cart, .main-wrapper #vue .cart .cart-size {
cursor: pointer;
font-size: 1.25em;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.main-wrapper #vue .cart .fa-shopping-cart {
padding: 1em 1em 1em 0;
}
.main-wrapper #vue .cart .cart-size {
padding: 1em 0 1em 1em;
}
.main-wrapper #vue .cart .cart-items {
padding: 0 1em 2em 1em;
}
.main-wrapper #vue .cart .cart-items .cartTable {
width: 20em;
}
.main-wrapper #vue .cart .cart-items .cartImage {
width: 4em;
height: 4em;
margin: 0.5em auto;
position: relative;
cursor: pointer;
}
.main-wrapper #vue .cart .cart-items .cartImage:after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.25);
-webkit-transition: all 0.1s;
transition: all 0.1s;
}
.main-wrapper #vue .cart .cart-items .cartImage i {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
font-size: 1.5em;
z-index: 1;
-webkit-transition: all 0.25s;
transition: all 0.25s;
}
.main-wrapper #vue .cart .cart-items .cartImage:hover i {
text-shadow: 1px 2px 5px black;
}
.main-wrapper #vue .cart .cart-items .cartImage:hover:after {
background: rgba(0, 0, 0, 0.5);
}
.main-wrapper #vue .cart .cart-items .cartImage:active i {
text-shadow: 0px 0px 1px black;
}
.main-wrapper #vue .cart .cart-items .cartSubTotal {
border-top: 1px solid white;
font-size: 1.25em;
}
.main-wrapper #vue .cart .cart-items .clearCart {
float: left;
margin-top: 2em;
margin-bottom: 1.25em;
}
.main-wrapper #vue .cart .cart-items .checkoutCart {
float: right;
margin-top: 2em;
margin-bottom: 1.25em;
}
.main-wrapper #vue .products {
margin: 0 auto;
width: 100%;
max-width: 80em;
}
.main-wrapper #vue .products .product {
display: inline-block;
margin: 0.75em;
width: 100%;
max-width: 18em;
}
.main-wrapper #vue .products .product .image {
width: 18em;
height: 18em;
margin-bottom: 0.5em;
position: relative;
overflow: hidden;
cursor: pointer;
-webkit-transition: box-shadow 0.25s;
transition: box-shadow 0.25s;
}
@media (max-width: 600px) {
.main-wrapper #vu.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0