To achieve the rotation of the circle with the text without horizontal displacements, you need to find the correct center of rotation
To do this, I wrapped path and text in a group tag <g> and using the JS method getBBox() calculated the center of rotation
let bb = circ.getBBox();
console.log(bb.x + bb.width / 2)
console.log(bb.y + bb.height / 2)
We got the coordinates x ~= 564.2px y ~=359.1px
Substitute these values into the values of the animation command animateTransform
Please open full screen
Animation will start after clicking.
If you want to start the animation without clicking, instead of begin ="svg1.click" write begin ="0s"
;
let bb = circ.getBBox();
console.log(bb.x + bb.width / 2);
console.log(bb.y + bb.height / 2);
;
body {
background-color: black;
}
.rotate {
opacity: 1;
width: 1400px;
position: absolute;
}
.rotate:hover {
opacity: 1;
transition: 0.4s
}
<div class="rotate" >
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg id="svg1" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1200 500" >
<style type="text/css">
.st0{fill:none;}
</style>
<g id="circ" >
<path id="SVGID_x5F_1_x5F_" class="st0" d="M638,358.5c0,40.59-32.91,73.5-73.5,73.5S491,399.09,491,358.5s32.91-73.5,73.5-73.5
S638,317.91,638,358.5z"/>
<text><textPath xlink:href="#SVGID_x5F_1_x5F_" startOffset="0%">
<tspan style="fill:#FFFFFF; font-family:'fatboy-slim'; font-size:40px; letter-spacing: 0px;">Visit Me Visit Me Visit Me</tspan></textPath>
</text>
</g>
<animateTransform
xlink:href="#circ"
attributeName="transform"
type="rotate"
begin="svg1.click" dur="4s"
values="
0 564.2 359.1;
360 564.2 359.1"
repeatCount="indefinite"
calcMode="linear"
/>
</svg>
</div>
Upd
As a bonus
Forward-backward rotation on repeated clicks
Add a second animation that rotates the caption in the opposite direction
The JS script switches from the first clockwise rotation animation to the second counterclockwise rotation animation:
var svg_1 = document.getElementById("svg1"),
forward = document.getElementById('forward'),
back = document.getElementById("back");
let flag = true;
svg_1.addEventListener('click', function() {
if (flag == true) {
forward.beginElement();
flag = false;
} else {
back.beginElement();
flag = true;
}
});
body {
background-color: black;
}
.rotate {
opacity: 1;
width: 1400px;
position: absolute;
}
.rotate:hover {
opacity: 1;
transition: 0.4s
}
<div class="rotate" >
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg id="svg1" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1200 500" >
<style type="text/css">
.st0{fill:none;}
</style>
<g id="circ" >
<path id="SVGID_x5F_1_x5F_" class="st0" d="M638,358.5c0,40.59-32.91,73.5-73.5,73.5S491,399.09,491,358.5s32.91-73.5,73.5-73.5
S638,317.91,638,358.5z"/>
<text><textPath xlink:href="#SVGID_x5F_1_x5F_" startOffset="0%">
<tspan style="fill:#FFFFFF; font-family:'fatboy-slim'; font-size:40px; letter-spacing: 0px;">Visit Me Visit Me Visit Me</tspan></textPath>
</text>
</g>
<animateTransform id="forward"
xlink:href="#circ"
attributeName="transform"
type="rotate"
begin="indefinite"
dur="4s"
values="
0 564.2 359.1;
360 564.2 359.1"
repeatCount="indefinite"
calcMode="linear"
/>
<animateTransform id="back"
xlink:href="#circ"
attributeName="transform"
type="rotate"
begin="indefinite"
dur="4s"
values="
360 564.2 359.1;
0 564.2 359.1 "
repeatCount="indefinite"
calcMode="linear"
/>
</svg>
</div>