J'ai l'animation SVG suivante :
Démonstration : https://codepen.io/anon/pen/xNJYGe
HTML :
<div class='batteryIcon'>
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 668.3 1108.2">
<rect class="power" x="100" y="150" width="470" height="880">
<animate attributeName="height" values="0 ; 880" dur="2.5s" />
</rect>
<polygon class="st0" points="444.9,80.7 444.9,15.8 231.2,15.8 231.2,80.7 40.3,80.7 40.3,1080.8 629.3,1080.8 629.3,80.7 "/>
</svg>
</div>
CSS :
.batteryIcon {
svg {
width: 50px;
display: block;
.st0 {
fill: none;
stroke: #adadad;
stroke-width: 20;
stroke-miterlimit: 5;
}
.power {
fill: #06B67A;
}
}
}
Mon problème est que l'animation va du haut vers le bas au lieu de de bas en haut . J'ai essayé de transformer mon rect par CSS et attribut inline, ajouté faire pivoter y direction et aussi keyPoints . Rien n'a fonctionné jusqu'à présent.