Pintar una animación de Rive

<script src="https://unpkg.com/@rive-app/canvas@2.9.1"></script>
<canvas id="canvas" width="1200" height="400"></canvas>
<script>
    function resizeCanvas() {
        const canvasElement = document.getElementById("canvas");
        const parentWidth = canvasElement.parentElement.offsetWidth;
        const originalWidth = 1200; // Ancho original del canvas
        const originalHeight = 400; // Altura original del canvas
        const newHeight = (originalHeight / originalWidth) * parentWidth;

        canvasElement.width = parentWidth;
        canvasElement.height = newHeight;
        r.resizeDrawingSurfaceToCanvas();
    }

    const r = new rive.Rive({
        src: "https://fernandez-velazquez.com/media/visitas-kerasoft.riv",
        canvas: document.getElementById("canvas"),
        autoplay: true,
        onLoad: resizeCanvas,
    });

    window.addEventListener('resize', resizeCanvas);
</script>
<style>
    #canvas {
        max-width: 100%;
        height: auto;
    }
</style>