PluginProbe
Depicter — Popup & Slider Builder / 1.6.2
Depicter — Popup & Slider Builder v1.6.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Document / Models / Elements / LineTimer.php

LineTimer.php in Depicter — Popup & Slider Builder 1.6.2, at app/src/Document/Models/Elements/LineTimer.php

61 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\Document\Models\Elements;
3
4 use Depicter\Document\Models\Element;
5 use Depicter\Html\Html;
6
7 class LineTimer extends Element {
8
9 /**
10 * render lineTimer markup
11 * @return \TypeRocket\Html\Html|void
12 */
13 public function render() {
14 $args = $this->getDefaultAttributes();
15 return Html::div( $args );
16 }
17
18 /**
19 * get timer bar selector
20 * @return string
21 */
22 protected function getTimerBarSelector() {
23 return '.' . $this->getSelector() . ' .depicter-timer-bar';
24 }
25
26 /**
27 * get timer bar styles
28 * @return array
29 */
30 protected function getTimerBarCss() {
31 $styles = [];
32
33 foreach ( $this->devices as $device ) {
34 if ( isset( $this->options->lineTimer->styles->color->{$device} ) ) {
35 $styles[ $device ]['background-color'] = $this->options->lineTimer->styles->color->{$device};
36 }
37
38 if ( isset( $this->options->lineTimer->styles->radius->{$device} ) ) {
39 $borderRadius = $this->options->lineTimer->styles->radius->{$device}->value;
40 $styles[ $device ]['border-radius'] = $borderRadius->topRight->value . $borderRadius->topRight->unit ." " . $borderRadius->bottomRight->value . $borderRadius->bottomRight->unit ." " .$borderRadius->bottomLeft->value . $borderRadius->bottomLeft->unit ." ". $borderRadius->topLeft->value . $borderRadius->topLeft->unit;
41 }
42 }
43
44 return $styles;
45 }
46
47 /**
48 * Get list of selector and CSS for element
49 *
50 * @return array
51 * @throws \JsonMapper_Exception
52 */
53 public function getSelectorAndCssList(){
54 parent::getSelectorAndCssList();
55
56 $this->selectorCssList[ $this->getTimerBarSelector() ] = $this->getTimerBarCss();
57
58 return $this->selectorCssList;
59 }
60 }
61