Upload File
Close
You are editing a page!
HTML
<h1>Clippy</h1> <p>Experimenting with <a href="https://github.com/clippyjs/clippy.js">clippy.js</a></p> <link rel="stylesheet" type="text/css" href="https://razbot.xyz/assets/clippy.css" media="all"> <script src="https://razbot.xyz/assets/jquery-3.6.0.min.js"></script> <!-- Clippy.js --> <script src="https://razbot.xyz/assets/clippy.min.js"></script> <script type="text/javascript"> clippy.load('Clippy', function(agent){ // do anything with the loaded agent agent.show(); agent.speak('When all else fails, bind some paper together. My name is Clippy.'); // Initialize variables to hold the current mouse position var mouseX = 0; var mouseY = 0; // Add a mousemove event listener to update the mouse position document.addEventListener('mousemove', function(event) { mouseX = event.clientX; // Get the current mouse X position mouseY = event.clientY; // Get the current mouse Y position }); // Use setInterval to update the agent's position every 2 seconds setInterval(function() { agent.moveTo(mouseX, mouseY); }, 2000); setInterval(function() { agent.gestureAt(mouseX, mouseY); }, 10000); }); </script> <script type="text/javascript"> clippy.load('Bonzi', function(agent){ // do anything with the loaded agent agent.show(); agent.speak('I am Bonzi Buddy'); setInterval(() => { agent.animate(); }, 6500); }); </script>