Skip to content

Commit 4b7362c

Browse files
committed
Improved Ripple effect
1 parent 0b4c259 commit 4b7362c

File tree

1 file changed

+16
-36
lines changed

1 file changed

+16
-36
lines changed

src/components/icons/Staking/HeroIcon.vue

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
<template functional>
2-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" :class="{ pulsing: props.pulsing }" class="nq-icon hero-icon">
3-
<path d="M70 22h0a48 48 0 0148 48v0a48 48 0 01-48 48h0a48 48 0 01-48-48v0a48 48 0 0148-48z" opacity=".6" fill="none" stroke="#21bca5" stroke-width="3.02"/>
4-
<path d="M70 12h0a58 58 0 0158 58h0a58 58 0 01-58 58h0a58 58 0 01-58-58h0a58 58 0 0158-58z" opacity=".4" fill="none" stroke="#21bca5" stroke-width="3.02"/>
5-
<radialGradient id="a" cx="70" cy="70" r="69.26" gradientUnits="userSpaceOnUse">
6-
<stop offset="0" stop-color="#41a38e"/>
7-
<stop offset="1" stop-color="#21bca5"/>
8-
</radialGradient>
9-
<path d="M70 2.25h0A67.75 67.75 0 01137.75 70v0A67.75 67.75 0 0170 137.75h0A67.75 67.75 0 012.25 70v0A67.75 67.75 0 0170 2.25z" opacity=".2" fill="none" stroke="url(#a)" stroke-width="3.02"/>
10-
<radialGradient id="b" cx="-791.61" cy="458.74" r="1" gradientTransform="matrix(-83.5341 0 0 83.5341 -66014.57 -38208.91)" gradientUnits="userSpaceOnUse">
11-
<stop offset="0" stop-color="#41a38e"/>
12-
<stop offset="1" stop-color="#21bca5"/>
13-
</radialGradient>
14-
<path d="M70 28.23a41.76 41.76 0 110 83.52 41.76 41.76 0 110-83.52z" fill="url(#b)"/>
15-
<path d="M70.71 69.1v21.56m18.71-26.11c0 12.4-6.31 18.89-18.71 18.89 0-17.56 5.28-18.89 18.71-18.89zM54.18 53.98c0 13.33 4.13 20.07 16.53 20.07 0-13.43-1.03-20.07-16.53-20.07z" fill="none" stroke="#fff" stroke-width="4.0316" stroke-linecap="round" stroke-linejoin="round"/>
2+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 148 148" :class="{ pulsing: props.pulsing }" class="nq-icon hero-icon">
3+
<defs>
4+
<radialGradient id="a" cx="-791" cy="458" r="1" gradientTransform="matrix(-83 0 0 83.5341 -66014 -38208)" gradientUnits="userSpaceOnUse">
5+
<stop offset="0" stop-color="#41a38e" />
6+
<stop offset="1" stop-color="#21bca5" />
7+
</radialGradient>
8+
</defs>
9+
<circle cx="73.76" cy="73.76" r="51.76" stroke-opacity=".8" stroke-width="3" style="--delay:200ms" stroke="#21bca5" class="ripple" />
10+
<circle cx="73.76" cy="73.76" r="61.76" stroke-opacity=".6" stroke-width="3" style="--delay:400ms" stroke="#21bca5" class="ripple" />
11+
<circle cx="73.76" cy="73.76" r="71.76" stroke-opacity=".4" stroke-width="3" style="--delay:600ms" stroke="#21bca5" class="ripple" />
12+
<circle cx="73.76" cy="73.76" r="41.76" fill="url(#a)" un-fill=" inverted:white" />
13+
<path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M72.53 75.07v16.61m0-16.61C60.13 75.07 56 68.33 56 55c15.5 0 16.53 6.64 16.53 20.07Zm18.71-9.5c0 12.4-6.31 18.89-18.71 18.89 0-17.56 5.28-18.89 18.71-18.89Z" />
1614
</svg>
1715
</template>
1816

@@ -32,28 +30,10 @@ export default defineComponent({
3230

3331
<style lang="scss" scoped>
3432
svg {
35-
font-size: 0;
36-
37-
path:nth-child(1), path:nth-child(2), path:nth-child(4) {
38-
opacity: 0;
39-
}
40-
41-
path:nth-child(1) { stroke-opacity: .8 }
42-
path:nth-child(2) { stroke-opacity: .6 }
43-
path:nth-child(4) { stroke-opacity: .4 }
44-
45-
&.pulsing {
46-
path:nth-child(1), path:nth-child(2), path:nth-child(4) {
47-
animation: fastwave 1s ease alternate infinite;
48-
}
49-
50-
$delay: 200ms;
51-
@for $i from 1 through 3 {
52-
path:nth-child(#{if($i == 3, 4, $i)}) {
53-
animation-delay: $delay * $i;
54-
}
55-
}
56-
}
33+
.ripple {
34+
animation: fastwave 1s ease alternate infinite;
35+
animation-delay: var(--delay);
36+
}
5737
}
5838
5939
@keyframes fastwave {

0 commit comments

Comments
 (0)