JSFiddle - React, Tailwind, and code Playground
by velo_ninja
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cursor Effects Example</title>
<!-- Include the Cursor Effects library hosted on unpkg -->
<script src="https://unpkg.com/cursor-effects@latest/dist/browser.js"></script>
<!-- Add any additional CSS styles if needed -->
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
overflow: hidden; /* to prevent scrollbars for the demo */
}
h1 {
text-align: center;
margin-top: 50px;
}
</style>
</head>
<body>
<h1>Cursor Effects Example</h1>
<!-- Initialize fairyDustCursor -->
<script type="module">
import { fairyDustCursor } from "https://unpkg.com/cursor-effects@latest/dist/esm.js";
// Create a new instance of fairyDustCursor
document.addEventListener('DOMContentLoaded', function() {
new fairyDustCursor();
});
</script>
</body>
</html>