Issues embedding .riv file into a Raw HTML block on WordPress
Working on placing our first Rive experiment onto our WordPress site. I’m using a theme that supports Raw HTML and Raw JS components into their “visual composer”.
I was able to pull in our .riv demo from the development site, because at the moment the Media page doesn’t accept .riv files. However, I feel like there’s something missing from the code because a lot of the advanced blending / blur effects are not being applied to elements in our demo.
Here it is straight out of rive.
https://rive.app/s/TKIdoOE_1kumaBw_3PPQEA/embed?runtime=rive-renderer
Here’s the code we’re using on the site.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Rive Hello World</title>
</head>
<body>
<canvas id="canvas" width="1000" height="1000"></canvas>
<!-- Rive runtime (Canvas) -->
<script src="https://unpkg.com/@rive-app/canvas@latest"></script>
<script>
const r = new rive.Rive({
src: "https://public.rive.app/hosted/779846/310602/TKIdoOE_1kumaBw_3PPQEA.riv",
canvas: document.getElementById("canvas"),
autoplay: true,
// artboard: "", // Optional. If not supplied the default is selected
stateMachines: "State Machine 1",
onLoad: () => {
// Ensure the drawing surface matches the canvas size and device pixel ratio
r.resizeDrawingSurfaceToCanvas();
},
});
</script>
</body>
</html>Here’s a screen capture of how it renders in our WordPress page.
Appreciate any help figuring this out.