PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13.1
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13.1
1.8.13.1 1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 All 212 releases
charitable / includes / css-templates / frontend / beacon-split.php

beacon-split.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13.1, at includes/css-templates/frontend/beacon-split.php

332 lines 11.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 /**
9 * Display custom CSS for Beacon Split campaign template (frontend).
10 *
11 * @package Charitable
12 * @author WP Charitable LLC
13 * @copyright Copyright (c) 2026, WP Charitable LLC
14 * @license GPL-2.0+
15 * @since 1.8.11.1
16 */
17
18 header( 'Content-type: text/css; charset: UTF-8' );
19
20 $primary = isset( $_GET['p'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', $_GET['p'] ), 0, 6 ) : '#1d3a8a'; // phpcs:ignore
21 $secondary = isset( $_GET['s'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', $_GET['s'] ), 0, 6 ) : '#0D0D0D'; // phpcs:ignore
22 $tertiary = isset( $_GET['t'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', $_GET['t'] ), 0, 6 ) : '#5F5F5F'; // phpcs:ignore
23 $button = isset( $_GET['b'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', $_GET['b'] ), 0, 6 ) : '#1d3a8a'; // phpcs:ignore
24 $mobile_width = isset( $_GET['mw'] ) ? max( 320, min( 2000, intval( $_GET['mw'] ) ) ) : 800; // phpcs:ignore
25
26 $charitable_slug = 'beacon-split';
27 $wrapper = '.charitable-campaign-wrap.template-' . $charitable_slug;
28 $hero_row_class = 'beacon-hero-row';
29 $body_row_class = 'beacon-body-row';
30
31 require_once dirname( __DIR__, 2 ) . '/admin/campaign-builder/templates/functions-campaign-templates.php';
32
33 ?>
34
35 <?php
36 /*
37 * Headline colour. Emitted ONLY when the campaign actually configured a primary
38 * colour (the endpoint omits 'p' otherwise), so a campaign that customised nothing
39 * falls back to the historic #000 in base.css and renders byte-identical. The hex
40 * guard stops a malformed 'p' from emitting an invalid token, which would make the
41 * headline inherit the theme's colour instead of falling back.
42 *
43 * Emitted at the top of the stylesheet rather than appended at the end, because
44 * save-the-museum.php has an unclosed rule near its end that would otherwise nest
45 * this declaration inside it.
46 */
47 if ( isset( $_GET['p'] ) && preg_match( '/^#[A-Fa-f0-9]{3,6}$/', $primary ) ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended
48 ?>
49 <?php echo $wrapper; // phpcs:ignore ?> {
50 --charitable_campaign_theme_headline: <?php echo $primary; // phpcs:ignore ?>;
51 }
52 <?php
53 endif;
54 ?>
55
56 :root {
57 --charitable_campaign_theme_primary: <?php echo $primary; // phpcs:ignore ?>;
58 --charitable_campaign_theme_secondary: <?php echo $secondary; // phpcs:ignore ?>;
59 --charitable_campaign_theme_tertiary: <?php echo $tertiary; // phpcs:ignore ?>;
60 --charitable_campaign_theme_button: <?php echo $button; // phpcs:ignore ?>;
61 }
62
63 <?php echo $wrapper; // phpcs:ignore ?> {
64 --charitable-hero-accent: <?php echo $primary; // phpcs:ignore ?>;
65 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
66 }
67
68 <?php
69 // Include the shared hero positioning partial.
70 include __DIR__ . '/partials/beacon-hero.php';
71 ?>
72
73 /* ── Body row — two columns: story + media ──────────────────────────── */
74
75 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> {
76 padding: 80px 32px 48px;
77 }
78
79 /* When the hero has no logo, the avatar overhang isn't there — pull the story column up. */
80 <?php echo $wrapper; // phpcs:ignore ?>:not(:has(.charitable-campaign-hero__avatar)) .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-column:first-child {
81 margin-top: -60px;
82 }
83
84 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-container,
85 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> {
86 display: block;
87 }
88
89 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> {
90 display: grid;
91 grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
92 gap: 32px;
93 align-items: start;
94 }
95
96 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-column {
97 padding: 0;
98 border: 0;
99 max-width: none;
100 flex: none;
101 }
102
103 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-column:first-child .charitable-field {
104 margin-bottom: 24px;
105 }
106
107 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-column:last-child .charitable-field {
108 margin-bottom: 16px;
109 }
110
111 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> h5.charitable-field-template-headline {
112 font-size: 24px;
113 font-weight: 700;
114 margin: 0 0 24px;
115 line-height: 1.3;
116 text-wrap: balance;
117 }
118
119 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-hero__title,
120 <?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__title {
121 text-wrap: balance;
122 }
123
124 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-field-content p {
125 font-size: 15px;
126 line-height: 1.6;
127 color: #333;
128 margin-bottom: 16px;
129 }
130
131 /* Campaign description — frame the description body (matches preview). */
132 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-field-campaign-description .charitable-campaign-builder-placeholder-template-text {
133 border: 1px solid <?php echo $secondary; // phpcs:ignore ?>;
134 border-radius: 4px;
135 padding: 12px 16px;
136 }
137
138 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-field-campaign-description .charitable-campaign-builder-placeholder-template-text p:first-child {
139 margin: 0;
140 }
141
142 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-field-campaign-description .charitable-campaign-builder-placeholder-template-text p:last-child {
143 margin-bottom: 0;
144 }
145
146 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-field-content > *:first-child {
147 margin-top: 0;
148 }
149
150 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-field-photo img {
151 display: block;
152 width: 100%;
153 height: auto;
154 border-radius: 0;
155 }
156
157 /* Social sharing — compact horizontal row */
158
159 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-field-social-sharing {
160 margin-bottom: 24px;
161 }
162
163 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing {
164 display: flex;
165 align-items: center;
166 flex-wrap: wrap;
167 gap: 12px;
168 }
169
170 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-field-template-social-sharing-headline-container {
171 margin: 0;
172 padding: 0;
173 display: flex;
174 align-items: center;
175 }
176
177 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing h5.charitable-field-template-headline {
178 font-size: 14px !important;
179 font-weight: 600 !important;
180 margin: 0 8px 0 0 !important;
181 padding: 0 !important;
182 line-height: 1 !important;
183 }
184
185 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-field-row {
186 display: flex;
187 flex-wrap: wrap;
188 align-items: center;
189 gap: 8px;
190 margin: 0;
191 padding: 0;
192 }
193
194 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-field-row .charitable-social-field-column {
195 margin: 0;
196 padding: 0;
197 display: flex;
198 align-items: center;
199 }
200
201 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-campaign-social-link {
202 margin: 0 !important;
203 padding: 0 !important;
204 display: flex;
205 align-items: center;
206 min-height: 0 !important;
207 }
208
209 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-campaign-social-link a {
210 display: flex;
211 align-items: center;
212 }
213
214 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-campaign-social-link img,
215 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-campaign-social-link a {
216 width: 24px;
217 height: 24px;
218 }
219
220 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-campaign-social-link p {
221 display: none;
222 }
223
224 /* ── Donor wall — Beacon-scoped restyle ───────────────────────────────── */
225
226 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal {
227 list-style: none;
228 display: grid;
229 grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
230 gap: 16px;
231 margin: 0;
232 padding: 0;
233 }
234
235 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor {
236 display: flex;
237 align-items: center;
238 gap: 14px;
239 padding: 14px 16px;
240 background: #fff;
241 border: 1px solid #e6e8eb;
242 border-radius: 10px;
243 transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
244 min-width: 0;
245 }
246
247 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor:hover {
248 border-color: var(--charitable-hero-accent, #1d3a8a);
249 transform: translateY(-1px);
250 box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
251 }
252
253 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor .avatar {
254 width: 44px !important;
255 height: 44px !important;
256 border-radius: 50%;
257 object-fit: cover;
258 flex-shrink: 0;
259 background: #f1f3f5;
260 border: 1px solid #e6e8eb;
261 }
262
263 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor .donor-name {
264 font-size: 14px;
265 font-weight: 600;
266 line-height: 1.25;
267 color: #111827;
268 margin: 0;
269 padding: 0;
270 min-width: 0;
271 white-space: nowrap;
272 overflow: hidden;
273 text-overflow: ellipsis;
274 flex: 1 1 auto;
275 }
276
277 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor .donor-donation-amount {
278 font-size: 13px;
279 font-weight: 600;
280 line-height: 1.25;
281 color: var(--charitable-hero-accent, #1d3a8a);
282 margin-top: 4px;
283 letter-spacing: 0.01em;
284 }
285
286 /* Reflow name + amount into a single column so they stack inside the card. */
287 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor::after {
288 content: none;
289 }
290
291 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor {
292 flex-wrap: wrap;
293 }
294
295 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor .donor-name {
296 flex: 1 1 calc(100% - 60px);
297 white-space: normal;
298 }
299
300 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor .donor-donation-amount {
301 flex: 1 1 calc(100% - 60px);
302 margin-left: 58px;
303 margin-top: -2px;
304 }
305
306 /* Empty-state message — match the body typography rather than the theme default. */
307 <?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-field_donation-wall p,
308 <?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-field-donation-wall .charitable-campaign-field-inner > .charitable-campaign-field_donation-wall p {
309 font-family: inherit;
310 font-size: 15px;
311 font-weight: 400;
312 font-style: normal;
313 line-height: 1.6;
314 color: #6b7280;
315 margin: 8px 0 0;
316 padding: 0 !important;
317 text-align: left;
318 }
319
320 /* ── Mobile reflow ────────────────────────────────────────────────────── */
321
322 @media ( max-width: <?php echo intval( $mobile_width ); // phpcs:ignore ?>px ) {
323 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> {
324 grid-template-columns: 1fr;
325 padding: 32px 16px;
326 gap: 24px;
327 }
328 <?php echo $wrapper; // phpcs:ignore ?>:not(:has(.charitable-campaign-hero__avatar)) .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-column:first-child {
329 margin-top: 0;
330 }
331 }
332