PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
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-single.php

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

326 lines 11.2 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 Single (1 Column) 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.12
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-single';
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 (same as Beacon Split).
70 include __DIR__ . '/partials/beacon-hero.php';
71 ?>
72
73 /* ── Body row — single full-width column ─────────────────────────────── */
74
75 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> {
76 padding: 80px 32px 48px;
77 display: block;
78 }
79
80 /* When the hero has no logo, the avatar overhang isn't there — pull the body column up. */
81 <?php echo $wrapper; // phpcs:ignore ?>:not(:has(.charitable-campaign-hero__avatar)) .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-column:first-child {
82 margin-top: -60px;
83 }
84
85 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-container {
86 display: block;
87 }
88
89 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-column {
90 padding: 0;
91 border: 0;
92 max-width: none;
93 flex: none;
94 width: 100%;
95 }
96
97 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-column .charitable-field {
98 margin-bottom: 24px;
99 }
100
101 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> h5.charitable-field-template-headline {
102 font-size: 24px;
103 font-weight: 700;
104 margin: 0 0 24px;
105 line-height: 1.3;
106 text-wrap: balance;
107 }
108
109 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-hero__title,
110 <?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__title {
111 text-wrap: balance;
112 }
113
114 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-field-content p {
115 font-size: 15px;
116 line-height: 1.6;
117 color: #333;
118 margin-bottom: 16px;
119 }
120
121 /* Campaign description — frame the description body (matches preview). */
122 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-field-campaign-description .charitable-campaign-builder-placeholder-template-text {
123 border: 1px solid <?php echo $secondary; // phpcs:ignore ?>;
124 border-radius: 4px;
125 padding: 12px 16px;
126 }
127
128 <?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 {
129 margin: 0;
130 }
131
132 <?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 {
133 margin-bottom: 0;
134 }
135
136 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-field-content > *:first-child {
137 margin-top: 0;
138 }
139
140 /* Photos — full-width landscape, generous breathing room. */
141 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-field-photo {
142 margin-bottom: 24px;
143 }
144
145 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-field-photo img {
146 display: block;
147 width: 100%;
148 max-width: 100%;
149 height: auto;
150 border-radius: 0;
151 }
152
153 /* Social sharing — compact horizontal row */
154
155 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-field-social-sharing {
156 margin-bottom: 24px;
157 }
158
159 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing {
160 display: flex;
161 align-items: center;
162 flex-wrap: wrap;
163 gap: 12px;
164 }
165
166 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-field-template-social-sharing-headline-container {
167 margin: 0;
168 padding: 0;
169 display: flex;
170 align-items: center;
171 }
172
173 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing h5.charitable-field-template-headline {
174 font-size: 14px !important;
175 font-weight: 600 !important;
176 margin: 0 8px 0 0 !important;
177 padding: 0 !important;
178 line-height: 1 !important;
179 }
180
181 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-field-row {
182 display: flex;
183 flex-wrap: wrap;
184 align-items: center;
185 gap: 8px;
186 margin: 0;
187 padding: 0;
188 }
189
190 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-field-row .charitable-social-field-column {
191 margin: 0;
192 padding: 0;
193 display: flex;
194 align-items: center;
195 }
196
197 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-campaign-social-link {
198 margin: 0 !important;
199 padding: 0 !important;
200 display: flex;
201 align-items: center;
202 min-height: 0 !important;
203 }
204
205 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-campaign-social-link a {
206 display: flex;
207 align-items: center;
208 }
209
210 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-campaign-social-link img,
211 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-campaign-social-link a {
212 width: 24px;
213 height: 24px;
214 }
215
216 <?php echo $wrapper; // phpcs:ignore ?> .charitable-field-template-social-sharing .charitable-campaign-social-link p {
217 display: none;
218 }
219
220 /* ── Donor wall — Beacon-scoped restyle ───────────────────────────────── */
221
222 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal {
223 list-style: none;
224 display: grid;
225 grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
226 gap: 16px;
227 margin: 0;
228 padding: 0;
229 }
230
231 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor {
232 display: flex;
233 align-items: center;
234 gap: 14px;
235 padding: 14px 16px;
236 background: #fff;
237 border: 1px solid #e6e8eb;
238 border-radius: 10px;
239 transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
240 min-width: 0;
241 }
242
243 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor:hover {
244 border-color: var(--charitable-hero-accent, #1d3a8a);
245 transform: translateY(-1px);
246 box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
247 }
248
249 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor .avatar {
250 width: 44px !important;
251 height: 44px !important;
252 border-radius: 50%;
253 object-fit: cover;
254 flex-shrink: 0;
255 background: #f1f3f5;
256 border: 1px solid #e6e8eb;
257 }
258
259 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor .donor-name {
260 font-size: 14px;
261 font-weight: 600;
262 line-height: 1.25;
263 color: #111827;
264 margin: 0;
265 padding: 0;
266 min-width: 0;
267 white-space: nowrap;
268 overflow: hidden;
269 text-overflow: ellipsis;
270 flex: 1 1 auto;
271 }
272
273 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor .donor-donation-amount {
274 font-size: 13px;
275 font-weight: 600;
276 line-height: 1.25;
277 color: var(--charitable-hero-accent, #1d3a8a);
278 margin-top: 4px;
279 letter-spacing: 0.01em;
280 }
281
282 /* Reflow name + amount into a single column so they stack inside the card. */
283 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor::after {
284 content: none;
285 }
286
287 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor {
288 flex-wrap: wrap;
289 }
290
291 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor .donor-name {
292 flex: 1 1 calc(100% - 60px);
293 white-space: normal;
294 }
295
296 <?php echo $wrapper; // phpcs:ignore ?> .donors-list.donors-list-horizontal .donor .donor-donation-amount {
297 flex: 1 1 calc(100% - 60px);
298 margin-left: 58px;
299 margin-top: -2px;
300 }
301
302 /* Empty-state message — match the body typography rather than the theme default. */
303 <?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-field_donation-wall p,
304 <?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-field-donation-wall .charitable-campaign-field-inner > .charitable-campaign-field_donation-wall p {
305 font-family: inherit;
306 font-size: 15px;
307 font-weight: 400;
308 font-style: normal;
309 line-height: 1.6;
310 color: #6b7280;
311 margin: 8px 0 0;
312 padding: 0 !important;
313 text-align: left;
314 }
315
316 /* ── Mobile reflow ────────────────────────────────────────────────────── */
317
318 @media ( max-width: <?php echo intval( $mobile_width ); // phpcs:ignore ?>px ) {
319 <?php echo $wrapper; // phpcs:ignore ?> .<?php echo $body_row_class; // phpcs:ignore ?> {
320 padding: 32px 16px;
321 }
322 <?php echo $wrapper; // phpcs:ignore ?>:not(:has(.charitable-campaign-hero__avatar)) .<?php echo $body_row_class; // phpcs:ignore ?> .charitable-campaign-column:first-child {
323 margin-top: 0;
324 }
325 }
326