To achieve a unique visual effect, you can create a rectangular progress bar and then apply an SVG mask to it. However, please note that this method may not be compatible with Internet Explorer due to lack of support for CSS Masks.
Alternatively, you can follow a similar approach but utilize an SVG <mask>
or <clipPath>
element instead of CSS Masks. There are numerous resources available on utilizing these elements effectively. This alternative method will also function smoothly on IE9+.
.progress {
position: relative;
background-color: green;
-webkit-mask: url(https://cdn.mediacru.sh/P-WOGKdNDiGT.svg) top left / cover;
}
/* IMG is just here for the size */
.progress IMG {
visibility: hidden;
}
/* We expose the green by moving the LHS of the "background" grey */
.progress-bg {
background-color: gray;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
-webkit-animation-duration: 1s;
-webkit-animation-name: to30percent;
-webkit-animation-fill-mode: forwards;
animation-duration: 1s;
animation-name: to30percent;
animation-fill-mode: forwards;
}
@-webkit-keyframes to30percent {
from { left: 0%; }
to { left: 30%; }
}
@keyframes to30percent {
from { left: 0%; }
to { left: 30%; }
}
<div class="progress">
<img src="https://cdn.mediacru.sh/P-WOGKdNDiGT.svg" width="700px"/>
<div class="progress-bg"></div>
</div>
This setup includes a division with a green background and a grey div overlay representing the progress bar's background. By adjusting the "left" property of the grey div, we simulate the progress percentage visually. The entire design is then masked using our SVG element.