Looking to add an SVG animation to my download button.
My goal is to have the arrow scroll down recursively within the red box.
Something similar can be seen here.
The animation needs some calibration, but the issue lies in the fact that the mask
isn't functioning as intended; the arrow remains visible when moving out of the red box.
What could be causing this problem?
Hoping for a solution that doesn't involve JavaScript.
@keyframes arrow-slide-recursively {
from {
transform: translate(0%, 0%)
}
to {
transform: translate(0%, 50%)
}
}
.fanbox-helper-fixed-menu-button {
background-color: transparent;
cursor: pointer;
border: medium;
padding: 4px;
width: 54px;
height: 54px;
}
.fanbox-helper-fixed-menu-button.busy {
opacity: 0.3;
pointer-events: none;
}
#fanbox-helper-quick-save-button.busy .arrow {
animation: arrow-slide-recursively 2s linear infinite;
}
<button id="fanbox-helper-quick-save-button" class="fanbox-helper-fixed-menu-button busy">
<svg class="fanbox-helper-svg-icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<mask id="fanbox-helper-quick-save-arrow-area" x="120" width="272" height="440">
<rect x="120" width="272" height="440" fill="red"></rect>
</mask>
<rect x="120" width="272" height="440" fill="red"></rect>
<g id="fanbox-helper-quick-save-arrow" mask="#fanbox-helper-quick-save-arrow-area">
<path class="arrow stick" stroke="black" stroke-linecap="round" stroke-linejoin="round" fill="none" d="m256,96 l0,256" stroke-width="40"></path>
<path class="arrow edge left" stroke="black" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke-width="40" d="m256,392 l-104,-104"></path>
<path class="arrow edge right" stroke="black" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke-width="40" d="m256,392 l104,-104"></path>
</g>
<path class="bowl" stroke="black" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke-width="40" d="m64,312 l0,148 l384,0 l0,-148"></path>
</svg>
</button>