| 1 |
<?php |
| 2 |
namespace YayMail\TemplatePatterns\Patterns; |
| 3 |
|
| 4 |
use YayMail\Abstracts\BasePattern; |
| 5 |
use YayMail\Elements\Button; |
| 6 |
use YayMail\Elements\Column; |
| 7 |
use YayMail\Elements\ColumnLayout; |
| 8 |
use YayMail\Elements\Image; |
| 9 |
use YayMail\Elements\Text; |
| 10 |
use YayMail\TemplatePatterns\SectionTemplates\Offer; |
| 11 |
use YayMail\Utils\SingletonTrait; |
| 12 |
/** */ |
| 13 |
class Offer3 extends BasePattern { |
| 14 |
use SingletonTrait; |
| 15 |
|
| 16 |
public const TYPE = 'offer_3'; |
| 17 |
public function __construct() { |
| 18 |
$this->id = uniqid(); |
| 19 |
$this->section = Offer::TYPE; |
| 20 |
$this->position = 12; |
| 21 |
$this->name = __( 'Offer 3', 'yaymail' ); |
| 22 |
|
| 23 |
$special_text = <<<HTML |
| 24 |
<p style="margin: 0; font-weight: bold;"> |
| 25 |
<!-- DAYS --> |
| 26 |
<span style="display: inline-block; width: 28px; padding: 10px 0; vertical-align: top; text-align: center;"> |
| 27 |
<span style="font-size: 20px; display: block;">20</span> |
| 28 |
<span style="font-size: 10px; font-weight: 300;">DAYS</span> |
| 29 |
</span> |
| 30 |
|
| 31 |
<!-- Colon --> |
| 32 |
<span style="display: inline-block; width: 20px; font-size: 20px; position: relative; top: -6px; vertical-align: top; padding-top: 19px; padding-left: 12px;">:</span> |
| 33 |
|
| 34 |
<!-- HOURS --> |
| 35 |
<span style="display: inline-block; width: 50px; padding: 10px 0; vertical-align: top; text-align: center;"> |
| 36 |
<span style="font-size: 20px; display: block;">12</span> |
| 37 |
<span style="font-size: 10px; font-weight: 300;">HOURS</span> |
| 38 |
</span> |
| 39 |
|
| 40 |
<!-- Colon --> |
| 41 |
<span style="display: inline-block; width: 20px; font-size: 20px; position: relative; top: -6px; vertical-align: top; padding-top: 19px; padding-left: 12px;">:</span> |
| 42 |
|
| 43 |
<!-- MINUTES --> |
| 44 |
<span style="display: inline-block; width: 50px; padding: 10px 0; vertical-align: top; text-align: center;"> |
| 45 |
<span style="font-size: 20px; display: block;">21</span> |
| 46 |
<span style="font-size: 10px; font-weight: 300;">MINUTES</span> |
| 47 |
</span> |
| 48 |
|
| 49 |
<!-- Colon --> |
| 50 |
<span style="display: inline-block; width: 20px; font-size: 20px; position: relative; top: -6px; vertical-align: top; padding-top: 19px; padding-left: 12px;">:</span> |
| 51 |
|
| 52 |
<!-- SECONDS --> |
| 53 |
<span style="display: inline-block; width: 50px; padding: 10px 0; vertical-align: top; text-align: center;"> |
| 54 |
<span style="font-size: 20px; display: block;">54</span> |
| 55 |
<span style="font-size: 10px; font-weight: 300;">SECONDS</span> |
| 56 |
</span> |
| 57 |
</p> |
| 58 |
HTML; |
| 59 |
|
| 60 |
$this->elements = [ |
| 61 |
ColumnLayout::get_object_data( |
| 62 |
1, |
| 63 |
[ |
| 64 |
'inner_background_color' => '#ffffff00', |
| 65 |
'padding' => [ |
| 66 |
'top' => 10, |
| 67 |
'bottom' => 10, |
| 68 |
'right' => 40, |
| 69 |
'left' => 40, |
| 70 |
], |
| 71 |
'background_image' => [ |
| 72 |
'url' => 'https://images.wpbrandy.com/uploads/yaymail-offer-3-bg.png', |
| 73 |
'position' => 'center_center', |
| 74 |
'x_position' => 52, |
| 75 |
'y_position' => 50, |
| 76 |
'repeat' => 'no-repeat', |
| 77 |
'size' => 'cover', |
| 78 |
], |
| 79 |
'children' => [ |
| 80 |
Column::get_object_data( |
| 81 |
100, |
| 82 |
[ |
| 83 |
'children' => [ |
| 84 |
Text::get_object_data( |
| 85 |
[ |
| 86 |
'background_color' => '#ffffff00', |
| 87 |
'text_color' => '#E2E6EE', |
| 88 |
'rich_text' => '<p style="text-align: left; margin: 0;"><span style="font-size: 18px; font-weight: 500;">Back to School Sale<br> Current Offer Ends in</span></p>', |
| 89 |
'padding' => [ |
| 90 |
'top' => 20, |
| 91 |
'bottom' => 5, |
| 92 |
'right' => 50, |
| 93 |
'left' => 0, |
| 94 |
], |
| 95 |
] |
| 96 |
), |
| 97 |
Text::get_object_data( |
| 98 |
[ |
| 99 |
'background_color' => '#ffffff00', |
| 100 |
'text_color' => '#E2E6EE', |
| 101 |
'rich_text' => wp_kses_post( $special_text ), |
| 102 |
'padding' => [ |
| 103 |
'top' => 5, |
| 104 |
'bottom' => 5, |
| 105 |
'right' => 50, |
| 106 |
'left' => 0, |
| 107 |
], |
| 108 |
] |
| 109 |
), |
| 110 |
Button::get_object_data( |
| 111 |
[ |
| 112 |
'text' => 'Shop All Products', |
| 113 |
'background_color' => '#ffffff00', |
| 114 |
'button_background_color' => '#FFFFFF', |
| 115 |
'text_color' => '#323DC7', |
| 116 |
'align' => 'left', |
| 117 |
'width' => 43, |
| 118 |
'padding' => [ |
| 119 |
'top' => 10, |
| 120 |
'bottom' => 20, |
| 121 |
'right' => 50, |
| 122 |
'left' => 0, |
| 123 |
], |
| 124 |
'border_radius' => [ |
| 125 |
'top_left' => 10, |
| 126 |
'top_right' => 10, |
| 127 |
'bottom_right' => 10, |
| 128 |
'bottom_left' => 10, |
| 129 |
], |
| 130 |
] |
| 131 |
), |
| 132 |
], |
| 133 |
] |
| 134 |
), |
| 135 |
], |
| 136 |
] |
| 137 |
), |
| 138 |
]; |
| 139 |
} |
| 140 |
} |
| 141 |
|