| 1 |
<?php |
| 2 |
namespace Depicter\Document\Models\Elements; |
| 3 |
|
| 4 |
use Depicter\Html\Html; |
| 5 |
|
| 6 |
class PlayAndPause extends Svg { |
| 7 |
|
| 8 |
/** |
| 9 |
* render play and pause markup |
| 10 |
* @return \TypeRocket\Html\Html|void |
| 11 |
*/ |
| 12 |
public function render() { |
| 13 |
$args = $this->getDefaultAttributes(); |
| 14 |
|
| 15 |
$playIcon = $this->options->playIcon; |
| 16 |
$pauseIcon = $this->options->content; |
| 17 |
|
| 18 |
$playIcon = str_replace('<svg ', '<svg class="depicter-play-icon" ', $playIcon ); |
| 19 |
$pauseIcon = str_replace('<svg ', '<svg class="depicter-pause-icon" ', $pauseIcon ); |
| 20 |
|
| 21 |
return Html::div( $args, "\n" . $playIcon . "\n" . $pauseIcon . "\n" ); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Get svg selector |
| 26 |
* |
| 27 |
* @return string |
| 28 |
*/ |
| 29 |
public function getSvgSelector() { |
| 30 |
return '.' . $this->getSelector() . ' svg'; |
| 31 |
} |
| 32 |
} |
| 33 |
|