| 1 |
<?php |
| 2 |
namespace Depicter\Document\Models\Common\Styles; |
| 3 |
|
| 4 |
use Depicter\Document\CSS\Breakpoints; |
| 5 |
|
| 6 |
class Transition extends States |
| 7 |
{ |
| 8 |
/** |
| 9 |
* @var string |
| 10 |
*/ |
| 11 |
public $timingFunction; |
| 12 |
|
| 13 |
/** |
| 14 |
* @var int |
| 15 |
*/ |
| 16 |
public $duration; |
| 17 |
|
| 18 |
/** |
| 19 |
* style name |
| 20 |
*/ |
| 21 |
const NAME = 'transition'; |
| 22 |
|
| 23 |
public function set( $css ) { |
| 24 |
$devices = Breakpoints::names(); |
| 25 |
foreach ( $devices as $device ) { |
| 26 |
if ( !empty( $this->{$device} ) ) { |
| 27 |
if ( !empty( $this->{$device}->enable ) ) { |
| 28 |
$duration = isset( $this->{$device}->duration ) ? $this->{$device}->duration : 0; |
| 29 |
$css[ $device ][ self::NAME ] = "all " . $this->{$device}->timingFunction . ' ' . $duration . 's'; |
| 30 |
} |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
return $css; |
| 35 |
} |
| 36 |
} |
| 37 |
|