|
@@ -1,5 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div @click="handleRipple" :class="className" :style="size ? `width: ${size}px; height: ${size}px;` : ''">
|
|
|
|
|
|
|
+ <div class="ripple-wrapper">
|
|
|
|
|
+ <div class="ripple" @click="handleRipple" :class="className" :style="size ? `width: ${size}px; height: ${size}px;` : ''">
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -18,7 +20,7 @@ export default {
|
|
|
this.className = 'show'
|
|
this.className = 'show'
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.className = ''
|
|
this.className = ''
|
|
|
- }, 400)
|
|
|
|
|
|
|
+ }, 500)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -29,10 +31,22 @@ export default {
|
|
|
@import '~@/style/theme.scss';
|
|
@import '~@/style/theme.scss';
|
|
|
|
|
|
|
|
$opacity: .15;
|
|
$opacity: .15;
|
|
|
-div {
|
|
|
|
|
|
|
+.ripple-wrapper {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.ripple {
|
|
|
|
|
+ -webkit-tap-highlight-color: transparent;
|
|
|
opacity: 0;
|
|
opacity: 0;
|
|
|
- width: 100px;
|
|
|
|
|
- height: 100px;
|
|
|
|
|
|
|
+ width: 80px;
|
|
|
|
|
+ height: 80px;
|
|
|
z-index: 2;
|
|
z-index: 2;
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
background-color: $icon-hover-color;
|
|
background-color: $icon-hover-color;
|
|
@@ -42,19 +56,19 @@ div {
|
|
|
|
|
|
|
|
.show {
|
|
.show {
|
|
|
opacity: $opacity;
|
|
opacity: $opacity;
|
|
|
- animation: ripple .4s forwards cubic-bezier(0, .5, .5, 1);
|
|
|
|
|
|
|
+ animation: ripple .5s forwards ease-out;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@keyframes ripple {
|
|
@keyframes ripple {
|
|
|
0% {
|
|
0% {
|
|
|
opacity: $opacity;
|
|
opacity: $opacity;
|
|
|
- transform: scale(0.00001, 0.0001);
|
|
|
|
|
|
|
+ transform: scale(0.1, 0.1);
|
|
|
}
|
|
}
|
|
|
- 80% {
|
|
|
|
|
|
|
+ 40% {
|
|
|
opacity: $opacity;
|
|
opacity: $opacity;
|
|
|
transform: scale(1, 1);
|
|
transform: scale(1, 1);
|
|
|
}
|
|
}
|
|
|
- 90% {
|
|
|
|
|
|
|
+ 80% {
|
|
|
opacity: $opacity;
|
|
opacity: $opacity;
|
|
|
transform: scale(1, 1);
|
|
transform: scale(1, 1);
|
|
|
}
|
|
}
|