dmnc/ssip
最新稳定版本:v1.1.0
Composer 安装命令:
composer require dmnc/ssip
包简介
Super simple (SVG) image placeholders
README 文档
README
Introduction
This package is designed to allow the creation of image placeholders with minimal fuss by providing data URIs to be substituted into an img or source's src or srcset attributes.
The aim is to create a placeholder that meets the following criteria:
- Behaves exactly like a genuine image when styled and resized.
- Can be used when developing offline.
- Does not require additional JavaScript introduced into the page.
- Keeps data URI size to a minimum.
The only option right now is to use SVG for this.
Installation
composer require dmnc/ssip
Usage
Placeholders are immutable and created directly through their constructor.
use Dmnc\Ssip\Placeholder; $placeholder = new Placeholder(100, 50, "#aaa"); echo '<img src="' . $placeholder . '" alt="Stay accessible out there" />';
Support
Currently tested on:
- Chrome 80
- Firefox 73
- Safari 12.1
- Edge 18
- IE11
- IE10
Alternatives
If you require more feature rich placeholders, and are able to add JavaScript into your page, I suggest the fantastic Holder.js.
统计信息
- 总下载量: 142.26k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-13