| 1 |
<?php |
| 2 |
|
| 3 |
namespace AgeGate\Admin\Settings; |
| 4 |
|
| 5 |
trait Appearance |
| 6 |
{ |
| 7 |
protected function getAppearanceFields() |
| 8 |
{ |
| 9 |
return [ |
| 10 |
[ |
| 11 |
'model' => ['switch_title', 'logo', 'disable_title'], |
| 12 |
'fields' => [ |
| 13 |
'logo' => [ |
| 14 |
'label' => __('Logo', 'age-gate'), |
| 15 |
'type' => 'image', |
| 16 |
'default' => '', |
| 17 |
'attributes' => [ |
| 18 |
'x-on:change' => 'logo = $el.value' |
| 19 |
], |
| 20 |
], |
| 21 |
'disable_title' => [ |
| 22 |
'default' => false, |
| 23 |
'type' => 'checkbox', |
| 24 |
'condition' => [ |
| 25 |
'x-show' => 'logo == \'\'', |
| 26 |
], |
| 27 |
'attributes' => [ |
| 28 |
'x-on:change' => 'disable_title = $el.checked' |
| 29 |
], |
| 30 |
'label' => __('Disable title', 'age-gate'), |
| 31 |
], |
| 32 |
'heading' => [ |
| 33 |
'type' => 'text', |
| 34 |
'label' => __('Title', 'age-gate'), |
| 35 |
'subtext' => __('Defaults to the site title', 'age-gate'), |
| 36 |
'condition' => [ |
| 37 |
'x-show' => 'logo == \'\' && disable_title == \'\'', |
| 38 |
], |
| 39 |
'default' => '', |
| 40 |
], |
| 41 |
'background_color' => [ |
| 42 |
'label' => __('Background colour', 'age-gate'), |
| 43 |
'type' => 'color', |
| 44 |
'default' => '', |
| 45 |
], |
| 46 |
'background_opacity' => [ |
| 47 |
'label' => __('Background colour opacity', 'age-gate'), |
| 48 |
'type' => 'range', |
| 49 |
'default' => '1', |
| 50 |
'attributes' => [ |
| 51 |
'min' => '0', |
| 52 |
'max' => '1', |
| 53 |
'step' => '0.1', |
| 54 |
] |
| 55 |
], |
| 56 |
'blur' => [ |
| 57 |
'label' => __('Blur other elements by', 'age-gate'), |
| 58 |
'type' => 'number', |
| 59 |
'default' => '5', |
| 60 |
'subtext' => 'px', |
| 61 |
'attributes' => [ |
| 62 |
'class' => 'small-text', |
| 63 |
], |
| 64 |
], |
| 65 |
'background_image' => [ |
| 66 |
'label' => __('Background image', 'age-gate'), |
| 67 |
'type' => 'image', |
| 68 |
'default' => '', |
| 69 |
], |
| 70 |
'background_position' => [ |
| 71 |
'label' => __('Background position', 'age-gate'), |
| 72 |
'type' => 'group', |
| 73 |
'fields' => [ |
| 74 |
'x' => [ |
| 75 |
'label' => __('X axis', 'age-gate'), |
| 76 |
'type' => 'select', |
| 77 |
'options' => [ |
| 78 |
'left' => __('Left', 'age-gate'), |
| 79 |
'right' => __('Right', 'age-gate'), |
| 80 |
'center' => __('Center', 'age-gate'), |
| 81 |
], |
| 82 |
'default' => 'center', |
| 83 |
], |
| 84 |
'y' => [ |
| 85 |
'label' => __('Y axis', 'age-gate'), |
| 86 |
'type' => 'select', |
| 87 |
'options' => [ |
| 88 |
'top' => __('Top', 'age-gate'), |
| 89 |
'bottom' => __('Bottom', 'age-gate'), |
| 90 |
'center' => __('Center', 'age-gate'), |
| 91 |
], |
| 92 |
'default' => 'center', |
| 93 |
], |
| 94 |
], |
| 95 |
'wrapper' => [ |
| 96 |
'class' => 'ag-field--flex', |
| 97 |
] |
| 98 |
], |
| 99 |
'background_image_opacity' => [ |
| 100 |
'label' => __('Background image opacity', 'age-gate'), |
| 101 |
'type' => 'range', |
| 102 |
'default' => '1', |
| 103 |
'attributes' => [ |
| 104 |
'min' => '0', |
| 105 |
'max' => '1', |
| 106 |
'step' => '0.1', |
| 107 |
] |
| 108 |
], |
| 109 |
'foreground_color' => [ |
| 110 |
'label' => __('Foreground colour', 'age-gate'), |
| 111 |
'type' => 'color', |
| 112 |
'default' => '#ffffff', |
| 113 |
], |
| 114 |
'foreground_opacity' => [ |
| 115 |
'label' => __('Foreground colour opacity', 'age-gate'), |
| 116 |
'type' => 'range', |
| 117 |
'default' => '1', |
| 118 |
'attributes' => [ |
| 119 |
'min' => '0', |
| 120 |
'max' => '1', |
| 121 |
'step' => '0.1', |
| 122 |
] |
| 123 |
], |
| 124 |
'text_color' => [ |
| 125 |
'label' => __('Text colour', 'age-gate'), |
| 126 |
'type' => 'color', |
| 127 |
'default' => '#000000', |
| 128 |
], |
| 129 |
'enqueue_css' => [ |
| 130 |
'label' => __('Layout', 'age-gate'), |
| 131 |
'type' => 'checkbox', |
| 132 |
'default' => true, |
| 133 |
'subtext' => __('Use plugin style on the front end', 'age-gate') |
| 134 |
], |
| 135 |
'heading_element' => [ |
| 136 |
'label' => __('Heading element', 'age-gate'), |
| 137 |
'type' => 'select', |
| 138 |
'options' => [ |
| 139 |
'h1' => 'H1', |
| 140 |
'h2' => 'H2', |
| 141 |
'h3' => 'H3', |
| 142 |
'h4' => 'H4', |
| 143 |
'div' => 'div', |
| 144 |
'p' => 'p', |
| 145 |
], |
| 146 |
'default' => 'h1', |
| 147 |
], |
| 148 |
'headline_element' => [ |
| 149 |
'label' => __('Headline element', 'age-gate'), |
| 150 |
'type' => 'select', |
| 151 |
'options' => [ |
| 152 |
'h1' => 'H1', |
| 153 |
'h2' => 'H2', |
| 154 |
'h3' => 'H3', |
| 155 |
'h4' => 'H4', |
| 156 |
'div' => 'div', |
| 157 |
'p' => 'p', |
| 158 |
], |
| 159 |
'default' => 'h2', |
| 160 |
], |
| 161 |
'sub_headline_element' => [ |
| 162 |
'label' => __('Sub Headline element', 'age-gate'), |
| 163 |
'type' => 'select', |
| 164 |
'options' => [ |
| 165 |
'h1' => 'H1', |
| 166 |
'h2' => 'H2', |
| 167 |
'h3' => 'H3', |
| 168 |
'h4' => 'H4', |
| 169 |
'div' => 'div', |
| 170 |
'p' => 'p', |
| 171 |
], |
| 172 |
'default' => 'p', |
| 173 |
], |
| 174 |
'exit_transition' => [ |
| 175 |
'label' => __('Transition', 'age-gate'), |
| 176 |
'type' => 'select', |
| 177 |
'default' => '', |
| 178 |
'subtext' => __('In JavaScript transition Age Gate out', 'age-gate'), |
| 179 |
'options' => [ |
| 180 |
'' => 'None', |
| 181 |
'fade' => __('Fade', 'age-gate'), |
| 182 |
'slide-up' => __('Slide up', 'age-gate'), |
| 183 |
'slide-down' => __('Slide down', 'age-gate'), |
| 184 |
'slide-left' => __('Slide left', 'age-gate'), |
| 185 |
'slide-right' => __('Slide right', 'age-gate'), |
| 186 |
] |
| 187 |
], |
| 188 |
'viewport' => [ |
| 189 |
'label' => __('Viewport meta tag', 'age-gate'), |
| 190 |
'type' => 'checkbox', |
| 191 |
'default' => false, |
| 192 |
'subtext' => __('Add viewport meta to Age Gate page', 'age-gate') . "\r\n" . '(width=device-width, minimum-scale=1, maximum-scale=1)', |
| 193 |
|
| 194 |
], |
| 195 |
'input_auto_tab' => [ |
| 196 |
'label' => __('Auto tab inputs', 'age-gate'), |
| 197 |
'type' => 'checkbox', |
| 198 |
'default' => false, |
| 199 |
], |
| 200 |
'switch_title' => [ |
| 201 |
'label' => __('Change the page title', 'age-gate'), |
| 202 |
'type' => 'checkbox', |
| 203 |
'default' => true, |
| 204 |
'attributes' => [ |
| 205 |
'x-on:change' => 'switch_title = ! switch_title' |
| 206 |
], |
| 207 |
], |
| 208 |
'custom_title' => [ |
| 209 |
'label' => __('Custom page title', 'age-gate'), |
| 210 |
'type' => 'text', |
| 211 |
'default' => __('Age Verification', 'age-gate'), |
| 212 |
'translate' => true, |
| 213 |
'attributes' => [ |
| 214 |
'class' => 'regular-text', |
| 215 |
], |
| 216 |
'condition' => [ |
| 217 |
'x-show' => 'switch_title != \'\'', |
| 218 |
], |
| 219 |
], |
| 220 |
'simplebar' => [ |
| 221 |
'label' => __('Enable simplebar', 'age-gate'), |
| 222 |
'type' => 'checkbox', |
| 223 |
'default' => false, |
| 224 |
'subtext' => __('Enables a stylable scrollbar if Age Gate overflows', 'age-gate'), |
| 225 |
'translate' => false, |
| 226 |
], |
| 227 |
] |
| 228 |
], |
| 229 |
]; |
| 230 |
} |
| 231 |
} |
| 232 |
|