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

lookin

v1.0.6

Published

This will create "parallax" scenes where you lookin as if looking into a fish bowl

Downloads

7

Readme

#lookin ##class: lookin~lookin Members

###new lookin~lookin(settings) lookin allows you to create parallaxed scenes where you're rotating the camera easily.

It will adhere to the original css defined for the element as much as possible.

To instantiate lookin you must pass in a settings object.

This settings object must contain a "container" dom element or a selector string for that dom element. After this all items to be made 3d should exist in this container.

Here are settings you can pass to lookin:

{
	/// required ///

	/// optional //
	el: 'body', // this is a dom element or selector to the container which will contain items
				// to parallax or make 3d. By default the body will be used if nothing is passed
	perspective: 1000 // the perspective value for the 3d camera. By default this is 1000
}

Params

  • settings Object - The properties what you can send in via settings is described above

Scope: inner class of lookin
Returns: lookin - An instance of lookin
Example
The following will create a parallax scene where one item is being inverse scaled and the other is not.

var lookin = require( 'lookin' );

var scene = lookin();

scene.create( {
	el: 'item3d',
	z: -1000,
	inverseScale: true // will compensate items scale to keep it original scale
})
.create( {
	el: 'item3d2',
	z: -300,
	inverseScale: false // will not scale item to remain at original size
});

window.onmousemove = function( ev ) {

	scene.origin( ev.pageX / window.innerWidth, ev.pageY / window.innerHeight );
};

###lookin.create(settings) create will make a new "3d item".

create expects a settings object. This object may contain name which can be used as a key to reference 3d items after.

Other settings which you can pass are defined in the README.md for item3d.

Params

  • settings Object - See above for description of settings

###lookin.get(name) using get you can query the 3d items which the lookin scene contains. Pass in a string which is a key to a 3d item defined in the create function.

Params

  • name String - a key to the 3d item previously created in create

Returns: item3d - this is an item3d object if found and undefined if not found
###lookin.origin(x, y) this function will change the perspective-origin of the container element passed when setting up lookin.

For example if using with a mobile device as the accelerometer sends data you would send in percentages for the amount of rotation.

Params

  • x Number - the x value for perspective origin. Typically between 0 - 1 however theres nothing stopping you from sending smaller or larger values.
  • y Number - the y value for perspective origin. Typically between 0 - 1 however theres nothing stopping you from sending smaller or larger values.