|
|
<template>
|
|
|
<div class="feature-selector" :class="{ 'slide-in': isVisible }">
|
|
|
<div class="header">
|
|
|
<div class="image-box">
|
|
|
<div id="image-box" class="image-box">
|
|
|
<img :src="selection.thumbnail | resize 45 60"/>
|
|
|
</div>
|
|
|
<div class="text-box">
|
...
|
...
|
@@ -60,6 +60,7 @@ |
|
|
width: 90px;
|
|
|
height: 120px;
|
|
|
display: inline-block;
|
|
|
opacity: 1;
|
|
|
}
|
|
|
|
|
|
.text-box {
|
...
|
...
|
@@ -113,6 +114,55 @@ |
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.rotate-animation-target {
|
|
|
animation: rotate-animation 2000ms linear both;
|
|
|
}
|
|
|
|
|
|
/* Generated with Bounce.js. Edit at http://bouncejs.com#%7Bs%3A%5B%7BT%3A%22t%22%2Ce%3A%22b%22%2Cd%3A2000%2CD%3A0%2Cf%3A%7Bx%3A0%2Cy%3A0%7D%2Ct%3A%7Bx%3A10%2Cy%3A290%7D%2Cs%3A3%2Cb%3A4%7D%2C%7BT%3A%22r%22%2Ce%3A%22b%22%2Cd%3A2000%2CD%3A0%2Cf%3A0%2Ct%3A360%2Cs%3A3%2Cb%3A4%7D%2C%7BT%3A%22c%22%2Ce%3A%22b%22%2Cd%3A2000%2CD%3A0%2Cf%3A%7Bx%3A1%2Cy%3A1%7D%2Ct%3A%7Bx%3A0.01%2Cy%3A0.01%7D%2Cs%3A3%2Cb%3A4%7D%5D%7D */
|
|
|
|
|
|
@keyframes rotate-animation {
|
|
|
0% {
|
|
|
-webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
|
|
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
|
|
}
|
|
|
4.3% {
|
|
|
-webkit-transform: matrix3d(-0.489, -0.044, 0, 0, 0.044, -0.489, 0, 0, 0, 0, 1, 0, 5.143, 149.138, 0, 1);
|
|
|
transform: matrix3d(-0.489, -0.044, 0, 0, 0.044, -0.489, 0, 0, 0, 0, 1, 0, 5.143, 149.138, 0, 1);
|
|
|
}
|
|
|
8.61% {
|
|
|
-webkit-transform: matrix3d(0.094, -0.09, 0, 0, 0.09, 0.094, 0, 0, 0, 0, 1, 0, 8.786, 254.79, 0, 1);
|
|
|
transform: matrix3d(0.094, -0.09, 0, 0, 0.09, 0.094, 0, 0, 0, 0, 1, 0, 8.786, 254.79, 0, 1);
|
|
|
}
|
|
|
12.91% {
|
|
|
-webkit-transform: matrix3d(-0.04, -0.013, 0, 0, 0.013, -0.04, 0, 0, 0, 0, 1, 0, 10.523, 305.16, 0, 1);
|
|
|
transform: matrix3d(-0.04, -0.013, 0, 0, 0.013, -0.04, 0, 0, 0, 0, 1, 0, 10.523, 305.16, 0, 1);
|
|
|
}
|
|
|
17.22% {
|
|
|
-webkit-transform: matrix3d(-0.069, -0.046, 0, 0, 0.046, -0.069, 0, 0, 0, 0, 1, 0, 10.933, 317.067, 0, 1);
|
|
|
transform: matrix3d(-0.069, -0.046, 0, 0, 0.046, -0.069, 0, 0, 0, 0, 1, 0, 10.933, 317.067, 0, 1);
|
|
|
}
|
|
|
28.33% {
|
|
|
-webkit-transform: matrix3d(-0.01, -0.001, 0, 0, 0.001, -0.01, 0, 0, 0, 0, 1, 0, 10.206, 295.982, 0, 1);
|
|
|
transform: matrix3d(-0.01, -0.001, 0, 0, 0.001, -0.01, 0, 0, 0, 0, 1, 0, 10.206, 295.982, 0, 1);
|
|
|
}
|
|
|
39.44% {
|
|
|
-webkit-transform: matrix3d(0.016, -0.001, 0, 0, 0.001, 0.016, 0, 0, 0, 0, 1, 0, 9.938, 288.193, 0, 1);
|
|
|
transform: matrix3d(0.016, -0.001, 0, 0, 0.001, 0.016, 0, 0, 0, 0, 1, 0, 9.938, 288.193, 0, 1);
|
|
|
}
|
|
|
61.66% {
|
|
|
-webkit-transform: matrix3d(0.01, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 1, 0, 10.004, 290.121, 0, 1);
|
|
|
transform: matrix3d(0.01, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 1, 0, 10.004, 290.121, 0, 1);
|
|
|
}
|
|
|
83.98% {
|
|
|
-webkit-transform: matrix3d(0.01, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 1, 0, 10, 289.992, 0, 1);
|
|
|
transform: matrix3d(0.01, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 1, 0, 10, 289.992, 0, 1);
|
|
|
}
|
|
|
100% {
|
|
|
-webkit-transform: matrix3d(0.01, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 1, 0, 10, 290, 0, 1);
|
|
|
transform: matrix3d(0.01, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 1, 0, 10, 290, 0, 1);
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
<script>
|
|
|
/**
|
...
|
...
|
@@ -283,7 +333,8 @@ |
|
|
|
|
|
return null;
|
|
|
})(self.selection.color.value, self.selection.size.value),
|
|
|
thumbnail: this.thumbnails[opt]
|
|
|
|
|
|
thumbnail: this.thumbnails[opt.value]
|
|
|
};
|
|
|
|
|
|
this.sizes = this.colorSizes[opt.value];
|
...
|
...
|
@@ -318,7 +369,28 @@ |
|
|
|
|
|
const param = Object.assign({goodsId: this.entity.id}, this.selection);
|
|
|
|
|
|
this.onAddToCart(param);
|
|
|
this.onAddToCart(param, this);
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 播放加入购物车动画
|
|
|
*/
|
|
|
playAnimation() {
|
|
|
const imageBox = $('#image-box');
|
|
|
const pos = imageBox.offset();
|
|
|
|
|
|
const clone = imageBox.clone();
|
|
|
|
|
|
clone[0].addEventListener('webkitAnimationEnd', ()=> {
|
|
|
clone.remove();
|
|
|
});
|
|
|
|
|
|
clone.addClass('rotate-animation-target').appendTo('body').css({
|
|
|
top: pos.top,
|
|
|
left: pos.left,
|
|
|
position: 'absolute',
|
|
|
'z-index': 1002
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
};
|
...
|
...
|
|