comimiは、Webサイトに漫画ビューワーを組み込むことができるTypeScript/JavaScriptライブラリです。
ReactなどのUIライブラリに依存していないため、単体で動作します。
cap.mp4
npm install @yui540/comimiimport { createMangaViewer } from "@yui540/comimi";
createMangaViewer(document.querySelector("#viewer")!, {
manga: {
id: "sample",
title: "サンプル漫画",
author: "yui540",
pages: [
{ id: "p0", type: "image", src: "/pages/0.webp" },
{ id: "p1", type: "image", src: "/pages/1.webp" },
{ id: "p2", type: "image", src: "/pages/2.webp" },
],
},
});これが最小構成です。ビューワーは #viewer にマウントされ、DOMを自動的に管理します。戻り値のインスタンスを通じて、ページ送りや設定・イベント操作も行えます。
APIの詳細、オプション、設定、キーボードショートカット、永続化、i18n については docs/USAGE.md に記載しています。
MIT
