PluginProbe
Depicter — Popup & Slider Builder / trunk
Depicter — Popup & Slider Builder vtrunk
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 / Common / Styles / Transition.php

Transition.php in Depicter — Popup & Slider Builder trunk, at app/src/Document/Models/Common/Styles/Transition.php

49 lines 1.2 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\Common\Styles;
3
4 use Depicter\Document\CSS\Breakpoints;
5 use Depicter\Document\Helper\Helper;
6 use Depicter\Document\Models\Traits\HoverAbleStyleTrait;
7
8 class Transition extends States
9 {
10 use HoverAbleStyleTrait;
11
12 /**
13 * @var string
14 */
15 public $timingFunction;
16
17 /**
18 * @var float
19 */
20 public $duration;
21
22 /**
23 * style name
24 */
25 const NAME = 'transition';
26
27 public function set( $css ) {
28 $devices = Breakpoints::names();
29
30 foreach ( $devices as $device ) {
31 // Turn off transition for a breakpoint if it is disabled in hover options
32 if( $this->isHoverDisabled( $device ) ){
33 $css[ $device ][ self::NAME . '-property' ] = "none";
34 // Check if properties for this breakpoint are available, and generate appropriate styles
35 } elseif ( $this->isBreakpointEnabled( $device ) ) {
36 $timingFunction = $this->{$device}->timingFunction ?? 'ease';
37 $duration = $this->{$device}->duration ?? 1;
38 $css[ $device ][ self::NAME ] = "all {$timingFunction} {$duration}s";
39 // If no property is set and hover is enabled for this breakpoint, set a default transition
40 } elseif( $this->isHoverEnabled( $device ) ){
41 $css[ $device ][ self::NAME ] = "all ease 1s";
42 }
43 }
44
45 return $css;
46 }
47
48 }
49