27 lines
805 B
HTML
27 lines
805 B
HTML
<!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>
|
|
<div style="text-align: center">
|
|
<canvas id="canvas" width="400" height="400"></canvas>
|
|
</div>
|
|
<script src="https://unpkg.com/@rive-app/canvas@2.20.0"></script>
|
|
<script>
|
|
const r = new rive.Rive({
|
|
src: "https://cdn.rive.app/animations/vehicles.riv",
|
|
canvas: document.getElementById("canvas"),
|
|
autoplay: true,
|
|
// artboard: "Arboard", // Optional. If not supplied the default is selected
|
|
stateMachines: "bumpy",
|
|
onLoad: () => {
|
|
// Ensure the drawing surface matches the canvas size and device pixel ratio
|
|
r.resizeDrawingSurfaceToCanvas();
|
|
},
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |