domenicobrz / legendary-cursor Goto Github PK
View Code? Open in Web Editor NEWMakes your cursor's swings legendary
Makes your cursor's swings legendary
Hi! First of all, thanks for this amazing project, is just that I wanted. So elegant and easy to implement.
Could you add support for mobile users? I referr to touchscreen obviusly
I tried to make a listener for touchmove event but only draws the cursor when user give touches and not when it slides
My functions:
document.addEventListener("touchmove", onTouchMove, false);
function onTouchMove(e) {
posX = e.touches[0].clientX;
posY = e.touches[0].clientY;
let ux = (posX / innerWidth) * 2 - 1;
let uy = ((innerHeight - posY) / innerHeight) * 2 - 1;
let v = vec3(ux * aspectRatio, uy, 0);
currMousePos = v;
lastTextureDisp = new THREE.Vector2(posX, posY);
e.preventDefault();
}
Edit: after a review, the touch draws is already on this lib, not with my event listener. And after putting a console log inside touchmove event, doesn't print anything on console
An avid RPG fan is wanting a demo.
He is ready to reward you for your efforts.
Reward: 1 GitHub star + sharing to his 1K developer colleagues at work
Do you accept this quest? Yes / No
I want to apply the effect to certain areas and not display it in others.
How should I use it?
When I just import it in my nextjs project, it's showing error like this. How can I solve it?
- error node_modules\legendary-cursor\src\index.js (26:0) @ eval
- error ReferenceError: innerWidth is not defined
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.