hermanwikner / vue-custom-cursor Goto Github PK
View Code? Open in Web Editor NEWInteractive custom cursor in Vue.js
Interactive custom cursor in Vue.js
I have my cursor in the App.js with another component : my homepage
<template>
<Cursor
:targets="['img', 'a', 'button']"
:circleColor="'#fff'"
:dotColor="'#ffffff'"
:dotColorHover="'transparent'"
:hoverSize="1.3"
>
</Cursor>
<Homepage />
</template>
As soon as I enter my svg, I got this error :
custom-cursor.vue:52 Uncaught TypeError: e.target.className.toLowerCase is not a function
The only workaround that I've found is to set the svg as a hover item, but it's not how I want it to work
I can't find a specific reason for this occurrence. On initial contact with a targeted element, the outer circle becomes blurry for a second or two then just automatically smoothens out. Can anyone elaborate or even +1 me?
How can I customize styling using CSS variables?
Realy good work you did, I have one (maybe later a few) new features.
Use data-attributes instead of targets array, cause if you have more than one class for get targeting element it will not work.
e.target.getAttribute("data-hover-cursor")
<img src="some_img_path" data-hover-cursor="true" class="link__img" />
and add hide cursor props ;)
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.