| 1 |
<?php |
| 2 |
|
| 3 |
// Exit if accessed directly. |
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
|
| 8 |
/** |
| 9 |
* Display custom CSS for Environmental campaign template. |
| 10 |
* |
| 11 |
* @package Charitable |
| 12 |
* @author WP Charitable LLC |
| 13 |
* @copyright Copyright (c) 2024, WP Charitable LLC |
| 14 |
* @license GPL-2.0+ |
| 15 |
* @since 1.0.0 |
| 16 |
* @version 1.8.8.6 |
| 17 |
*/ |
| 18 |
|
| 19 |
header( 'Content-type: text/css; charset: UTF-8' ); |
| 20 |
|
| 21 |
$primary = isset( $_GET['p'] ) ? '#' . preg_replace( '/[^A-Za-z0-9 ]/', '', $_GET['p'] ) : '#F9F6EE'; // phpcs:ignore |
| 22 |
$secondary = isset( $_GET['s'] ) ? '#' . preg_replace( '/[^A-Za-z0-9 ]/', '', $_GET['s'] ) : '#24231E'; // phpcs:ignore |
| 23 |
$tertiary = isset( $_GET['t'] ) ? '#' . preg_replace( '/[^A-Za-z0-9 ]/', '', $_GET['t'] ) : '#61AA4F'; // phpcs:ignore |
| 24 |
$button = isset( $_GET['b'] ) ? '#' . preg_replace( '/[^A-Za-z0-9 ]/', '', $_GET['b'] ) : '#61AA4F'; // phpcs:ignore |
| 25 |
$mobile_width = isset( $_GET['mw'] ) ? intval( $_GET['mw'] ) : 800; // phpcs:ignore |
| 26 |
|
| 27 |
$charitable_slug = 'environmental'; |
| 28 |
$charitable_wrapper = '.charitable-campaign-wrap.template-' . $charitable_slug; |
| 29 |
$charitable_preview_wrapper = '.charitable-campaign-wrap.is-charitable-preview.template-' . $charitable_slug; |
| 30 |
|
| 31 |
require_once dirname( __DIR__, 2 ) . '/admin/campaign-builder/templates/functions-campaign-templates.php'; |
| 32 |
|
| 33 |
?> |
| 34 |
|
| 35 |
:root { |
| 36 |
--charitable_campaign_theme_primary: <?php echo $primary; // phpcs:ignore ?>; |
| 37 |
--charitable_campaign_theme_secondary: <?php echo $secondary; // phpcs:ignore ?>; |
| 38 |
--charitable_campaign_theme_tertiary: <?php echo $tertiary; // phpcs:ignore ?>; |
| 39 |
--charitable_campaign_theme_button: <?php echo $button; // phpcs:ignore ?>; |
| 40 |
} |
| 41 |
|
| 42 |
/* this narrows things down a little to the preview area header/tabs */ |
| 43 |
|
| 44 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-row { |
| 45 |
color: #76838B; |
| 46 |
} |
| 47 |
|
| 48 |
/* row specifics */ |
| 49 |
|
| 50 |
/* column specifics */ |
| 51 |
|
| 52 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-column:nth-child(even) { |
| 53 |
padding: 20px 25px 0 25px; |
| 54 |
background-color: <?php echo $primary; // phpcs:ignore ?>; |
| 55 |
} |
| 56 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-column:nth-child(odd) { |
| 57 |
padding-left: 0; |
| 58 |
padding-top: 0; |
| 59 |
padding-right: 0; |
| 60 |
padding-bottom: 0; |
| 61 |
background-color: transparent; |
| 62 |
} |
| 63 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-column:first-of-type { |
| 64 |
padding: 15px !important; |
| 65 |
} |
| 66 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-column:nth-child(odd) .charitable-campaign-field.charitable-campaign-field-photo { |
| 67 |
margin-top: 0; |
| 68 |
margin-bottom: 0; |
| 69 |
} |
| 70 |
|
| 71 |
/* headlines */ |
| 72 |
|
| 73 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-row h1, |
| 74 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-row h2, |
| 75 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-row h3, |
| 76 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-row h4, |
| 77 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-row h5, |
| 78 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-row h6 { |
| 79 |
color: <?php echo $secondary; // phpcs:ignore ?> |
| 80 |
} |
| 81 |
|
| 82 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> h5.charitable-campaign-field-headline { |
| 83 |
color: <?php echo $secondary; // phpcs:ignore ?> !important; |
| 84 |
font-weight: 500; |
| 85 |
text-transform: uppercase; |
| 86 |
font-size: 21px; |
| 87 |
line-height: 23px; |
| 88 |
} |
| 89 |
|
| 90 |
/* text */ |
| 91 |
|
| 92 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-text .charitable-campaign-builder-placeholder-preview-text { |
| 93 |
padding: 0; |
| 94 |
|
| 95 |
} |
| 96 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-row .charitable-campaign-field-text h5 { |
| 97 |
color: <?php echo $tertiary; // phpcs:ignore ?>; |
| 98 |
} |
| 99 |
|
| 100 |
/* field: campaign title */ |
| 101 |
|
| 102 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field_campaign-title h1 { |
| 103 |
margin: 5px 0 5px 0; |
| 104 |
color: <?php echo $secondary; // phpcs:ignore ?> !important; |
| 105 |
font-size: 68px !important; |
| 106 |
line-height: 72px !important; |
| 107 |
font-weight: 500 !important; |
| 108 |
} |
| 109 |
|
| 110 |
/* field: campaign description */ |
| 111 |
|
| 112 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-description .charitable-campaign-builder-placeholder-preview-text { |
| 113 |
padding: 0; |
| 114 |
color: #D8DAD7; |
| 115 |
} |
| 116 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-description .charitable-campaign-builder-placeholder-preview-text, |
| 117 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-description .charitable-campaign-builder-placeholder-preview-text p { |
| 118 |
font-size: 24px !important; |
| 119 |
line-height: 38px !important; |
| 120 |
font-weight: 300 !important; |
| 121 |
} |
| 122 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-description h5.charitable-field-template-headline { |
| 123 |
font-size: 36px; |
| 124 |
line-height: 42px; |
| 125 |
color: <?php echo $secondary; // phpcs:ignore ?> !important; |
| 126 |
font-weight: 700; |
| 127 |
} |
| 128 |
|
| 129 |
/* campaign summary */ |
| 130 |
|
| 131 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-summary { |
| 132 |
padding-left: 0; |
| 133 |
padding-right: 0; |
| 134 |
} |
| 135 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-summary div { |
| 136 |
color: #92918E; |
| 137 |
font-weight: 400; |
| 138 |
font-size: 14px; |
| 139 |
line-height: 16px; |
| 140 |
} |
| 141 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-summary div.campaign-summary-item span { |
| 142 |
color: <?php echo $secondary; // phpcs:ignore ?>; |
| 143 |
font-weight: 600; |
| 144 |
font-size: 32px; |
| 145 |
line-height: 38px; |
| 146 |
} |
| 147 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-summary .campaign-summary-item { |
| 148 |
border: 0; |
| 149 |
margin-top: 5px; |
| 150 |
margin-bottom: 5px; |
| 151 |
text-align: left; |
| 152 |
} |
| 153 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-summary .campaign-summary-item.campaign_hide_percent_raised { |
| 154 |
width: 34%; |
| 155 |
} |
| 156 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-summary .campaign-summary-item.campaign_hide_amount_donated { |
| 157 |
width: 43%; |
| 158 |
} |
| 159 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-summary .campaign-summary-item.campaign_hide_number_of_donors { |
| 160 |
width: 23%; |
| 161 |
} |
| 162 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-campaign-summary .campaign-summary-item.campaign_hide_time_remaining { |
| 163 |
width: 100%; |
| 164 |
} |
| 165 |
|
| 166 |
/* field: button */ |
| 167 |
|
| 168 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-donate-button button.button, |
| 169 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field-donate-button a.donate-button { |
| 170 |
background-color: <?php echo $button; // phpcs:ignore ?> !important; |
| 171 |
border-color: <?php echo $button; // phpcs:ignore ?> !important; |
| 172 |
text-transform: uppercase; |
| 173 |
border-radius: 10px; |
| 174 |
margin-top: 0; |
| 175 |
margin-bottom: 0; |
| 176 |
width: 100%; |
| 177 |
font-weight: 400; |
| 178 |
min-height: 50px; |
| 179 |
height: 50px; |
| 180 |
font-size: 16px; |
| 181 |
line-height: 16px; |
| 182 |
border-radius: 0; |
| 183 |
color: <?php echo charitable_get_constracting_text_color($button); // phpcs:ignore ?>; |
| 184 |
display: flex; /* Changed from block to flex */ |
| 185 |
align-items: center; /* Vertically centers the text */ |
| 186 |
justify-content: center; /* Optionally centers the text horizontally too */ |
| 187 |
text-align: center !important; |
| 188 |
text-decoration: none !important; |
| 189 |
transition: filter 0.3s; /* Smooth transition */ |
| 190 |
} |
| 191 |
|
| 192 |
/* tabs: tab container */ |
| 193 |
|
| 194 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-tab-wrap { |
| 195 |
font-size: 14px; |
| 196 |
line-height: 24px; |
| 197 |
} |
| 198 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article { |
| 199 |
color: #76838B; |
| 200 |
margin-top: 20px; |
| 201 |
} |
| 202 |
|
| 203 |
/* tabs: tab nav */ |
| 204 |
|
| 205 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav { |
| 206 |
border: 1px solid transparent; |
| 207 |
background-color: transparent; |
| 208 |
width: auto; |
| 209 |
margin-left: 0; |
| 210 |
margin-right: 0; |
| 211 |
} |
| 212 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav li { |
| 213 |
border-top: 0; |
| 214 |
border-right: 0; |
| 215 |
border-bottom: 0; |
| 216 |
border-left: 0; |
| 217 |
background-color: transparent; |
| 218 |
margin: 0 10px 0 0; |
| 219 |
} |
| 220 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav li a { |
| 221 |
color: black; |
| 222 |
display: block; |
| 223 |
text-transform: none; |
| 224 |
} |
| 225 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav li.active { |
| 226 |
background-color: <?php echo $primary; // phpcs:ignore ?>; |
| 227 |
color: white; |
| 228 |
text-decoration: none; |
| 229 |
} |
| 230 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav li:hover { |
| 231 |
background-color: <?php echo $primary; // phpcs:ignore ?>; |
| 232 |
color: white; |
| 233 |
text-decoration: none; |
| 234 |
filter: brightness(90%); |
| 235 |
} |
| 236 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav li.active a, |
| 237 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav li:hover a { |
| 238 |
color: black; |
| 239 |
} |
| 240 |
|
| 241 |
/* tabs: style */ |
| 242 |
|
| 243 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-boxed li { |
| 244 |
background-color: transparent; |
| 245 |
} |
| 246 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-boxed li a { |
| 247 |
color: <?php echo $button; // phpcs:ignore ?>; |
| 248 |
} |
| 249 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-boxed li:hover { |
| 250 |
background-color: <?php echo $primary; // phpcs:ignore ?>; |
| 251 |
} |
| 252 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-boxed li:hover a { |
| 253 |
color: black; |
| 254 |
} |
| 255 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-boxed li.active { |
| 256 |
background-color: <?php echo $primary; // phpcs:ignore ?>; |
| 257 |
} |
| 258 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-boxed li.active a { |
| 259 |
color: black; |
| 260 |
} |
| 261 |
|
| 262 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-rounded li { |
| 263 |
background-color: transparent; |
| 264 |
} |
| 265 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-rounded li a { |
| 266 |
color: <?php echo $button; // phpcs:ignore ?>; |
| 267 |
} |
| 268 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-rounded li:hover { |
| 269 |
background-color: <?php echo $button; // phpcs:ignore ?>; |
| 270 |
} |
| 271 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-rounded li:hover a { |
| 272 |
color: white; |
| 273 |
} |
| 274 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-rounded li.active { |
| 275 |
background-color: <?php echo $button; // phpcs:ignore ?>; |
| 276 |
} |
| 277 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .section[data-section-type="tabs"] article nav.charitable-tab-style-rounded li.active a { |
| 278 |
color: white; |
| 279 |
} |
| 280 |
|
| 281 |
/* tabs: sized */ |
| 282 |
|
| 283 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav.tab-size-small li { |
| 284 |
|
| 285 |
} |
| 286 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav.tab-size-small li a { |
| 287 |
font-weight: 500; |
| 288 |
font-size: inherit; |
| 289 |
line-height: inherit; |
| 290 |
} |
| 291 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav.tab-size-medium li { |
| 292 |
|
| 293 |
} |
| 294 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav.tab-size-medium li a { |
| 295 |
font-weight: 500; |
| 296 |
font-size: inherit; |
| 297 |
line-height: inherit; |
| 298 |
} |
| 299 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav.tab-size-large li { |
| 300 |
|
| 301 |
} |
| 302 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .section[data-section-type="tabs"] article nav.tab-size-large li a { |
| 303 |
font-weight: 500; |
| 304 |
font-size: inherit; |
| 305 |
line-height: inherit; |
| 306 |
} |
| 307 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> article nav.tab-size-small li { |
| 308 |
font-size:10px; |
| 309 |
padding:0 |
| 310 |
} |
| 311 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> article nav.tab-size-small li a { |
| 312 |
font-size:16px; |
| 313 |
padding:18px |
| 314 |
} |
| 315 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> article nav.tab-size-medium li { |
| 316 |
font-size:14px; |
| 317 |
padding:0 |
| 318 |
} |
| 319 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> article nav.tab-size-medium li a { |
| 320 |
font-size:21px; |
| 321 |
padding:23px |
| 322 |
} |
| 323 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> article nav.tab-size-large li { |
| 324 |
font-size:21px; |
| 325 |
padding:0 |
| 326 |
} |
| 327 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> article nav.tab-size-large li a { |
| 328 |
font-size:30px; |
| 329 |
padding:32px |
| 330 |
} |
| 331 |
|
| 332 |
/* field: social linking */ |
| 333 |
|
| 334 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field.charitable-campaign-field-social-links .charitable-placeholder { |
| 335 |
padding: 0; |
| 336 |
} |
| 337 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field.charitable-campaign-field-social-links .charitable-field-template-social-linking, |
| 338 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field.charitable-campaign-field-social-sharing .charitable-field-template-social-sharing { |
| 339 |
display: flex; |
| 340 |
} |
| 341 |
|
| 342 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> { |
| 343 |
container-type: inline-size; |
| 344 |
container-name: campaign-<?php echo $charitable_slug; // phpcs:ignore ?>-area; |
| 345 |
} |
| 346 |
@container campaign-<?php echo $charitable_slug; // phpcs:ignore ?>-area (max-width: 700px) { |
| 347 |
|
| 348 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container { |
| 349 |
display: flex; |
| 350 |
flex-direction: column; |
| 351 |
word-break: break-word; |
| 352 |
} |
| 353 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .charitable-campaign-row { |
| 354 |
display: table; |
| 355 |
} |
| 356 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-column:first-of-type { |
| 357 |
padding: 0 !important; |
| 358 |
max-width: 100%; |
| 359 |
} |
| 360 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-container .charitable-tabs { |
| 361 |
margin-top: 0px; |
| 362 |
} |
| 363 |
|
| 364 |
} |
| 365 |
@container campaign-<?php echo $charitable_slug; // phpcs:ignore ?>-area (max-width: 400px) { |
| 366 |
|
| 367 |
<?php echo $charitable_wrapper; // phpcs:ignore ?> .charitable-campaign-field.charitable-campaign-field-social-sharing .charitable-field-row { |
| 368 |
display: flex; |
| 369 |
flex-wrap: wrap; |
| 370 |
gap: 5px; |
| 371 |
} |
| 372 |
|
| 373 |
} |
| 374 |
|
| 375 |
@container campaign-<?php echo $charitable_slug; // phpcs:ignore ?>-area (min-width: 940px) { |
| 376 |
.charitable-campaign-wrap .charitable-campaign-column, |
| 377 |
.charitable-campaign-wrap .charitable-campaign-column:nth-child(even), |
| 378 |
.charitable-campaign-wrap .charitable-campaign-column:nth-child(odd) { |
| 379 |
flex: 0 0 100% !important; |
| 380 |
padding-top: 0; |
| 381 |
padding-bottom: 0; |
| 382 |
padding-left: 0; |
| 383 |
padding-right: 0; |
| 384 |
} |
| 385 |
} |
| 386 |
|
| 387 |
.charitable-preview.charitable-builder-template-<?php echo $charitable_slug; // phpcs:ignore ?> { |