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

rfx-parallax

v3.3.5

Published

RfxParallax - parallax made easy

Downloads

21

Readme

RfxParallax

Parallax made easy

Features

  • Apply directive to your component and enjoy
  • Image automatically adapts into its container
  • Compatible with custom scrollbars
  • Disable / enable parallax
  • Disable / enable parallax container overflow
  • Configurable image scroll percentage, z-index and zoom position
  • Best performance with translate3d
  • ~~Asynchronous browser scrolling disabled for better performance~~ (Coming soon)

Installation

Install the npm package:

npm install rfx-parallax

Import module:

import { RfxParallaxModule } from 'rfx-parallax';

@NgModule({
  imports: [
    RfxParallaxModule
  ]
})

Initialize parallax

In your app.component.ts initialize parallax listeners inside ngOnInit

import { RfxParallaxService } from 'rfx-parallax';

constructor(private rfxParallaxService: RfxParallaxService) {}

public ngOnInit(): void {
  this.rfxParallaxService.initListeners();
}

and if you have a custom scrollbar component you can pass the nativeElement to the initListeners() function like this: WARNING: use ngAfterViewInit instead of ngOnInit otherwise your nativeElement may not be defined

<custom-scrollbar #scrollbar>
  <!-- Your page here -->
</custom-scrollbar>
@ViewChild('scrollbar') public scrollbarElement: ElementRef;

public ngAfterViewInit(): void {
  this.rfxParallaxService.initListeners(this.scrollbarElement.nativeElement);
}

Usage

just apply libRfxParallax to your container and pass the image url

<div libRfxParallax imageUrl="<image-path>"></div>

Configuration

parallaxPercentage: number

(default value: 40) percentage of image scrolling, e.g. 40% will scroll 40% of the image

positionPercentage: number

(default value: 50) image zoom position in percentage, e.g. 50% will zoom to the center

imageZIndex: number

(default value: -1) z-index property of the image

visibleOverflow: boolean

(default value: false) container overflow

isDisabled: boolean

(default value: false) is parallax disabled

forceFullWidth: boolean

(default value: false) force image to be the same width as container. usefull when you have visibleOverflow set to true

Missing configuration parameter? Request it here: https://github.com/RedFoxxo/RFXLibrary/issues

Demo

https://demo.redfoxxo.dev/rfx-parallax

License

This project is licensed under the MIT License