I'm trying to create an oval SVG path that I want to use as an animated text path similar to https://stackoverflow.com/a/48354097/10727821 in order to create a sort of circular "marquee" that always takes full width and height of the browser window, ignoring the aspect ratio.
I guess the issue is that my <ellipse>
is describing a perfect circle, whereas I'd want it to be more flexible than that – but I don't really know how I'd do that…
.ellipse {
display: inline-block;
position: relative;
width: 100%;
height: 100%;
vertical-align: middle;
svg {
display: inline-block;
position: absolute;
top: 0;
left: 0;
}
ellipse {
fill: #333;
}
}
<div class="ellipse">
<svg version="1.1" viewBox="0 0 1000 1000" preserveAspectRatio="none">
<ellipse cx="500" cy="500" rx="500" ry="500"/>
</svg>
</div>
I hope this is what you need. I'm recalculating the viewBox of the svg element and the d path proportional to the
wrap.clientWidth
and thewrap.clientHeight
wherewrap
is the wrapping div<div id="wrap">
.