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-image-list-distort

v1.0.33

Published

A react component which takes a list of items with images inside them and shows/distorts the listitems image on hover

Downloads

25

Readme

React Image List Distort Component

Creates a threejs canvas which shows and distorts an image when you hover a listitem that wraps an image tag.

Demo

preview image

Installation

npm install react-image-list-distort

Basic Usage

import ImageDistort from "react-image-list-distort";

// You do not have to use ul/li tags, and you can insert other siblings.
// What's important is the classnames and their hierarchy.
<ul className="myListRoot">
  <li className="myListItem">
    <img src="..." />
  </li>
  <li className="myListItem">
    <img src="..." />
  </li>
</ul>

<ImageDistort
  styles={{ zIndex: 10 }}
  listRoot={".myListRoot"}
  itemRoot={".myListItem"}
  options={{
    strength: 0.2,
    effect: "stretch",
    geometry: {
      shape: "circle",
      radius: 0.5,
      segments: 128
    }
  }}
></ImageDistort>;

Props

{
  Object;
}
[(styles = {})]; // object with custom styles
{
  String;
}
itemRoot; // selector for the toplevel list item which holds the image
{
  String;
}
listRoot; // Wrapper for the listItems in the shape of a css class selector.
{
  Object;
}
[options]; // Object for option settings
{
  Number;
}
[(options.strength = 0.25)]; // How powerful the distort is
{
  String;
}
[(options.effect = "")]; // A string defining what extra effect to apply. Defaults to "redshift", can also pass "stretch"
{
  Object;
}
[options.geometry]; // Object containing all options regarding the shape that holds the image
{
  String;
}
[(options.geometry.shape = "circle")]; // A string defining the shape of the geometry. Defaults to "circle", can also pass "plane". If circle then the image should be square.
{
  Number;
}
[(options.geometry.radius = 0.6)]; // A number defining the radius(size) of the shape. Only applicable when shape is 'circle'
{
  Number;
}
[(options.geometry.segments = 64)]; // Defines the number of segments of the shape when the shape is 'circle
{
  Number;
}
[(options.geometry.width = 1)]; // Defines the width of the shape when the shape is 'plane'
{
  Number;
}
[(options.geometry.height = 1)]; // Defines the height of the shape when the shape is 'plane'
{
  Number;
}
[(options.geometry.segmentsWidth = 32)]; // Defines the number of segments on the X-axis of the shape when the shape is 'plane'
{
  Number;
}
[(options.geometry.segmentsHeight = 32)]; // Defines the number of segments on the Y-axis of the shape when the shape is 'plane'