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.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 1.7.0.9 All 211 releases
charitable / includes / css-templates / admin / beacon-split.php

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

185 lines 6.1 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 * Admin builder preview CSS for the Beacon Split campaign template.
10 *
11 * @package Charitable
12 * @author WP Charitable LLC
13 * @since 1.8.11.1
14 */
15
16 header( 'Content-type: text/css; charset: UTF-8' );
17
18 if ( ! function_exists( 'charitable_sanitize_hex_color' ) ) {
19 function charitable_sanitize_hex_color( $color ) {
20 $color = trim( $color );
21 if ( preg_match( '/^#[a-fA-F0-9]{6}$/', $color ) ) {
22 return $color;
23 }
24 return null;
25 }
26 }
27
28 if ( ! function_exists( 'charitable_esc_attr_php' ) ) {
29 function charitable_esc_attr_php( $text ) {
30 return htmlspecialchars( $text, ENT_QUOTES, 'UTF-8' );
31 }
32 }
33
34 $primary = isset( $_GET['p'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', $_GET['p'] ), 0, 6 ) : '#1d3a8a'; // phpcs:ignore
35 $secondary = isset( $_GET['s'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', $_GET['s'] ), 0, 6 ) : '#0D0D0D'; // phpcs:ignore
36 $tertiary = isset( $_GET['t'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', $_GET['t'] ), 0, 6 ) : '#5F5F5F'; // phpcs:ignore
37 $button = isset( $_GET['b'] ) ? '#' . substr( preg_replace( '/[^A-Fa-f0-9]/', '', $_GET['b'] ), 0, 6 ) : '#1d3a8a'; // phpcs:ignore
38 $mobile_width = isset( $_GET['mw'] ) ? intval( $_GET['mw'] ) : 800; // phpcs:ignore
39
40 $slug = 'beacon-split';
41 $wrapper = '.charitable-preview.charitable-builder-template-' . $slug . ' #charitable-design-wrap .charitable-campaign-preview';
42
43 ?>
44
45 .charitable-preview.charitable-builder-template-<?php echo $slug; // phpcs:ignore ?> {
46 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
47 }
48
49 <?php echo charitable_esc_attr_php( $wrapper ); ?> {
50 --charitable-hero-accent: <?php echo $primary; // phpcs:ignore ?>;
51 }
52
53 /* Hero row in admin preview — keep tight, hide default field padding/borders. */
54
55 <?php echo charitable_esc_attr_php( $wrapper ); ?> .charitable-preview-header.beacon-hero-row,
56 <?php echo charitable_esc_attr_php( $wrapper ); ?> .charitable-preview-row.beacon-hero-row {
57 padding: 0;
58 margin: 0;
59 border: 0;
60 background: transparent;
61 overflow: visible;
62 }
63
64 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-hero-row .row,
65 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-hero-row .column,
66 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-hero-row .charitable-field-wrap,
67 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-hero-row .charitable-field {
68 padding: 0;
69 margin: 0;
70 border: 0;
71 background: transparent;
72 }
73
74 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-hero-row .charitable-field-campaign-hero {
75 width: 100%;
76 }
77
78 /* Hide the field title on the hero block in preview — the hero IS the visual. */
79 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-hero-row .charitable-field-campaign-hero > h4.label-title {
80 display: none;
81 }
82
83 /* Match frontend hero proportions so authors can preview accurate layout. */
84 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-hero-row .charitable-campaign-hero {
85 min-height: 420px;
86 }
87
88 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-hero-row .charitable-campaign-hero__overlay {
89 min-height: 420px;
90 }
91
92 /* Body row — two-column grid in the admin preview. */
93
94 <?php echo charitable_esc_attr_php( $wrapper ); ?> .charitable-preview-row.beacon-body-row {
95 padding: 32px 24px;
96 }
97
98 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-body-row > .row {
99 display: grid;
100 grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
101 gap: 32px;
102 align-items: start;
103 }
104
105 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-body-row .column {
106 padding: 0;
107 border: 0;
108 }
109
110 /* Campaign description block — frame the description body (non-headline) with the theme secondary color. */
111 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-body-row .charitable-field-campaign-description .charitable-campaign-builder-placeholder-preview-text {
112 border: 1px solid <?php echo charitable_esc_attr_php( $secondary ); ?>;
113 border-radius: 4px;
114 padding: 12px 16px;
115 }
116
117 /* Donor wall — align the headline + empty-state text with the other body field headlines. */
118 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-body-row .charitable-field-donation-wall .charitable-field-donation-wall-placeholder {
119 display: block;
120 padding-left: 5px;
121 }
122
123 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-body-row h5.charitable-field-template-headline {
124 font-size: 22px;
125 font-weight: 700;
126 margin-bottom: 12px;
127 line-height: 1.3;
128 }
129
130 @media ( max-width: <?php echo intval( $mobile_width ); // phpcs:ignore ?>px ) {
131 <?php echo charitable_esc_attr_php( $wrapper ); ?> .beacon-body-row > .row {
132 grid-template-columns: 1fr;
133 }
134 }
135
136 /* Social sharing — make the placeholder icons visible in the admin preview. */
137
138 <?php echo charitable_esc_attr_php( $wrapper ); ?> .charitable-field-preview-social-sharing {
139 display: flex !important;
140 align-items: center;
141 flex-wrap: wrap;
142 gap: 12px;
143 }
144 <?php echo charitable_esc_attr_php( $wrapper ); ?> .charitable-field-preview-social-sharing .charitable-field-preview-social-sharing-headline-container {
145 display: flex;
146 align-items: center;
147 float: none;
148 padding: 0;
149 margin: 0;
150 }
151 <?php echo charitable_esc_attr_php( $wrapper ); ?> .charitable-field-preview-social-sharing .charitable-field-row {
152 display: flex;
153 align-items: center;
154 flex-wrap: wrap;
155 gap: 8px;
156 float: none;
157 width: auto;
158 margin: 0;
159 padding: 0;
160 }
161 <?php echo charitable_esc_attr_php( $wrapper ); ?> .charitable-field-preview-social-sharing h5.charitable-field-preview-headline {
162 font-size: 14px !important;
163 line-height: 1 !important;
164 font-weight: 600 !important;
165 text-transform: uppercase !important;
166 letter-spacing: 0.02em !important;
167 margin: 0 8px 0 0 !important;
168 padding: 0 !important;
169 color: <?php echo $primary; // phpcs:ignore ?>;
170 }
171 <?php echo charitable_esc_attr_php( $wrapper ); ?> .charitable-field-preview-social-sharing .charitable-social-field-column {
172 display: flex;
173 align-items: center;
174 margin: 0;
175 padding: 0;
176 }
177 <?php echo charitable_esc_attr_php( $wrapper ); ?> .charitable-field-preview-social-sharing .charitable-placeholder {
178 width: 24px;
179 height: 24px;
180 padding: 0;
181 display: inline-block;
182 line-height: 0;
183 box-sizing: border-box;
184 }
185