marbie77/emailcountdown

用于生成GIF的Email倒计时类

2.1.0 2021-10-23 19:58 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:25:16 UTC


README

一些简单的PHP类,用于生成倒计时(60秒GIF动画),可用于电子邮件中的假计数器

该图像本身与Outlook兼容,但它只显示GIF动画的第一帧。

安装

使用Composer来安装它

composer require marbie77/emailcountdown

使用方法

创建类,使用选项并输出GIF。

$emailCountdown = (new EmailCountdown\CircleCountdown())->setDestinationTime(! empty($_GET['dest_time']) ? $_GET['dest_time'] : null)
    ->setTextColor(! empty($_GET['text_color']) ? $_GET['text_color'] : null)
    ->setBackgroundColor(! empty($_GET['background_color']) ? $_GET['background_color'] : null);

// content type gif
header('Content-Type: image/gif');
// no caching of gif, so it gets reloaded every time
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
echo $emailCountdown->getGIFAnimation();

示例

要检查示例,首先使用composer install安装依赖项

然后导航到example.phpexample_wallpoet.php

更新日志

2.1.0

  • 添加来自simoheinonen的设置最大帧数的PR

2.0.1

  • 添加自定义显示文本和位置的函数
  • 添加字体Wallpoet-Regular以显示额外的示例(example_wallpoet.php)

2.0.0

  • 添加PHPDocs和新的编码标准,例如
    • 从属性和方法中删除所有下划线
    • 现在使用camelCase
  • 包含来自@igumenov的PR - 感谢!

1.0.0

  • 初始版本