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

vue-create-ripple

v0.3.1

Published

Flexible Ripple Directive for Vue 3

Downloads

16

Readme

vue-create-ripple

Flexible Ripple Directive for Vue 3.

Contains TypeScript declarations. Documentation & demo.

Install

npm install vue-create-ripple

Use

Install directive globally in app:

import { createApp } from 'vue';
import { createRippleDirective } from 'vue-create-ripple';
import App from './App.vue';

createApp(App)
    .directive('Ripple', createRippleDirective({
        class: 'bg-black opacity-30'
        // Set other defaults
    }))
    .mount('#app');

Or locally in component:

<script>
import { createRippleDirective } from 'vue-create-ripple';

export default {
    directives: {
        Ripple: createRippleDirective({ /* settings */ })
    }
}
</script>

To then use it like so:

<template>
    <div v-ripple>
        Ripple effect with default options
    </div>

    <div v-ripple.center="{ class: 'bg-red' }">
        Ripple with options that override defaults
    </div>
</template>

In addition, you can import the created Ripple directive with all the default parameters, but then you have to always specify the class, otherwise you will not see any effect!

import { createApp } from 'vue';
import { Ripple } from 'vue-create-ripple';
import App from './App.vue';

createApp(App)
    .directive('Ripple', Ripple)
    .mount('#app');

Options & defaults

export interface RippleOptions {
    /**
     * The class to be assigned to the circle. Can be used
     * for quick and easy styling.
     *
     * ! If not specified, then nothing will be visible
     */
    class?: string | null;

    /**
     * Effect disappearence timing function
     *
     * @default 'cubic-bezier(0.4, 0, 0.2, 1)'
     */
    disappearEasing?: string;

    /**
     * Effect disappearence duration
     *
     * @default '.7s'
     */
    disappearDuration?: string;

    /**
     * Effect appearence timing function
     *
     * @default 'cubic-bezier(0.16, 1, 0.3, 1)'
     */
    appearEasing?: string;

    /**
     * Effect appearence duration
     *
     * @default '.8s'
     */
    appearDuration?: string;

    /**
     * Flag to disable effect triggering
     */
    disabled?: boolean;

    /**
     * If `true`, the effect will always come from the center of the element.
     *
     * @default false
     */
    center?: boolean;

    /**
     * If `true`, then the effect will work only on event
     * `mousedown` on the element itself, not its descendants
     *
     * @default false
     */
    self?: boolean;

    /**
     * If `true`, then the effect when clicking on the child element will not work,
     * if in the tree of its parents there is an element bound to it
     * directive and this element is a child of the current one. Default
     * `true`, so you need to explicitly specify `false` to disable this option
     *
     * @default true
     */
    noNested?: boolean;

    /**
     * Additional css styles for the container
     */
    containerStyle?: Partial<CSSStyleDeclaration>;

    /**
     * Additional css styles for the ripple
     */
    circleStyle?: Partial<CSSStyleDeclaration>;

    /**
     * The absolute value of the maximum radius of the circle (in pixels).
     * By default, the circle is stretched enough to completely cover the entire
     * element.
     *
     * `null` means to stretch
     */
    radius?: number | null;
}