Join the Webstudio community

Updated 2 months ago

Rive animation

At a glance

The community member is trying to implement a Rive animation in Webstudio, but is having trouble getting it to show. Another community member suggests trying to embed it the way Rive provides. The original poster then shares an example code snippet that they found in the Rive documentation, which works for them. The community members express appreciation for Rive.

Useful resources
I'm trying to implement a Rive animation. Is there someone who knows how to do this in Webstudio?
I have tried with the html embed and hosting the riv file on google drive. But it is not showing.
O
P
M
4 comments
have you tried embedding it the way its provided by rive?
from them directly
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:
Plain Text
<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>
Nice I like Rive !
Add a reply
Sign up and join the conversation on Discord
\n","dateCreated":"2024-12-24T11:21:17.454Z","dateModified":"2024-12-24T11:25:33.950Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/198b1ad8-7975-4625-975a-963268dd6d0b","name":"PieterVP283","identifier":"198b1ad8-7975-4625-975a-963268dd6d0b","image":"https://cdn.discordapp.com/avatars/568727594497998866/1f15254502aa20badc49bdfec4234dae.webp?size=256"},"commentCount":0,"comment":[],"position":3,"upvoteCount":0},{"@type":"Comment","text":"Nice I like Rive !","dateCreated":"2024-12-24T14:18:12.636Z","dateModified":"2024-12-24T14:18:12.636Z","author":{"@type":"Person","url":"https://help.webstudio.is/members/f623c301-541b-4951-9689-b1996b117cf7","name":"Mr Bean","identifier":"f623c301-541b-4951-9689-b1996b117cf7","image":"https://cdn.discordapp.com/avatars/219368881800609792/f3cbc6fa051e291e562b4da9154bddaf.webp?size=256"},"commentCount":0,"comment":[],"position":4,"upvoteCount":0}],"author":{"@type":"Person","url":"https://help.webstudio.is/members/198b1ad8-7975-4625-975a-963268dd6d0b","name":"PieterVP283","identifier":"198b1ad8-7975-4625-975a-963268dd6d0b","image":"https://cdn.discordapp.com/avatars/568727594497998866/1f15254502aa20badc49bdfec4234dae.webp?size=256"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0}}]