PluginProbe
Depicter — Popup & Slider Builder / 1.3.2
Depicter — Popup & Slider Builder v1.3.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 / Common / Styles / BackgroundBlur.php

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

50 lines 1.1 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
6 class BackgroundBlur extends States
7 {
8 /**
9 * style name
10 */
11 const NAME = 'backdrop-filter';
12
13 /**
14 * @var int
15 */
16 public $blur = 0;
17
18 /**
19 * @var int
20 */
21 public $opacity = 100;
22
23 /**
24 * @var int
25 */
26 public $brightness = 100;
27
28 public function set( $css ) {
29 $devices = Breakpoints::names();
30 foreach ( $devices as $device ) {
31 if ( isset( $this->{$device}->enable ) ) {
32
33 // If it is disabled in a breakpoint other than default, generate a reset style for breakpoint
34 if( $device !== 'default' && ! empty( $this->default->enable ) && ! $this->{$device}->enable ) {
35 $css[$device][ self::NAME ] = 'none';
36
37 } elseif( $this->{$device}->enable ) {
38 $this->blur = $this->{$device}->blur ?? $this->blur;
39 $this->brightness = $this->{$device}->brightness ?? $this->brightness;
40 $this->opacity = $this->{$device}->opacity ?? $this->opacity;
41
42 $css[$device][self::NAME] = "blur(" . $this->blur . "px) brightness(" . $this->brightness . "%) opacity(" . $this->opacity . "%)";
43 }
44 }
45 }
46
47 return $css;
48 }
49 }
50