Hi Oleg, you are right. I now used the example in
https://rive.app/community/doc/web-js/docvlgbnS1mp and that works! I was relying to much on chatgpt's anwser π³
For anyone else looking for an example:
<canvas id="canvas" width="500" height="500"></canvas>
<script src="https://unpkg.com/@rive-app/canvas"></script>
<script>
const r = new rive.Rive({
src: "https://cdn.rive.app/animations/vehicles.riv",
// OR the path to a discoverable and public Rive asset
// src: '/public/example.riv',
canvas: document.getElementById("canvas"),
autoplay: true,
// artboard: "Arboard", // Optional. If not supplied the default is selected
stateMachines: "bumpy",
onLoad: () => {
r.resizeDrawingSurfaceToCanvas();
},
});
</script>