npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-animated-polyline-cursor

v1.0.3

Published

Custom animated(drawLine) cursor by react functional component.

Downloads

6

Readme

React Animated Polyline Cursor

기본 커서를 커스텀 가능한 애니메이션 커서로 변경해주는 React Component입니다. 해당 Component는 함수형으로 제작되었습니다.

Contents

  1. Features
  2. Install
  3. Usage
  4. Options

Features

  • Custom cursor replaced by default cursor
  • Line effects that track the path the cursor has traveled
  • Cursor scale down effect on click
  • Cursor resizing effect when hovering over elements with 'c-cursor-hover' class defined

Other customizations include color, size, polyline-delay, polyline-length, marker-blend-mode, and more for circle, polyline, and marker.

Live Demo

Install

npm i react-animated-polyline-cursor

Usage

Add to global scope. (ex. App.ts)

import React from "react";
import CustomAnimatedCursor from "react-animated-polyline-cursor";

export default function App() {
    return (
        <div className="App">
            // It has default values, ​​and you can only override custom settings.
            <CustomAnimatedCursor
                dotColor={"#2AFADF"}
                lineColor={"#2AFADF"}
                markerColor={"#2AFADF"}
            />
            ...component
        </div>
    );
}

Hover Element (add 'c-cursor-hover' className)

export default function DemoContent() {
    return (
        <div>
            <div>
                <h1>Custom Animated Polyline Cursor</h1>
                <a href="#" className="c-cursor-hover">
                    Link Text.
                </a>
                <div className="c-cursor-hover">Hover Box</div>
                <div>
                    <label htmlFor="chk" className="c-cursor-hover">
                        Checkbox
                    </label>
                    <input type="checkbox" id="chk" />
                </div>
            </div>
        </div>
    );
}

Default Props

CustomAnimatedCursor.defaultProps = {
    dotColor: "#000",
    dotSize: 8,
    dotReductionRatio: 0.25,
    lineColor: "#000",
    lineDelay: 2,
    lineLength: 12,
    lineWidth: 2,
    markerSize: 24,
    markerColor: "#fff",
    removeCursorElements: ["a", "input", "label", "select", "textarea", "button"],
    markerBlendMode: true,
};

Props Types

export interface CursorTypes {
    dotColor: string;
    dotSize: number;
    dotReductionRatio: number;
    lineColor: string;
    lineDelay: number;
    lineLength: number;
    lineWidth: number;
    markerSize: number;
    markerColor: string;
    removeCursorElements: string[];
    markerBlendMode: boolean;
}

Options

| Option | Type | Description | Default | | ---------------------- | ------- | ------------------------------------------------------- | --------------------------------------------------------- | | dotColor | string | Cursor color - rgb or hex | #000 | | dotSize | number | Cursor size - Minimum 1 | 8 | | dotReductionRatio | number | Cursor reduction ratio - 0~1 | 0.25 | | lineColor | string | DrawLine color - rgb or hex | #000 | | lineDelay | number | DrawLine delay to follow - Minimum 1 | 2 | | lineLength | number | DrawLine stretched length - Recommend 2~30 limit | 12 | | lineWidth | number | DrawLine width - Minimum 1, Maximum "dotSize" | 2 | | markerSize | string | HoveredMarker size - Minimum "dotSize" | 24 | | markerColor | string | HoveredMarker color - rgb or hex | #000 | | removeCursorElements | array | Remove default cursor from element - htmlTag, class, id | ['a', 'input', 'label', 'select', 'textarea', 'button'] | | markerBlendMode | boolean | On/Off the Cursor blend mode - boolean | true |

Todos

  • ~~Webpack to Vite Migration~~
  • ~~Add Hovered Marker Click Action~~
  • ~~Add Input Type Element Hovered Action~~
  • ~~Create & Deploy NPM Package~~
  • Add more detailed cursor style editing
  • Changed input element cursor hovered design
  • Add SSR Mode
  • Source Refactoring