vitamin2/v2-image-factory
最新稳定版本:0.2.1
Composer 安装命令:
composer require vitamin2/v2-image-factory
包简介
V2 Image Factory
README 文档
README
Just an image factory
Installation
Download
Download and copy this repository to /site/plugins/v2-image-factory.
Composer
composer require vitamin2/v2-image-factory
Setup
Install plugin
Add Image Factory JS to your template (getFactoryJS returns a versionised JS file)
<?= js([
getFactoryJs(),
]) ?>
- Preload it (optional)
<link rel="preload" href="<?= getFactoryJs() ?>" as="script" />
Usage
imageURL choose image
imageType choose crop type
- variousHeights (choose this if you have differnt image heights, e.g for base image or logos)
- cropToRatio (choose this if you have a fixed ratio e.g. for gallery, headers)
- cropToRatioMultiple (choose this if you have 2 ratios, mobile and desktop)
imageRatio (for cropToRatio and cropToRatioMultiple) choose image ratio (e.g. 16/9 = 1.777 or 4/3 = 1.333)
imageRatioDesktop (for cropToRatioMultiple) choose image ratio for Desktop
imageCustomClass add a custom class here
imageCropToPoint (for cropToRatio, cropToRatioMultiple) select crop point
- default is center, but you can also set left, top, etc.
snippet('global/image-factory', [
'imageURL' => $data->gallery()->toFile(),
'imageType' => 'variousHeights',
'imageRatio' => '1.333',
'imageRatioDesktop' => '3',
'imageCustomClass' => '',
'imageCropToPoint' => 'center'
])
License
MIT
统计信息
- 总下载量: 31
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-10