Download the PHP package bnomei/kirby3-srcset without Composer

On this page you can find all versions of the php package bnomei/kirby3-srcset. 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 kirby3-srcset


With Kirby 3.6 introducing support for WebP & AVIF images and the lazy-attribute being well supported by modern browsers this plugin has in my opinion become obsolete. Thus I will not continue to work on it.

Kirby 3 Srcset

Release Downloads Build Status Coverage Status Maintainability Twitter

Kirby 3 Plugin for creating lazyloading image srcset

This plugin extends the core (image: )-Kirbytag. All params that work for (image: ) can be used with (lazysrcset: ) yielding the same output. By default the plugin does add the following:

TOC

  1. Commercial Usage
  2. Installation
  3. Usage Kirbytag
  4. Usage Editor Block
  5. Usage PHP
  6. Setup
  7. Settings
  8. FAQ
  9. Image Ratio

Commercial Usage


Support open source!

This plugin is free but if you use it in a commercial project please consider to sponsor me or make a donation.
If my work helped you to make some cash it seems fair to me that I might get a little reward as well, right?

Be kind. Share a little. Thanks.

‐ Bruno
 

M O N E Y
Github sponsor Patreon Buy Me a Coffee Paypal dontation Buy a Kirby license using this affiliate link

Installation

Usage Kirby Tag

image lazysrcset
alt, caption, class, height, imgclass, link, linkclass, rel, target, text, title, width sizes, lazy, prefix, autosizes, quality, figure

Usage Editor Block

srcset editor block

Specifically allow plugin block

When you specifically define which blocks are allowed in an editor field you need to add the plugin block like this:

Usage PHP

Setup

Config

You need to define srcsets. The plugin will use these as well as the core $file->srcset() function.

/site/config/config.php

JS

Add aFarkas/lazysizes to your js dependencies and RTFM. You can also use lozad.js with little adjustments in the settings.

Minimal CSS for auto-sizes detection

You will need some css to make the lazysizes lib automatic size detection work.

IMPORTANT: The css must be applied to the DOM before the JS is executed. Make sure the order is right and they are not async applied. With a lib like muicss/loadjs you can load them asyn and apply them in proper order. Otherwise you will face blurry images on first load.

CSS for hinted image ratio

By default the images ratio is hinted by the plugin to minimize reflows and avoid page jumps. You just need to add the following css to you codebase.

TIP: you can use a different class name if you set ratio to a different string. If you set either ratio or figure to false the ratio hints will disappear.

CSS

tailwind.css

Each figure element will be prefixed with a style element defining the ratio. For example the css style for an image with 16/9 ratio followed by its figure image element would look like this:

without figcaption: figure > img

with figcaption: figure > ((div > img) + figcaption)

with nonce

You can set a custom nonce using the options or install the security headers plugin.

Settings

bnomei.srcset. Default Description
lazy lazyload bool or string. additional class for imgclass param
prefix data- bool or string. prefix before srcset and src when doint lazy loading
autosizes auto bool or string. related to data-sizes attribute
figure true bool. wrap image in figure or not
ratio lazysrcset-ratio bool or string. adds data-ratio to parent of img
nonce null null, string or callback. default nonce for style element

FAQ

Works well with

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

MIT

It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.


All versions of kirby3-srcset with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
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 bnomei/kirby3-srcset contains the following files

Loading the files please wait ....