@php
// Default content
$arr = ['Center' => "top: 50%; left: 50%; transform: translate(-50%, -50%);", 'Top Left' => "top: 0; left: 0;", 'Top Right' => "top: 0; right: 0;", 'Bottom Left' => "bottom: 0; left: 0;", 'Bottom Right' => "bottom: 0; right: 0;"];
$style = "height: {$content->height}px; width: {$content->width}px;";
$style .= $arr[$content->position];
if ($content->background == 'Color') {
$style .= "background: {$content->popup_bg_color};";
} else {
$file = getBackgroundImage($popup->fileUrl());
$style .= "background-image: url({$file}); background-size: cover;";
}
// Default content end
if ($popup->type == 'Another page link') {
$btnStyle = "--textHoverColor: {$content->button_hover_text_color}; --bgHoverColor: {$content->button_hover_bg_color};";
$btnStyle .= "color: {$content->button_text_color};";
$btnStyle .= "background: {$content->button_bg_color};";
$btnStyle .= "margin: " . (!empty($content->button_margin_top) ? $content->button_margin_top : 0) . 'px ' . (!empty($content->button_margin_right) ? $content->button_margin_right : 0) . 'px ' . (!empty($content->button_margin_bottom) ? $content->button_margin_bottom : 0) . 'px ' . (!empty($content->button_margin_left) ? $content->button_margin_left : 0) . 'px;';
$btnStyle .= "display: inline-block; padding: 8px 16px; border-radius: 5px;";
} else if ($popup->type == 'Send mail') {
$mailStyle = "margin: " . (!empty($content->email_margin_top) ? $content->email_margin_top : 0) . 'px ' . (!empty($content->email_margin_right) ? $content->email_margin_right : 0) . 'px ' . (!empty($content->email_margin_bottom) ? $content->email_margin_bottom : 0). 'px ' . (!empty($content->email_button_margin_left) ? $content->email_button_margin_left : 0) . 'px;';
} else if ($popup->type == 'Subscribed') {
$subscribeStyle = "margin: " . (!empty($content->subscription_margin_top) ? $content->subscription_margin_top : 0) . 'px ' . (!empty($content->subscription_margin_right) ? $content->subscription_margin_right : 0) . 'px ' . (!empty($content->subscription_margin_bottom) ? $content->subscription_margin_bottom : 0) . 'px ' . (!empty($content->subscription_button_margin_left) ? $content->subscription_button_margin_left : 0) . 'px;';
}
@endphp
@foreach ($content->text as $text)
@php
$textStyle = "
color: $text->text_color;
font-size: {$text->text_size}px;
margin: " . (!empty($text->text_margin_top) ? $text->text_margin_top : 0) . 'px ' . (!empty($text->text_margin_right) ? $text->text_margin_right : 0) . 'px ' . (!empty($text->text_margin_bottom) ? $text->text_margin_bottom : 0) . 'px ' . (!empty($text->text_margin_left) ? $text->text_margin_left : 0). 'px;' .
"text-align: $text->text_alignment;
";
if ($text->text_font_weight == 'italic') {
$textStyle .= "font-style: italic;";
} else {
$textStyle .= "font-weight: $text->text_font_weight;";
}
@endphp
{{ $text->text }}
@endforeach
@if ($popup->type == 'Another page link')
{{ $content->button_title }}
@elseif ($popup->type == 'Send mail')
@elseif ($popup->type == 'Subscribed')
@endif