Download the PHP package artemdanilov/flexipic without Composer

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

Flexipic Statamic Addon

Overview

Flexipic is a Statamic addon designed to effortlessly generate responsive images on-the-fly using Glide and integrate them seamlessly into your Statamic projects using the picture tag.

Installation

Require it using Composer.

composer require artemdanilov/flexipic

After installation, Flexipic will create config/statamic/flexipic.php file.

Usage

To enable Flexipic and generate responsive images, simply insert the following line of code wherever you intend to display an image:

{{ flexipic :src="assets" }}

or

{{ flexipic src="url_to_image" }}

It will generate a <picture> tag with <source> and <img> tags inside.

In example above, images are generated based on parameters from the config file. These parameters are necessary for global usage. However, you are free to rewrite these parameters directly in your tag:

{{ flexipic
    :src="image"
    :width="[320, 640]"
}}

In the example above, the tag will generate two images with widths of 320px and 640px respectively. As you may notice, we do not specify a height property, as the height is calculated automatically based on meta tags. If you want to set another height for your image, feel free to do so:

{{ flexipic
    :src="image"
    :width="[320, 640]"
    height="400"
}}

The tag will set a height of 400px for the first value from the width array and calculate the height for the second value.

Of course, there are more parameters you can use inside.

! If your image URL is from an external source, you need to specify a height. !

Available parameters

Flexipic supports various parameters that you can include in your tag, each of which will be generated as HTML attributes. However, certain parameters are excluded from generating attributes, like quality, fit or placeholder.

Parameters Values description
src url or path Specifies the source URL or path of the image
width [480, 768, 1024, ...] Specifies the width(s) of the image in pixels
height number Specifies the height of the image in pixels
sizes (max-width: 320px) 480px, 768px Specifies the sizes of the image in a responsive context
quality 0-100 Specifies the image quality, which affects file size and compression level
fit contain, max, fill, fill-max, stretch, crop, crop-focal Sets how the image is fitted to its target dimensions
loading eager or lazy Specifies whether the image should be loaded immediately (eager) or lazily (lazy).
placeholder "blur", "false" or your custom value Specifies whether a placeholder should be generated for lazy loading purposes
class string of classes Specifies additional CSS classes to apply to the image element.
wrapper_class string of classes Specifies additional CSS classes to apply to the picture element.

Lazyloading

If you set loading and placeholder parameters for smooth lazyload effect, you should to pass a JS function to your resources/js/site.js file

import flexipicLazyload from '../../vendor/artemdanilov/flexipic/dist/flexipicLazyload.min';

window.addEventListener('DOMContentLoaded', () => {
    flexipicLazyload('.flexipic');
})

Support

If you encounter any issues or have questions about using Flexipic, please don't hesitate to reach out to me [email protected]

License

Flexipic is licensed under the MIT License. Feel free to use, modify, and distribute it according to your needs.


All versions of flexipic with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
bepsvpt/blurhash Version ^3.0
statamic/cms Version ^5.0
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 artemdanilov/flexipic contains the following files

Loading the files please wait ....