2.2.0 • Published 2 years ago

ng-zoom v2.2.0

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

✨ Features

  • 👌 Zero-dependency
  • 🧬 Perfect for dynamic content, mutation-agnostic — you can do whatever you want with images, it'll work
  • ⚡️ Blazing fast — no matter if it's 10 images or 10,000
  • 🤓 Powered by quirky math to precisely calculate everything and do the trick with only one transformation
  • 🍦 Zero-configuration by default but extensible when you need it
  • 🗿 Works flawlessly even on iOS Safari, in every orientation, with every image no matter the size and dimensions

🔑 License

MIT

🖥 Environment Support

  • Angular ^13.0.0

📦 Installation

$ npm install ng-zoom

🔨 Usage

Import the ng-zoom module into the app.module.ts file.

import { NgZoomModule } from 'ng-zoom';

@NgModule({
  imports: [NgZoomModule],
})
export class AppModule {}

Use the ng-zoom directive in your .html files.

<img ng-zoom src="lake.png" alt="lake" />

⚙️ Configuration

Pass a NgZoomConfig object to the module's forRoot method.

import { NgZoomConfig, NgZoomModule } from 'ng-zoom';

const config: NgZoomConfig = {
  backgroundColor: 'skyblue',
};

@NgModule({
  imports: [NgZoomModule.forRoot(config)],
})
export class AppModule {}

🏷️ Config reference

PropertyTypeDefaultDescription
backgroundColorstring#ffffffThe background color of the wrapper element.
scaleUpbooleantrueDefines if an element should be scaled up when zooming or maintain its original size.
paddingnumber20Padding in pixels
durationnumber300The duration of the zoom animation in milliseconds.
2.2.0

2 years ago

2.1.0

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago