ramoose/hold-my-place
Composer 安装命令:
composer require ramoose/hold-my-place
包简介
Generate base64 placeholder images.
README 文档
README
Motivation
Makes prototyping easier: no external placeholder image service needed, no local image library needed.
Just make your pixel image and scale with CSS. That's it.
usage (with composer)
Require
require __DIR__."/app/vendor/autoload.php"; use Ramoose\HoldMyPlace\Base64pixel as B64; // B64::create(string $color, string $format);
HTML examples
Create your pixel. See php documentation on ImagickPixel::__construct for color code options. link
<img class="placeholder" src="<?=B64::create("red")?>"/> <img class="placeholder" src="<?=B64::create("green")?>"/> <img class="placeholder" src="<?=B64::create('rgb(0, 0, 0)')?>"/>
Methods
Base64pixel::create(string $color = 'red', string $format = 'png');
Base64pixel::random(string $format = 'png');
Demo
composer test will execute the following: php -S localhost:8000 ./test.php
You can then see the demo in your browser by navigating to http://localhost:8000.
The demo page will also give you a list of image formats you build of Imagick supports.
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2018-10-28