Download the PHP package sayamaapps/kirby-emaki without Composer

On this page you can find all versions of the php package sayamaapps/kirby-emaki. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-emaki

Emaki

Image viewer for Kirby CMS 5: a dependency-free lightbox with srcset gallery tiles.

Emaki (絵巻, a Japanese picture scroll) shows the images of a page one after another in a native <dialog>. Served from your own server, it uses no CDN, no inline code and no cookies. It styles only the viewer; the gallery grid is yours.

Features

Requirements

Installation

Composer installs to site/plugins/emaki/. Add that path to .gitignore and deploy it like vendor/.

Usage

Switch Emaki on in site/config/config.php (off by default):

Print the viewer's tags once per page:

Render a gallery from the images of a page. Style .emaki-gallery and .emaki-item yourself:

Own markup

Any container with data-emaki is one sequence; a container nested in another is its own. Links to image files inside it take part (.jpg, .jpeg, .png, .gif, .webp, .avif, .svg, or any link with data-srcset). href is the large view: a rendered variant, never the original file.

Optional link attributes: data-srcset and data-sizes (large view), data-emaki-caption (empty means no caption; otherwise the <img> alt is the caption), data-emaki-image (passed to emaki:open). Without a container, or without <dialog>, Emaki creates nothing.

$file->emaki()

$file->emaki(array $options = []) returns the attributes of one tile and its large view, or null when no thumb can be made. The <a> keys are href, data-srcset and data-sizes; the <img> keys are src, srcset, sizes, width, height, alt, loading and decoding. href is the largest large view. src is the smallest tile at least 720 px wide, or the largest tile. A file Kirby cannot resize (SVG) keeps its own URL and has no srcset. Add the caption and image name yourself.

Kirby creates the thumbs on the first render: up to eight per image by default. After a deploy that empties the media folder, load the gallery pages once, or configure fewer widths. If a thumb cannot be written, the gallery leaves that image out with an HTML comment, and $file->emaki() returns null. A resizable image never falls back to its original.

Counting

Emaki fires emaki:open on the link of each image shown: when the viewer opens and on every step. The event bubbles. detail holds href, image (data-emaki-image or null), index (0-based) and count.

Styling

Set the colour tokens on :root, or on any ancestor of the dialog:

Token Default Meaning
--emaki-bg rgb(12 16 20 / 0.88) Backdrop behind the image.
--emaki-fg #f4f5f3 Text and button symbols.
--emaki-accent #ffffff Focus ring of the buttons and the counter.

Emaki styles .emaki (the dialog) and its parts: .emaki-stage, .emaki-image, .emaki-caption, .emaki-counter, .emaki-close, .emaki-prev and .emaki-next. States: .emaki--motion (animation, only without reduced motion) and .is-loading (while an image loads).

Functions

Options

Config options are read as emaki.<name>, flat or nested; null means "not set". Scope: config for emaki.*, call for $file->emaki(), gallery for snippet variables.

Option Scope Default Meaning
active config false Master switch; only true turns Emaki on. Off: no tags, plain gallery links, $file->emaki() still works.
language config request, default language, locale, then en Label language, en or de.
texts config none Label overrides, flat or per language (keys below).
script config true false omits the <script> from emaki_tags(), for sites that bundle emaki.js.
style config true false omits the <link>, for sites that bundle emaki.css.
srcset config 'emaki' Large-view widths: a thumbs.srcsets preset or a list. Without a preset: 800, 1200, 1800, 2400.
thumbnail config 'emaki-tile' Tile widths, same rules. Without a preset: 320, 480, 720, 960.
sizes config '100vw' sizes of the large view, written as data-sizes.
format config, call null Thumb format, such as webp. A call value wins over emaki.format; null uses Kirby's thumbs.format, else the file's own format.
quality config, call null Thumb quality. A call value wins over emaki.quality; null uses Kirby's thumbs.quality.
large call emaki.srcset Large-view preset or widths for this call.
tile call emaki.thumbnail Tile preset or widths for this call.
sizes call, gallery '(max-width: 40rem) 100vw, 33vw' sizes of the tile <img>, not the large view (emaki.sizes).
files gallery none Files or any iterable; non-images are skipped.
caption gallery 'alt' 'alt': the alt text. A field name: that field's value. false: none (empty data-emaki-caption).
image gallery none File field whose value becomes data-emaki-image, for counting.
class gallery none Extra classes on the container.
tag gallery 'div' Container element.
attrs gallery none Extra container attributes; only data-*, aria-* and id are kept.

A preset entry contributes only its width; its quality and format are ignored, and the options apply.

Override labels with texts: flat for all languages ('emaki.texts' => ['button.close' => 'Done']) or per language ('emaki.texts' => ['de' => ['button.close' => 'Schließen']]). Keys and English defaults: dialog (Image {n} of {count}), counter ({n} / {count}), button.close (Close), button.prev (Previous image), button.next (Next image). German ships too; the labels are also Kirby translations as emaki.<key>.

Privacy

Emaki processes no visitor data: no cookies, no browser storage, no tracking. It requests only your own files and the images your markup links (the open image and its two neighbours). An image on another host is fetched from that host, which sees the request. Nothing needs to be added to a privacy policy while the images come from your own server.

Maintenance

Tests: composer test (PHP) and npm run test:web (browser). Issues and pull requests are welcome, without a support promise. Report security problems privately through GitHub's vulnerability reporting. Changes: CHANGELOG.md.

License

MIT, see LICENSE.


All versions of kirby-emaki with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
getkirby/composer-installer Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sayamaapps/kirby-emaki contains the following files

Loading the files please wait ...