Вы можете использовать CSS @keyframes.
@keyframes stretchInFromLeft {
0% {
width: 100%;
}
100% {
width: 0;
}
}
img {
max-width: 100%;
width: 100%;
}
.wrapper {
position: relative;
}
.overlay {
animation: 1s ease-out 0s 1 stretchInFromLeft;
position: absolute;
top: 0;
right: 0;
background: #fff;
width: 0;
height: 100%;
}
<div class = "wrapper">
<img src = "https://i.stack.imgur.com/dta2g.jpg" />
<div class = "overlay"></div>
</div>
Рабочий пример: https://jsfiddle.net/r034wcgp/1/
Источник: анимация перехода css3 при загрузке?
Вы можете анимировать SVG clipPath с помощью jQuery animate() вот так:
$("#cut-off-bottom rect").animate({width: "100%", duration:4000})
<script src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 1440 320">
<clipPath id = "cut-off-bottom">
<rect x = "0" y = "0" width = "0" height = "320" />
</clipPath>
<path fill = "#0099ff" fill-opacity = "1" clip-path = "url(#cut-off-bottom)" d = "M0,32L48,32C96,32,192,32,288,58.7C384,85,480,139,576,154.7C672,171,768,149,864,165.3C960,181,1056,235,1152,240C1248,245,1344,203,1392,181.3L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path>
</svg>
хорошо. У меня есть еще один вопрос. как я могу запустить анимацию с самого начала? начинается не с начальной точки