'txt', 'title' => 'Text', 'type' => [ 'name' => 'string', 'min' => self::TEXT_MIN, 'max' => self::TEXT_MAX, ], ], ]; } public function setEffectParams(array $vars, bool $quiet = false): void { if(isset($vars['txt']) && is_string($vars['txt'])) { if(!$quiet && (mb_strlen($vars['txt']) < self::TEXT_MIN || mb_strlen($vars['txt']) > self::TEXT_MAX)) throw new PageEffectException('Your text is too long or too short.'); $this->text = $vars['txt']; } } public function getEffectParams(): array { return [ 'txt' => $this->text, ]; } public function applyEffect(PageBuilder $builder): void { $tags = []; for($i = 1; $i <= 50; $i++) { $tags[] = new HtmlTag('div', ['class' => 'ZoomText_Child', 'style' => sprintf('font-size: %1$dpt; top: %1$dpx; left: %2$dpx; color: rgb(%3$d, %3$d, %3$d);', $i * 2, $i, $i === 50 ? 0 : (4 * $i))], [new HtmlText($this->text)]); } $builder->getContainer()->appendChild(new HtmlTag('div', ['class' => 'ZoomText'], $tags)); } }