PluginProbe
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites / trunk
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites vtrunk
4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 2.6.1 All 38 releases
blockspare / inc / latest-post-block / posts-flash / index.php

index.php in BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites trunk, at inc/latest-post-block/posts-flash/index.php

169 lines 8.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!function_exists('latest_posts_style_control_flash')) {
3 function latest_posts_style_control_flash($blockuniqueclass, $attributes)
4 {
5
6
7 // Build CSS separately
8 $inline_css = '';
9 $inline_css .= blockspare_visibility_css($attributes, $blockuniqueclass);
10 //post-flash-background
11 if ($attributes['background']) {
12 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{
13 background-color:' . $attributes['backGroundColor'] . ';
14 }';
15 }
16
17 //post-flash-border-radius
18 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{
19 border-radius:' . $attributes['borderRadius'] . 'px;
20 }';
21 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now-txt-animation-wrap{
22 border-radius:' . $attributes['borderRadius'] . 'px;
23 }';
24 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides{
25 border-radius:' . $attributes['borderRadius'] . 'px;
26 }';
27
28 //post-image-border-radius
29 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-circle-marq{
30 border-radius:' . $attributes['imgBorderRadius'] . 'px;
31 }';
32
33 //post-flash-animation-speed
34 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-marquee .bs-marquee-wrapper{
35 animation-duration:' . $attributes['animationSpeed'] . 's;
36 }';
37
38 //post-widht
39 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.has-fixed-width h2.bs-post-title{
40 width:' . $attributes['postWidth'] . 'px;
41 }';
42
43 //Title color
44 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{
45 color:' . $attributes['postTitleColor'] . ';
46 }';
47
48 //Title hover color
49 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a:hover .bs-post-title{
50 color:' . $attributes['titleOnHoverColor'] . ';
51 }';
52
53 //Exclusive News color and background
54 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap{
55 color:' . $attributes['newsColor'] . ';
56 background-color: ' . $attributes['newsBgColor'] . ';
57 }';
58 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-2 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{
59 border-left-color:' . $attributes['newsBgColor'] . ';
60 }';
61 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-3 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{
62 background-color:' . $attributes['newsBgColor'] . ';
63 }';
64 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-4 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{
65 background-color:' . $attributes['newsBgColor'] . ';
66 }';
67
68 //Border
69 if ($attributes['border']) {
70 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{
71 border-width:' . $attributes['borderWidth'] . 'px;
72 border-color:' . $attributes['borderColor'] . ';
73 }';
74 }
75
76 //Exclusive Subtitle color and background
77 if ($attributes['exclusiveSubtitle']) {
78 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now > span{
79 color:' . $attributes['exclusiveColor'] . ';
80 background-color: ' . $attributes['exclusiveBgColor'] . ';
81 }';
82 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now > span::before{
83 border-top-color:' . $attributes['exclusiveBgColor'] . ';
84 }';
85 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now > span::after{
86 border-bottom-color:' . $attributes['exclusiveBgColor'] . ';
87 }';
88 }
89
90 //Block Gaps
91 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{
92 margin-top:' . $attributes['marginTop'] . 'px;
93 margin-right:' . $attributes['marginRight'] . 'px;
94 margin-bottom:' . $attributes['marginBottom'] . 'px;
95 margin-left:' . $attributes['marginLeft'] . 'px;
96 }';
97
98 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-slides{
99 padding-top:' . $attributes['paddingTop'] . 'px;
100 padding-right:' . $attributes['paddingRight'] . 'px;
101 padding-bottom:' . $attributes['paddingBottom'] . 'px;
102 padding-left:' . $attributes['paddingLeft'] . 'px;
103 }';
104
105 // Post Number Color
106 if ($attributes['enableCount']) {
107 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-marquee h2.bs-post-title a .bs-circle-marq .bs-trending-no{
108 color: ' . $attributes['countColor'] . ';
109 }';
110 }
111
112 //Font Settings
113
114 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{
115 font-size: ' . $attributes['postTitleFontSize'] . $attributes['titleFontSizeType'] . ';
116 ' . bscheckFontfamily($attributes['titleFontFamily']) . ';
117 ' . bscheckFontfamilyWeight($attributes['titleFontWeight']) . ';
118 line-height: ' . $attributes['postTitleLineHeight'] . ';
119 }';
120
121 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{
122 font-size: ' . $attributes['exclusiveFontSize'] . $attributes['exclusiveFontSizeType'] . ';
123 ' . bscheckFontfamily($attributes['exclusiveFontFamily']) . ';
124 ' . bscheckFontfamilyWeight($attributes['exclusiveFontWeight']) . ';
125 }';
126
127 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{
128 font-size: ' . $attributes['exclusiveSubtitleFontSize'] . $attributes['exclusiveSubtitleFontSizeType'] . ';
129 ' . bscheckFontfamily($attributes['exclusiveSubtitleFontFamily']) . ';
130 ' . bscheckFontfamilyWeight($attributes['exclusiveSubtitleFontWeight']) . ';
131 }';
132
133 $inline_css .= '@media (max-width: 1025px) { ';
134 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{
135 font-size: ' . $attributes['titleFontSizeTablet'] . $attributes['titleFontSizeType'] . ';
136 }';
137 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{
138 font-size: ' . $attributes['exclusiveFontSizeTablet'] . $attributes['exclusiveFontSizeType'] . ';
139 }';
140 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{
141 font-size: ' . $attributes['exclusiveSubtitleFontSizeTablet'] . $attributes['exclusiveSubtitleFontSizeType'] . ';
142 }';
143 $inline_css .= '}';
144
145 $inline_css .= '@media (max-width: 767px) { ';
146 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{
147 font-size: ' . $attributes['titleFontSizeMobile'] . $attributes['titleFontSizeType'] . ';
148 }';
149 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{
150 font-size: ' . $attributes['exclusiveFontSizeMobile'] . $attributes['exclusiveFontSizeType'] . ';
151 }';
152 $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{
153 font-size: ' . $attributes['exclusiveSubtitleFontSizeMobile'] . $attributes['exclusiveSubtitleFontSizeType'] . ';
154 }';
155 $inline_css .= '}';
156
157 // $block_content .= blockspare_minify_css($inline_css);
158
159 // $block_content .= '</style>';
160 // return $block_content;
161
162 if (!empty($inline_css)) {
163 wp_register_style('bs-flash-inline', false);
164 wp_enqueue_style('bs-flash-inline');
165 wp_add_inline_style('bs-flash-inline', blockspare_minify_css($inline_css));
166 }
167 }
168 }
169