Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

web-touch-ripple

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web-touch-ripple

Visual representation of the pointer event to a user.

  • 1.1.0-alpha.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17
decreased by-74.24%
Maintainers
1
Weekly downloads
 
Created
Source

Touch Ripple For Web

Use web components to implement efficient and simple touch ripple effects.

Preview

This is preview of simplest example.

This may be different from the real thing (by gif)

ezgif-2-d586f8046c

How to apply ripple element

Please referance to a codes below!

Staticly

This is a solution of converting a string into a function and using it.

Not recommended to use it in this way and it can mainly be used for debugging purposes.

<!-- Called when a user taps or clicks. -->
<touch-ripple ontap="console.log('hello world!')">
    <h1 style="padding: 15px;">
        Tappabe
    </h1>
</touch-ripple>

Locally

This is the most ideal and widely used solution.

<touch-ripple id="ripple">...</touch-ripple>
<script>
    // in script.
    const ripple = document.getElementById("ripple");

    // Called when a user taps or clicks.
    ripple.ontap = () => console.log("hello world!");
</script>

Static variables of CSS

NameDescriptionDefault Value
--ripplebackground color of touch-ripple effect.rgba(0, 0, 0, 0.2)
--ripple-fadein-durationDuration until the ripple effect completely fills the element.0.2s
--ripple-fadeout-durationDuration until the ripple effect disappears.0.3s
--ripple-blur-radiusThe blur effect radius of touch ripple.10px
--ripple-lower-scaleThe ripple scale of start point.0.3
--ripple-upper-scaleThe ripple scale of end point.1

Keywords

FAQs

Package last updated on 21 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc