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 🙏

© 2026 – Pkg Stats / Ryan Hefner

gmacc-flip-book

v1.0.2

Published

Una librería JavaScript moderna para visualizar documentos PDF en formato flipbook interactivo con animaciones 3D

Downloads

335

Readme

📖 Flipbook

Una librería JavaScript moderna y ligera para visualizar documentos PDF en formato flipbook interactivo con animaciones 3D realistas.

Version License TypeScript

✨ Características

  • 🎨 Animaciones 3D realistas - Efecto de volteo de página con perspectiva 3D.
  • 🔍 Zoom y Pan - Navegación intuitiva con rueda del mouse, botones dedicados y arrastre fluido.
  • Responsive nativo - Cambio automático entre modo "Spread" (dos páginas) en escritorio y modo "Single Page" en móviles.
  • 🛠️ Barra de herramientas integrada - Incluye controles de navegación, contador de páginas, zoom dinámico y menú de compartir.
  • Descarga de PDF - Funcionalidad de descarga integrada.
  • 🔗 Menú Social - Compartir directamente en WhatsApp, Facebook, X (Twitter), Instagram o copiar enlace.
  • Carga Dinámica - Capacidad de cargar nuevos archivos PDF sin recargar la instancia.

📦 Instalación

npm install gmacc-flip-book

🚀 Uso Rápido

TypeScript / JavaScript

import { Flipbook } from "gmacc-flip-book";
import "gmacc-flip-book/styles";

const flipbook = new Flipbook("book-container", "/mi-documento.pdf", {
  onPageChange: (current, total) => {
    console.log(`Página actual: ${current}/${total}`);
  },
});

HTML Directo (como módulo)

<!DOCTYPE html>
<html lang="es">
  <head>
    <meta charset="UTF-8" />
    <title>Demo Flipbook</title>
    <!-- Los estilos se importan automáticamente si usas un bundler, 
         o puedes referenciar el CSS directamente si es necesario -->
  </head>
  <body>
    <div id="book-container" style="width: 100%; height: 600px;"></div>

    <script type="module">
      import { Flipbook } from "https://unpkg.com/gmacc-flip-book/dist/lib/index.js";

      const fb = new Flipbook("book-container", "/sample.pdf");
    </script>
  </body>
</html>

📚 API

Constructor

new Flipbook(containerId: string, pdfUrl: string, options?: FlipbookOptions)

Opciones de Configuración (FlipbookOptions)

| Propiedad | Tipo | Default | Descripción | | :----------------- | :--------- | :------ | :--------------------------------------------------------------------------- | | width | number | 600 | Ancho base para el renderizado interno. | | height | number | 800 | Alto base para el renderizado interno. | | onPageChange | function | - | Callback ejecutado al cambiar de página. Recibe (currentPage, totalPages). | | enableDownload | boolean | true | Muestra/Oculta el botón de descarga en la navbar. | | downloadFileName | string | - | Nombre personalizado para el archivo descargado. |

Métodos Públicos

| Método | Descripción | | :------------------------ | :--------------------------------------------------- | | loadNewPDF(url: string) | Reemplaza el PDF actual por uno nuevo dinámicamente. | | nextPage() | Avanza a la siguiente página. | | prevPage() | Retrocede a la página anterior. | | goToFirstPage() | Salta directamente a la primera página. | | goToLastPage() | Salta directamente a la última página. | | download() | Dispara la descarga del PDF actual. |

🖱️ Interacciones

  • Click en los bordes: Voltear páginas hacia adelante o atrás.
  • Rueda del mouse: Control de zoom fino.
  • Botones +/-: Zoom en pasos definidos.
  • Arrastrar (Drag): Desplazar el libro cuando se tiene zoom aplicado.
  • Auto-Ajuste: Al redimensionar la ventana, el libro recalcula su tamaño óptimo para no cortarse.

🛠️ Desarrollo Local

Si deseas contribuir o modificar la librería:

  1. Clone el repo: git clone https://github.com/GermanMacchia/flip-book.git
  2. Instale dependencias: npm install
  3. Inicie el servidor de desarrollo: npm run dev
  4. Construya la librería: npm run build:lib

📝 Licencia

Distribuido bajo la licencia MIT. Ver LICENSE para más información.


Hecho con ❤️ por Germán Macchia