more
Signed-off-by: Jeff <jeff@gotenzing.com>
Showing
33 changed files
with
2009 additions
and
58 deletions
| 1 | <?php | ||
| 2 | |||
| 3 | /** | ||
| 4 | * Plugin Name: Accordion Blocks | ||
| 5 | * Plugin URI: https://github.com/philbuchanan/Accordion-Blocks | ||
| 6 | * Description: Gutenberg blocks for creating responsive accordion drop-downs. | ||
| 7 | * Version: 1.5.0 | ||
| 8 | * Requires at least: 5.9 | ||
| 9 | * Tested up to: 5.9 | ||
| 10 | * Requires PHP: 7.3 | ||
| 11 | * Author: Phil Buchanan | ||
| 12 | * Author URI: https://philbuchanan.com | ||
| 13 | * License: GPLv2 or later | ||
| 14 | */ | ||
| 15 | |||
| 16 | // Make sure to not redeclare the class | ||
| 17 | if (!class_exists('PB_Accordion_Blocks')) : | ||
| 18 | |||
| 19 | class PB_Accordion_Blocks { | ||
| 20 | |||
| 21 | /** | ||
| 22 | * Current plugin version number | ||
| 23 | * Set from parent plugin file | ||
| 24 | */ | ||
| 25 | public $plugin_version; | ||
| 26 | |||
| 27 | |||
| 28 | |||
| 29 | /** | ||
| 30 | * Class constructor | ||
| 31 | * Sets up the plugin, including registering scripts. | ||
| 32 | */ | ||
| 33 | function __construct() { | ||
| 34 | $basename = plugin_basename(__FILE__); | ||
| 35 | |||
| 36 | $this->plugin_version = $this->get_plugin_version(); | ||
| 37 | |||
| 38 | // Register block | ||
| 39 | add_action('init', array($this, 'register_block')); | ||
| 40 | |||
| 41 | // Enqueue frontend assets | ||
| 42 | add_action('wp_enqueue_scripts', array($this, 'enqueue_frontend_assets')); | ||
| 43 | |||
| 44 | // Tell WordPress which JavaScript files contain translations | ||
| 45 | add_action('init', array($this, 'set_script_translations')); | ||
| 46 | |||
| 47 | if (is_admin()) { | ||
| 48 | // Add link to documentation on plugin page | ||
| 49 | add_filter("plugin_action_links_$basename", array($this, 'add_documentation_link')); | ||
| 50 | } | ||
| 51 | |||
| 52 | // Register defaults site setting | ||
| 53 | add_action('rest_api_init', array($this, 'register_settings')); | ||
| 54 | add_action('admin_init', array($this, 'register_settings')); | ||
| 55 | |||
| 56 | // Add API endpoint to get and set settings | ||
| 57 | add_action('rest_api_init', array($this, 'register_rest_routes')); | ||
| 58 | |||
| 59 | // Add settings page | ||
| 60 | add_action('admin_menu', array($this, 'add_settings_menu')); | ||
| 61 | add_action('admin_init', array($this, 'settings_api_init')); | ||
| 62 | } | ||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | /** | ||
| 67 | * Current plugin version number | ||
| 68 | */ | ||
| 69 | private function get_plugin_version() { | ||
| 70 | $plugin_data = get_file_data(__FILE__, array('Version' => 'Version'), false); | ||
| 71 | |||
| 72 | return (defined('WP_DEBUG') && WP_DEBUG) ? time() : $plugin_data['Version']; | ||
| 73 | } | ||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | /** | ||
| 78 | * Register the block's assets for the editor | ||
| 79 | */ | ||
| 80 | public function register_block() { | ||
| 81 | register_block_type(__DIR__); | ||
| 82 | } | ||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | /** | ||
| 87 | * Enqueue the block's assets for the frontend | ||
| 88 | */ | ||
| 89 | public function enqueue_frontend_assets() { | ||
| 90 | $load_scripts_globally = $this->should_load_scripts_globally(); | ||
| 91 | |||
| 92 | if ($load_scripts_globally || has_block('pb/accordion-item', get_the_ID())) { | ||
| 93 | $min = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; | ||
| 94 | |||
| 95 | wp_enqueue_script( | ||
| 96 | 'pb-accordion-blocks-frontend-script', | ||
| 97 | plugins_url("js/accordion-blocks$min.js", __FILE__), | ||
| 98 | array('jquery'), | ||
| 99 | $this->plugin_version, | ||
| 100 | true | ||
| 101 | ); | ||
| 102 | |||
| 103 | wp_enqueue_style( | ||
| 104 | 'pb-accordion-blocks-style', | ||
| 105 | plugins_url('build/index.css', __FILE__), | ||
| 106 | array(), | ||
| 107 | $this->plugin_version | ||
| 108 | ); | ||
| 109 | } | ||
| 110 | } | ||
| 111 | |||
| 112 | |||
| 113 | |||
| 114 | /** | ||
| 115 | * Tell WordPress which JavaScript files contain translations | ||
| 116 | */ | ||
| 117 | function set_script_translations() { | ||
| 118 | wp_set_script_translations('pb-accordion-blocks-editor-script', 'accordion-blocks'); | ||
| 119 | } | ||
| 120 | |||
| 121 | |||
| 122 | |||
| 123 | /** | ||
| 124 | * Register accordion defaults site setting | ||
| 125 | */ | ||
| 126 | public function register_settings() { | ||
| 127 | register_setting( | ||
| 128 | 'general', | ||
| 129 | 'accordion_blocks_defaults', | ||
| 130 | array( | ||
| 131 | 'type' => 'object', | ||
| 132 | 'show_in_rest' => array( | ||
| 133 | 'schema' => array( | ||
| 134 | 'type' => 'object', | ||
| 135 | 'properties' => array( | ||
| 136 | 'initiallyOpen' => array( | ||
| 137 | 'type' => 'boolean', | ||
| 138 | ), | ||
| 139 | 'clickToClose' => array( | ||
| 140 | 'type' => 'boolean', | ||
| 141 | ), | ||
| 142 | 'autoClose' => array( | ||
| 143 | 'type' => 'boolean', | ||
| 144 | ), | ||
| 145 | 'scroll' => array( | ||
| 146 | 'type' => 'boolean', | ||
| 147 | ), | ||
| 148 | 'scrollOffset' => array( | ||
| 149 | 'type' => 'integer', | ||
| 150 | ), | ||
| 151 | ), | ||
| 152 | ), | ||
| 153 | ), | ||
| 154 | 'default' => array( | ||
| 155 | 'initiallyOpen' => false, | ||
| 156 | 'clickToClose' => true, | ||
| 157 | 'autoClose' => true, | ||
| 158 | 'scroll' => false, | ||
| 159 | 'scrollOffset' => 0, | ||
| 160 | ), | ||
| 161 | ) | ||
| 162 | ); | ||
| 163 | |||
| 164 | register_setting( | ||
| 165 | 'accordion_blocks_settings', | ||
| 166 | 'accordion_blocks_load_scripts_globally', | ||
| 167 | array( | ||
| 168 | 'type' => 'boolean', | ||
| 169 | 'default' => 'on', | ||
| 170 | ) | ||
| 171 | ); | ||
| 172 | } | ||
| 173 | |||
| 174 | |||
| 175 | |||
| 176 | /** | ||
| 177 | * Register rest endpoint to get and set plugin defaults | ||
| 178 | */ | ||
| 179 | public function register_rest_routes() { | ||
| 180 | register_rest_route('accordion-blocks/v1', '/defaults', array( | ||
| 181 | 'methods' => WP_REST_Server::READABLE, | ||
| 182 | 'callback' => array($this, 'api_get_defaults'), | ||
| 183 | 'permission_callback' => function() { | ||
| 184 | return current_user_can('edit_posts'); | ||
| 185 | } | ||
| 186 | )); | ||
| 187 | |||
| 188 | register_rest_route('accordion-blocks/v1', '/defaults', array( | ||
| 189 | 'methods' => WP_REST_Server::EDITABLE, | ||
| 190 | 'callback' => array($this, 'api_set_defaults'), | ||
| 191 | 'permission_callback' => function() { | ||
| 192 | return current_user_can('publish_pages'); | ||
| 193 | } | ||
| 194 | )); | ||
| 195 | } | ||
| 196 | |||
| 197 | |||
| 198 | |||
| 199 | /** | ||
| 200 | * Get accordion block default settings | ||
| 201 | * | ||
| 202 | * @return object Default accordion block settings object | ||
| 203 | */ | ||
| 204 | public function api_get_defaults(WP_REST_Request $request) { | ||
| 205 | $response = new WP_REST_Response(get_option('accordion_blocks_defaults')); | ||
| 206 | $response->set_status(200); | ||
| 207 | |||
| 208 | return $response; | ||
| 209 | } | ||
| 210 | |||
| 211 | |||
| 212 | |||
| 213 | /** | ||
| 214 | * Set accordion block default settings | ||
| 215 | * | ||
| 216 | * @param data object The date passed from the API | ||
| 217 | * @return object Default accordion block settings object | ||
| 218 | */ | ||
| 219 | public function api_set_defaults($request) { | ||
| 220 | $old_defaults = get_option('accordion_blocks_defaults'); | ||
| 221 | |||
| 222 | $new_defaults = json_decode($request->get_body()); | ||
| 223 | |||
| 224 | $new_defaults = (object) array( | ||
| 225 | 'initiallyOpen' => isset($new_defaults->initiallyOpen) ? $new_defaults->initiallyOpen : $old_defaults->initiallyOpen, | ||
| 226 | 'clickToClose' => isset($new_defaults->clickToClose) ? $new_defaults->clickToClose : $old_defaults->clickToClose, | ||
| 227 | 'autoClose' => isset($new_defaults->autoClose) ? $new_defaults->autoClose : $old_defaults->autoClose, | ||
| 228 | 'scroll' => isset($new_defaults->scroll) ? $new_defaults->scroll : $old_defaults->scroll, | ||
| 229 | 'scrollOffset' => isset($new_defaults->scrollOffset) ? $new_defaults->scrollOffset : $old_defaults->scrollOffset, | ||
| 230 | ); | ||
| 231 | |||
| 232 | $updated = update_option('accordion_blocks_defaults', $new_defaults); | ||
| 233 | |||
| 234 | $response = new WP_REST_Response($new_defaults); | ||
| 235 | $response->set_status($updated ? 201 : 500); | ||
| 236 | |||
| 237 | return $response; | ||
| 238 | } | ||
| 239 | |||
| 240 | |||
| 241 | |||
| 242 | /** | ||
| 243 | * Add documentation link on plugin page | ||
| 244 | */ | ||
| 245 | public function add_documentation_link($links) { | ||
| 246 | array_push($links, sprintf('<a href="%s">%s</a>', | ||
| 247 | 'http://wordpress.org/plugins/accordion-blocks/', | ||
| 248 | _x('Documentation', 'link to documentation on wordpress.org site', 'accordion-blocks') | ||
| 249 | )); | ||
| 250 | |||
| 251 | array_push($links, sprintf('<a href="%s">%s</a>', | ||
| 252 | 'https://philbuchanan.com/donate/', | ||
| 253 | __('Donate', 'accordion-blocks') | ||
| 254 | )); | ||
| 255 | |||
| 256 | return $links; | ||
| 257 | } | ||
| 258 | |||
| 259 | |||
| 260 | |||
| 261 | /** | ||
| 262 | * Get the load_scripts_globally option and return true or false. | ||
| 263 | */ | ||
| 264 | private function should_load_scripts_globally() { | ||
| 265 | /** | ||
| 266 | * This removes the old option (the option name had a typo), but ensures | ||
| 267 | * the new option gets updated with the same setting. | ||
| 268 | */ | ||
| 269 | if (get_option('accordion_blocks_load_scripts_globablly') == 'on') { | ||
| 270 | update_option('accordion_blocks_load_scripts_globally', 'on'); | ||
| 271 | } | ||
| 272 | |||
| 273 | delete_option('accordion_blocks_load_scripts_globablly'); | ||
| 274 | |||
| 275 | $load_scripts_globally = get_option('accordion_blocks_load_scripts_globally', 'on'); | ||
| 276 | |||
| 277 | return !!$load_scripts_globally; | ||
| 278 | } | ||
| 279 | |||
| 280 | |||
| 281 | |||
| 282 | /** | ||
| 283 | * Add the admin menu settings page | ||
| 284 | */ | ||
| 285 | public function add_settings_menu() { | ||
| 286 | add_options_page( | ||
| 287 | __('Accordion Blocks Settings', 'accordion-blocks'), | ||
| 288 | __('Accordion Blocks', 'accordion-blocks'), | ||
| 289 | 'manage_options', | ||
| 290 | 'accordion_blocks_settings', | ||
| 291 | array($this, 'render_settings_page') | ||
| 292 | ); | ||
| 293 | } | ||
| 294 | |||
| 295 | |||
| 296 | |||
| 297 | /** | ||
| 298 | * Render the settings page | ||
| 299 | */ | ||
| 300 | public function render_settings_page() { | ||
| 301 | if (!current_user_can('manage_options')) { | ||
| 302 | wp_die(__('You do not have sufficient permissions to access this page.', 'accordion-blocks')); | ||
| 303 | } ?> | ||
| 304 | |||
| 305 | <div class="wrap"> | ||
| 306 | <h2><?php _e('Accordion Blocks Settings', 'accordion-blocks'); ?></h2> | ||
| 307 | <form method="POST" action="options.php"> | ||
| 308 | <?php | ||
| 309 | settings_fields('accordion_blocks_settings'); | ||
| 310 | do_settings_sections('accordion_blocks_settings'); | ||
| 311 | submit_button(); | ||
| 312 | ?> | ||
| 313 | </form> | ||
| 314 | </div> | ||
| 315 | <?php } | ||
| 316 | |||
| 317 | |||
| 318 | |||
| 319 | /** | ||
| 320 | * Register setting sections and individual settings | ||
| 321 | */ | ||
| 322 | public function settings_api_init() { | ||
| 323 | add_settings_section( | ||
| 324 | 'accordion_blocks_global_settings_section', | ||
| 325 | __('Global Settings', 'accordion-blocks'), | ||
| 326 | array($this, 'accordion_blocks_global_settings_section_callback'), | ||
| 327 | 'accordion_blocks_settings' | ||
| 328 | ); | ||
| 329 | |||
| 330 | add_settings_field( | ||
| 331 | 'accordion_blocks_load_scripts_globally', | ||
| 332 | __('Scripts and Styles', 'accordion-blocks'), | ||
| 333 | array($this, 'load_scripts_globally_setting_callback'), | ||
| 334 | 'accordion_blocks_settings', | ||
| 335 | 'accordion_blocks_global_settings_section', | ||
| 336 | array( | ||
| 337 | 'label_for' => 'accordion_blocks_load_scripts_globally', | ||
| 338 | ) | ||
| 339 | ); | ||
| 340 | } | ||
| 341 | |||
| 342 | |||
| 343 | |||
| 344 | /** | ||
| 345 | * Callback function for Accordion Blocks global settings section | ||
| 346 | * Add section intro copy here (if necessary) | ||
| 347 | */ | ||
| 348 | public function accordion_blocks_global_settings_section_callback() {} | ||
| 349 | |||
| 350 | |||
| 351 | |||
| 352 | /** | ||
| 353 | * Callback function for load scripts globally setting | ||
| 354 | */ | ||
| 355 | public function load_scripts_globally_setting_callback() { | ||
| 356 | $load_scripts_globally = $this->should_load_scripts_globally(); ?> | ||
| 357 | <fieldset> | ||
| 358 | <legend class="screen-reader-text"> | ||
| 359 | <span><?php _e('Scripts and Styles', 'accordion-blocks'); ?></span> | ||
| 360 | </legend> | ||
| 361 | <label for="accordion_blocks_load_scripts_globally"> | ||
| 362 | <input | ||
| 363 | type="checkbox" | ||
| 364 | id="accordion_blocks_load_scripts_globally" | ||
| 365 | name="accordion_blocks_load_scripts_globally" | ||
| 366 | aria-describedby="load-scripts-globally" | ||
| 367 | <?php checked($load_scripts_globally); ?> | ||
| 368 | > | ||
| 369 | <?php _e('Load scripts and styles globally', 'accordion-blocks'); ?> | ||
| 370 | </label> | ||
| 371 | <div id="load-scripts-globally"> | ||
| 372 | <p class="description"> | ||
| 373 | <?php _e('Turning this off may cause accordions to stop working in some instances.', 'accordion-blocks'); ?> | ||
| 374 | </p> | ||
| 375 | <p class="description"> | ||
| 376 | <?php _e('Turn this on if you use accordions outside of the main content editor, or are adding accordions programatically.', 'accordion-blocks'); ?> | ||
| 377 | </p> | ||
| 378 | </div> | ||
| 379 | </fieldset> | ||
| 380 | <?php } | ||
| 381 | |||
| 382 | } | ||
| 383 | |||
| 384 | $PB_Accordion_Blocks = new PB_Accordion_Blocks; | ||
| 385 | |||
| 386 | endif; |
371 Bytes
691 Bytes
153 KB
19.9 KB
| 1 | { | ||
| 2 | "apiVersion": "2", | ||
| 3 | "name": "pb/accordion-item", | ||
| 4 | "title": "Accordion Item", | ||
| 5 | "category": "text", | ||
| 6 | "textdomain": "accordion-blocks", | ||
| 7 | "attributes": { | ||
| 8 | "title": { | ||
| 9 | "type": "string", | ||
| 10 | "source": "html", | ||
| 11 | "selector": ".c-accordion__title" | ||
| 12 | }, | ||
| 13 | "initiallyOpen": { | ||
| 14 | "type": "boolean", | ||
| 15 | "default": false | ||
| 16 | }, | ||
| 17 | "clickToClose": { | ||
| 18 | "type": "boolean", | ||
| 19 | "default": true | ||
| 20 | }, | ||
| 21 | "autoClose": { | ||
| 22 | "type": "boolean", | ||
| 23 | "default": true | ||
| 24 | }, | ||
| 25 | "titleTag": { | ||
| 26 | "type": "string", | ||
| 27 | "default": "h2" | ||
| 28 | }, | ||
| 29 | "scroll": { | ||
| 30 | "type": "boolean", | ||
| 31 | "default": false | ||
| 32 | }, | ||
| 33 | "scrollOffset": { | ||
| 34 | "type": "number", | ||
| 35 | "default": 0 | ||
| 36 | }, | ||
| 37 | "uuid": { | ||
| 38 | "type": "number" | ||
| 39 | } | ||
| 40 | }, | ||
| 41 | "supports": { | ||
| 42 | "anchor": true | ||
| 43 | }, | ||
| 44 | "editorScript": "file:./build/index.js", | ||
| 45 | "editorStyle": "file:./build/index.css" | ||
| 46 | } |
| 1 | <?php return array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '348416c729ba3f21f077b8a632fd9ba7'); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | .c-accordion__item.no-js .c-accordion__content{display:block!important}.c-accordion__item.no-js .c-accordion__title{cursor:default;padding-right:none}.c-accordion__item.no-js .c-accordion__title:after{display:none}.c-accordion__title--button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;border-radius:0;box-shadow:none;direction:ltr;display:inline-block;font:inherit;height:auto;margin:0;overflow:auto;padding:0;text-align:left;text-decoration:none;transition:0;vertical-align:middle;width:100%}.c-accordion__title--button,.c-accordion__title--button:focus,.c-accordion__title--button:hover{background-color:transparent;color:inherit}.c-accordion__title{cursor:pointer;padding-right:2rem;position:relative}.c-accordion__title:after{color:#777;content:"+";font-weight:300;position:absolute;right:0;top:50%;transform:translateY(-50%)}.is-open>.c-accordion__title:after{content:"−"}[data-initially-open=false] .c-accordion__content{display:none}@media print{.c-accordion__content{display:block!important}} | ||
| 2 | .editor-styles-wrapper .c-accordion__item.is-selected{border-bottom:1px solid var(--wp-admin-theme-color)!important} |
| 1 | !function(){"use strict";var e={n:function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,{a:o}),o},d:function(t,o){for(var l in o)e.o(o,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:o[l]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.data,o=window.wp.apiFetch,l=e.n(o);const c={defaults:{initiallyOpen:!1,clickToClose:!0,autoClose:!0,scroll:!1,scrollOffset:0}},a={setDefaults:e=>({type:"SET_DEFAULTS",defaults:e}),saveDefaultSettings:e=>({type:"SAVE_DEFAULTS",defaults:e}),fetchFromAPI:e=>({type:"FETCH_FROM_API",path:e})},n=(0,t.createReduxStore)("accordion-blocks",{reducer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_DEFAULTS":return Object.assign({},e,{defaults:t.defaults});case"SAVE_DEFAULTS":return l()({path:"accordion-blocks/v1/defaults",data:t.defaults,method:"POST"}).then((e=>{})).catch((e=>{})),Object.assign({},e,{defaults:t.defaults});default:return e}},actions:a,selectors:{getDefaultSettings:e=>e.defaults},controls:{FETCH_FROM_API:e=>l()({path:e.path})},resolvers:{*getDefaultSettings(){const e=yield a.fetchFromAPI("/accordion-blocks/v1/defaults");return a.setDefaults(e)}}});(0,t.register)(n);var i=window.wp.element,s=window.wp.blocks,r=window.wp.blockEditor,d=window.wp.i18n,u=window.wp.components,h={icon:(0,i.createElement)(u.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},(0,i.createElement)(u.Path,{d:"M16.93,8.93a1,1,0,0,1-.7-.29L12,4.41,7.9,8.51A1,1,0,0,1,6.49,7.1L12,1.59l5.64,5.64a1,1,0,0,1,0,1.41A1,1,0,0,1,16.93,8.93Z"}),(0,i.createElement)(u.Path,{d:"M12.07,22.35,6.42,16.71a1,1,0,0,1,1.42-1.42l4.23,4.23,4.09-4.1a1,1,0,0,1,1.42,1.42Z"}),(0,i.createElement)(u.Path,{d:"M17.93,13H5.82a1,1,0,0,1,0-2H17.93a1,1,0,0,1,0,2Z"})),example:{attributes:{title:(0,d.__)("Accordion item title","accordion-blocks"),titleTag:"h3"},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,d.__)("Sample accordion item content for previewing styles in the editor.","accordion-blocks")}}]}},p={from:[{type:"block",blocks:["core/heading"],transform:e=>(0,s.createBlock)("pb/accordion-item",{title:e.content,titleTag:"h"+(e.level<=4?e.level:2)})},{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>(0,s.createBlock)("pb/accordion-item",{},e.map((e=>(0,s.createBlock)("core/paragraph",{content:e.content}))))}],to:[{type:"block",blocks:["core/paragraph"],transform:(e,t)=>{let o=t.map((e=>(0,s.createBlock)(e.name,e.attributes)));const l="button"!==e.titleTag?parseInt(e.titleTag.replace("h","")):2;return o.splice(0,0,(0,s.createBlock)("core/heading",{content:e.title,anchor:e.anchor,className:e.className,level:l})),o}}]},m=window.wp.compose;window.wp.coreData;var b=e=>{let{tag:t}=e;return(0,i.createElement)(u.SVG,{width:"24",height:"24",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},(0,i.createElement)(u.Path,{d:{h1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",h2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",h3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",h4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",h5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",h6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z",button:"M17.5,4.5H2.5A1.5,1.5,0,0,0,1,6v8a1.5,1.5,0,0,0,1.5,1.5h15A1.5,1.5,0,0,0,19,14V6A1.5,1.5,0,0,0,17.5,4.5Zm0,8.75a.76.76,0,0,1-.75.75H3.25a.76.76,0,0,1-.75-.75V6.75A.76.76,0,0,1,3.25,6h13.5a.76.76,0,0,1,.75.75ZM5.5,11h9V9h-9Z"}[t]}))},g=function e(){let t=[];for(let o=0;o<arguments.length;o++){let l=arguments[o];if(!l)continue;let c=typeof l;if("string"===c||"number"===c)t.push(l);else if(Array.isArray(l)&&l.length){let o=e.apply(null,l);o&&t.push(o)}else if("object"===c)for(let e in l)hasOwnProperty.call(l,e)&&l[e]&&t.push(e)}return t.join(" ")};const f=e=>{let{className:o,attributes:l,setAttributes:c,clientId:a,isSelected:n}=e;const{title:s,initiallyOpen:h,clickToClose:p,autoClose:_,titleTag:k,scroll:v,scrollOffset:w,uuid:y}=l,[C,T]=(0,i.useState)(!y),E=((0,t.useSelect)((e=>e("core/block-editor").hasSelectedInnerBlock(a,!0))),(0,t.useSelect)((e=>{const t=e("core/block-editor").getSelectedBlock();return!!t&&"pb/accordion-item"===t.name})),(0,m.useInstanceId)(f)),O=(0,t.useSelect)((e=>null!==e("core/editor")?e("core/editor").getCurrentPostId():0));(0,i.useEffect)((()=>{const e=Number(`${O}${E}`);e!==y&&c({uuid:e})}),[E]);const S=(0,t.useSelect)((e=>!!e("core/block-editor").getBlockParentsByBlockName(a,"pb/accordion-item").length)),H=(0,t.useSelect)((e=>e("core").canUser("create","pages"))),A=(0,t.useSelect)((e=>e("accordion-blocks").getDefaultSettings())),B=!(null==A)&&h===A.initiallyOpen&&p===A.clickToClose&&_===A.autoClose&&v===A.scroll&&w===A.scrollOffset;(0,i.useEffect)((()=>{C&&!B&&c({initiallyOpen:A.initiallyOpen,clickToClose:A.clickToClose,autoClose:A.autoClose,scroll:A.scroll,scrollOffset:A.scrollOffset})}),[A]);const V=(0,r.useBlockProps)({className:g("c-accordion__item","js-accordion-item")}),N=(0,r.useInnerBlocksProps)({className:"c-accordion__content"});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(r.BlockControls,{group:"block"},(0,i.createElement)(u.ToolbarGroup,{icon:(0,i.createElement)(b,{tag:k}),label:(0,d.__)("Change accordion title tag","pb"),controls:[{tag:"h1",label:(0,d.__)("Heading 1","accordion-blocks")},{tag:"h2",label:(0,d.__)("Heading 2","accordion-blocks")},{tag:"h3",label:(0,d.__)("Heading 3","accordion-blocks")},{tag:"h4",label:(0,d.__)("Heading 4","accordion-blocks")},{tag:"h5",label:(0,d.__)("Heading 5","accordion-blocks")},{tag:"h6",label:(0,d.__)("Heading 6","accordion-blocks")},{tag:"button",label:(0,d.__)("Button","accordion-blocks")}].map((e=>({name:e.tag,icon:(0,i.createElement)(b,{tag:e.tag}),title:e.label,isActive:k===e.tag,onClick:()=>c({titleTag:e.tag})}))),isCollapsed:!0})),(0,i.createElement)(r.InspectorControls,null,S&&(0,i.createElement)("div",{className:"components-notice is-warning",style:{margin:"0",borderTop:"1px solid #f0f0f0"}},(0,d.__)("This accordion item is nested inside another accordion item. While this will work, it may not be what you intended.","accordion-blocks")),(0,i.createElement)(u.PanelBody,{title:(0,d.__)("Accordion Item Settings","accordion-blocks")},(0,i.createElement)(u.ToggleControl,{label:(0,d.__)("Open By Default","accordion-blocks"),help:h?(0,d.__)("This accordion item will be open when the page loads.","accordion-blocks"):(0,d.__)("This accordion item will be closed when the page loads.","accordion-blocks"),checked:h,onChange:e=>c({initiallyOpen:e})}),(0,i.createElement)(u.ToggleControl,{label:(0,d.__)("Click to Close","accordion-blocks"),help:p?(0,d.__)("When open, this accordion item title can be clicked again to close it.","accordion-blocks"):(0,d.__)("Once opened, this accordion item cannot be closed by clicking the title.","accordion-blocks"),checked:p,onChange:e=>c({clickToClose:e})}),(0,i.createElement)(u.ToggleControl,{label:(0,d.__)("Auto Close","accordion-blocks"),help:_?(0,d.__)("This accordion item will close when opening another item.","accordion-blocks"):(0,d.__)("This accordion item will remain open when opening another item.","accordion-blocks"),checked:_,onChange:e=>c({autoClose:e})}),(0,i.createElement)(u.ToggleControl,{label:(0,d.__)("Scroll to Accordion Item","accordion-blocks"),help:v?(0,d.__)("The page will scroll to the accordion item title when it is opened.","accordion-blocks"):(0,d.__)("The page will not scroll when opening accordion items.","accordion-blocks"),checked:v,onChange:e=>c({scroll:e,scrollOffset:0})}),!!v&&(0,i.createElement)(u.RangeControl,{label:(0,d.__)("Scroll Pixel Offset","accordion-blocks"),value:w,onChange:e=>c({scrollOffset:parseInt(e,10)?parseInt(e,10):0}),min:0,max:1e3,help:(0,d.__)("A pixel offset for the final scroll position.","accordion-blocks")}),!B&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("hr",null),H&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(u.Button,{isLink:!0,onClick:()=>{(0,t.dispatch)("accordion-blocks").saveDefaultSettings({initiallyOpen:h,clickToClose:p,autoClose:_,scroll:v,scrollOffset:w})}},(0,d.__)("Make These Settings the Defaults","accordion-blocks")),(0,i.createElement)("p",{style:{fontStyle:"italic",marginTop:"7px"}},(0,d.__)("Default settings only apply when creating new accordion items.","accordion-blocks"))),(0,i.createElement)("p",null,(0,i.createElement)(u.Button,{isLink:!0,isDestructive:!0,onClick:()=>{c({initiallyOpen:A.initiallyOpen,clickToClose:A.clickToClose,autoClose:A.autoClose,scroll:A.scroll,scrollOffset:A.scrollOffset})}},(0,d.__)("Reset These Settings to Defaults","accordion-blocks")))))),(0,i.createElement)("div",V,(0,i.createElement)(r.RichText,{className:g("c-accordion__title",{"c-accordion__title--button":"button"===k}),tagName:"button"===k?"div":k,allowedFormats:["core/bold","core/italic"],placeholder:(0,d.__)("Accordion item title…","accordion-blocks"),value:s,onChange:e=>c({title:e})}),(0,i.createElement)("div",N)))};var _=f,k=[{attributes:{title:{type:"array",source:"children",selector:".c-accordion__title"},initiallyOpen:{type:"boolean",default:!1},clickToClose:{type:"boolean",default:!0},autoClose:{type:"boolean",default:!0},titleTag:{type:"string",default:"h2"},scroll:{type:"boolean",default:!1},scrollOffset:{type:"number",default:0},uuid:{type:"number"}},supports:{anchor:!0},save:e=>{let{attributes:t}=e;const{className:o,title:l,initiallyOpen:c,clickToClose:a,autoClose:n,titleTag:s,scroll:d,scrollOffset:u,uuid:h}=t;let p=["c-accordion__item","js-accordion-item","no-js"],m=["c-accordion__title","js-accordion-controller"],b={};return"button"===s&&m.push("c-accordion__title--button"),c?p.push("is-open"):b.display="none",(0,i.createElement)("div",{className:[...p,o].join(" "),"data-initially-open":c,"data-click-to-close":a,"data-auto-close":n,"data-scroll":d,"data-scroll-offset":u},(0,i.createElement)(r.RichText.Content,{id:"at-"+h,className:m.join(" "),tagName:s,tabIndex:0,role:"button","aria-controls":"ac-"+h,value:l}),(0,i.createElement)("div",{id:"ac-"+h,className:"c-accordion__content",style:b},(0,i.createElement)(r.InnerBlocks.Content,null)))}}];(0,s.registerBlockType)("pb/accordion-item",{...h,transforms:p,edit:_,save:e=>{let{attributes:t}=e;const{className:o,title:l,initiallyOpen:c,clickToClose:a,autoClose:n,titleTag:s,scroll:d,scrollOffset:u,uuid:h}=t;let p=["c-accordion__item","js-accordion-item","no-js"],m=["c-accordion__title","js-accordion-controller"];"button"===s&&m.push("c-accordion__title--button"),c&&p.push("is-open");const b=r.useBlockProps.save({className:[...p,o].join(" "),"data-initially-open":c,"data-click-to-close":a,"data-auto-close":n,"data-scroll":d,"data-scroll-offset":u}),g=r.useInnerBlocksProps.save({id:"ac-"+h,className:"c-accordion__content"});return(0,i.createElement)("div",b,(0,i.createElement)(r.RichText.Content,{id:"at-"+h,className:m.join(" "),tagName:s,role:"button",value:l}),(0,i.createElement)("div",g))},deprecated:k})}(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | (function($) { | ||
| 2 | 'use strict'; | ||
| 3 | |||
| 4 | // Remove the 'no-js' class since JavaScript is enabled | ||
| 5 | $('.js-accordion-item').removeClass('no-js'); | ||
| 6 | |||
| 7 | |||
| 8 | |||
| 9 | /** | ||
| 10 | * Accordion Blocks plugin function | ||
| 11 | * | ||
| 12 | * @param object options Plugin settings to override the defaults | ||
| 13 | */ | ||
| 14 | $.fn.accordionBlockItem = function(options) { | ||
| 15 | var settings = $.extend({ | ||
| 16 | // Set default settings | ||
| 17 | initiallyOpen: false, | ||
| 18 | autoClose: true, | ||
| 19 | clickToClose: true, | ||
| 20 | scroll: false, | ||
| 21 | scrollOffset: false, | ||
| 22 | }, options); | ||
| 23 | |||
| 24 | var duration = 250; | ||
| 25 | var hashID = window.location.hash.replace('#', ''); | ||
| 26 | |||
| 27 | var item = {}; | ||
| 28 | |||
| 29 | item.self = $(this); | ||
| 30 | item.id = $(this).attr('id'); | ||
| 31 | item.controller = $(this).children('.js-accordion-controller'); | ||
| 32 | item.uuid = getAccordionItemUUID(item.self); | ||
| 33 | item.content = $('#ac-' + item.uuid); | ||
| 34 | item.accordionGroupItems = [item.uuid]; | ||
| 35 | item.accordionAncestorItems = []; | ||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | /** | ||
| 40 | * Initial setup | ||
| 41 | * Set the scroll offset, and figure out which items should be open by | ||
| 42 | * default. | ||
| 43 | */ | ||
| 44 | (function initialSetup() { | ||
| 45 | /** | ||
| 46 | * Set up some defaults for this controller | ||
| 47 | * These cannot be set in the blocks `save` function because | ||
| 48 | * WordPress strips `tabindex` and `aria-controls` attributes from | ||
| 49 | * saved post content. See `_wp_add_global_attributes` function in | ||
| 50 | * wp-includes/kses.php for list of allowed attributes. | ||
| 51 | */ | ||
| 52 | item.controller.attr({ | ||
| 53 | 'tabindex': 0, | ||
| 54 | 'aria-controls': 'ac-' + item.uuid, | ||
| 55 | }); | ||
| 56 | |||
| 57 | settings.scrollOffset = Math.floor(parseInt(settings.scrollOffset, 10)) || 0; | ||
| 58 | |||
| 59 | /** | ||
| 60 | * Add any sibling accordion items to the accordionGroupItems array. | ||
| 61 | */ | ||
| 62 | $.each(item.self.siblings('.js-accordion-item'), function(index, ele) { | ||
| 63 | var uuid = getAccordionItemUUID(ele); | ||
| 64 | |||
| 65 | item.accordionGroupItems.push(uuid); | ||
| 66 | }); | ||
| 67 | |||
| 68 | /** | ||
| 69 | * Add any parent accordion items to the accordionAncestorItems array. | ||
| 70 | */ | ||
| 71 | $.each(item.self.parents('.js-accordion-item'), function(index, ele) { | ||
| 72 | var uuid = getAccordionItemUUID(ele); | ||
| 73 | |||
| 74 | item.accordionAncestorItems.push(uuid); | ||
| 75 | }); | ||
| 76 | |||
| 77 | // If this item has `initially-open prop` set to true, open it | ||
| 78 | if (settings.initiallyOpen) { | ||
| 79 | /** | ||
| 80 | * We aren't opening the item here (only setting open attributes) | ||
| 81 | * because the openItem() function fires the `openAccordionItem` | ||
| 82 | * event which, if `autoClose` is set, would override the users | ||
| 83 | * defined initiallyOpen settings. | ||
| 84 | * | ||
| 85 | * Only setting open attributes is fine since the item's content | ||
| 86 | * display (`display: none|block`) is already set by the plugin. | ||
| 87 | */ | ||
| 88 | setOpenItemAttributes(); | ||
| 89 | } | ||
| 90 | // If the hash matches this item, open it | ||
| 91 | else if (item.id === hashID) { | ||
| 92 | /** | ||
| 93 | * Unlike the `initiallyOpen` case above, if a hash is detected | ||
| 94 | * that matches one of the accordion items, we probably _want_ | ||
| 95 | * the other items to close so the user can focus on this item. | ||
| 96 | */ | ||
| 97 | openItem(); | ||
| 98 | |||
| 99 | // Open ancestors if necessary | ||
| 100 | $.each(item.accordionAncestorItems, function(index, uuid) { | ||
| 101 | $(document).trigger('openAncestorAccordionItem', uuid); | ||
| 102 | }); | ||
| 103 | } | ||
| 104 | // Otherwise, close the item | ||
| 105 | else { | ||
| 106 | /** | ||
| 107 | * Don't use closeItem() function call since it animates the | ||
| 108 | * closing. Instead, we only need to set the closed attributes. | ||
| 109 | */ | ||
| 110 | setCloseItemAttributes(); | ||
| 111 | } | ||
| 112 | })(); | ||
| 113 | |||
| 114 | |||
| 115 | |||
| 116 | /** | ||
| 117 | * Default click function | ||
| 118 | * Called when an accordion controller is clicked. | ||
| 119 | */ | ||
| 120 | function clickHandler() { | ||
| 121 | // Only open the item if item isn't already open | ||
| 122 | if (!item.self.hasClass('is-open')) { | ||
| 123 | // Open clicked item | ||
| 124 | openItem(); | ||
| 125 | } | ||
| 126 | // If item is open, and click to close is set, close it | ||
| 127 | else if (settings.clickToClose) { | ||
| 128 | closeItem(); | ||
| 129 | } | ||
| 130 | |||
| 131 | return false; | ||
| 132 | } | ||
| 133 | |||
| 134 | |||
| 135 | |||
| 136 | /** | ||
| 137 | * Get the accordion item UUID for a given accordion item DOM element. | ||
| 138 | */ | ||
| 139 | function getAccordionItemUUID(ele) { | ||
| 140 | return $(ele).children('.js-accordion-controller').attr('id').replace('at-', ''); | ||
| 141 | } | ||
| 142 | |||
| 143 | |||
| 144 | |||
| 145 | /** | ||
| 146 | * Opens an accordion item | ||
| 147 | * Also handles accessibility attribute settings. | ||
| 148 | */ | ||
| 149 | function openItem() { | ||
| 150 | setOpenItemAttributes(); | ||
| 151 | |||
| 152 | // Clear/stop any previous animations before revealing content | ||
| 153 | item.content.clearQueue().stop().slideDown(duration, function() { | ||
| 154 | // Scroll page to the title | ||
| 155 | if (settings.scroll) { | ||
| 156 | // Pause scrolling until other items have closed | ||
| 157 | setTimeout(function() { | ||
| 158 | $('html, body').animate({ | ||
| 159 | scrollTop: item.self.offset().top - settings.scrollOffset | ||
| 160 | }, duration); | ||
| 161 | }, duration); | ||
| 162 | } | ||
| 163 | }); | ||
| 164 | |||
| 165 | $(document).trigger('openAccordionItem', item); | ||
| 166 | } | ||
| 167 | |||
| 168 | |||
| 169 | |||
| 170 | /** | ||
| 171 | * Set open item attributes | ||
| 172 | * Mark accordion item as open and read and set aria attributes. | ||
| 173 | */ | ||
| 174 | function setOpenItemAttributes() { | ||
| 175 | item.self.addClass('is-open is-read'); | ||
| 176 | item.controller.attr('aria-expanded', true); | ||
| 177 | item.content.prop('hidden', false); | ||
| 178 | } | ||
| 179 | |||
| 180 | |||
| 181 | |||
| 182 | /** | ||
| 183 | * Closes an accordion item | ||
| 184 | * Also handles accessibility attribute settings. | ||
| 185 | */ | ||
| 186 | function closeItem() { | ||
| 187 | // Close the item | ||
| 188 | item.content.slideUp(duration, function() { | ||
| 189 | setCloseItemAttributes(); | ||
| 190 | }); | ||
| 191 | } | ||
| 192 | |||
| 193 | |||
| 194 | |||
| 195 | /** | ||
| 196 | * Set closed item attributes | ||
| 197 | * Mark accordion item as closed and set aria attributes. | ||
| 198 | */ | ||
| 199 | function setCloseItemAttributes() { | ||
| 200 | item.self.removeClass('is-open'); | ||
| 201 | item.controller.attr('aria-expanded', false); | ||
| 202 | item.content.attr('hidden', true); | ||
| 203 | } | ||
| 204 | |||
| 205 | |||
| 206 | |||
| 207 | /** | ||
| 208 | * Close all items if auto close is enabled | ||
| 209 | */ | ||
| 210 | function maybeCloseItem() { | ||
| 211 | if (settings.autoClose && item.self.hasClass('is-open')) { | ||
| 212 | closeItem(); | ||
| 213 | } | ||
| 214 | } | ||
| 215 | |||
| 216 | |||
| 217 | |||
| 218 | /** | ||
| 219 | * Add event listeners | ||
| 220 | */ | ||
| 221 | item.controller.on('click', clickHandler); | ||
| 222 | |||
| 223 | |||
| 224 | |||
| 225 | /** | ||
| 226 | * Listen for other accordion items opening | ||
| 227 | * | ||
| 228 | * The `openAccordionItem` event is fired whenever an accordion item is | ||
| 229 | * opened after initial plugin setup. | ||
| 230 | */ | ||
| 231 | $(document).on('openAccordionItem', function(event, ele) { | ||
| 232 | /** | ||
| 233 | * Only trigger potential close these conditions are met: | ||
| 234 | * | ||
| 235 | * 1. This isn't the item the user just clicked to open. | ||
| 236 | * 2. This accordion is in the same group of accordions as the one | ||
| 237 | * that was just clicked to open. | ||
| 238 | * 3. This accordion is not an ancestor of the item that was just | ||
| 239 | * clicked to open. | ||
| 240 | * | ||
| 241 | * This serves two purposes: | ||
| 242 | * | ||
| 243 | * 1. It allows nesting of accordions to work. | ||
| 244 | * 2. It allows users to group accordions to control independently | ||
| 245 | * of other groups of accordions. | ||
| 246 | * 3. It allows child accordions to be opened via hash change | ||
| 247 | * without automatically closing the parent accordion, therefore | ||
| 248 | * hiding the accordion the user just indicated they wanted open. | ||
| 249 | */ | ||
| 250 | if ( | ||
| 251 | ele !== item && | ||
| 252 | ele.accordionGroupItems.indexOf(item.uuid) > 0 && | ||
| 253 | ele.accordionAncestorItems.indexOf(item.uuid) === -1 | ||
| 254 | ) { | ||
| 255 | maybeCloseItem(); | ||
| 256 | } | ||
| 257 | }); | ||
| 258 | |||
| 259 | |||
| 260 | |||
| 261 | /** | ||
| 262 | * Listen for ancestor opening requests | ||
| 263 | * | ||
| 264 | * The `openAncestorAccordionItem` event is fired whenever a nested | ||
| 265 | * accordion item is opened, but the ancestors may also need to be | ||
| 266 | * opened. | ||
| 267 | */ | ||
| 268 | $(document).on('openAncestorAccordionItem', function(event, uuid) { | ||
| 269 | if (uuid === item.uuid) { | ||
| 270 | openItem(); | ||
| 271 | } | ||
| 272 | }); | ||
| 273 | |||
| 274 | |||
| 275 | |||
| 276 | item.controller.on('keydown', function(event) { | ||
| 277 | var code = event.which; | ||
| 278 | |||
| 279 | if (item.controller.prop('tagName') !== 'BUTTON') { | ||
| 280 | // 13 = Return, 32 = Space | ||
| 281 | if ((code === 13) || (code === 32)) { | ||
| 282 | // Simulate click on the controller | ||
| 283 | $(this).click(); | ||
| 284 | } | ||
| 285 | } | ||
| 286 | |||
| 287 | // 27 = Esc | ||
| 288 | if (code === 27) { | ||
| 289 | maybeCloseItem(); | ||
| 290 | } | ||
| 291 | }); | ||
| 292 | |||
| 293 | // Listen for hash changes (in page jump links for accordions) | ||
| 294 | $(window).on('hashchange', function() { | ||
| 295 | hashID = window.location.hash.replace('#', ''); | ||
| 296 | |||
| 297 | // Only open this item if the has matches the ID | ||
| 298 | if (hashID === item.id) { | ||
| 299 | var ele = $('#' + hashID); | ||
| 300 | |||
| 301 | // If there is a hash and the hash is on an accordion item | ||
| 302 | if (ele.length && ele.hasClass('js-accordion-item')) { | ||
| 303 | // Open clicked item | ||
| 304 | openItem(); | ||
| 305 | |||
| 306 | // Open ancestors if necessary | ||
| 307 | $.each(item.accordionAncestorItems, function(index, uuid) { | ||
| 308 | $(document).trigger('openAncestorAccordionItem', uuid); | ||
| 309 | }); | ||
| 310 | } | ||
| 311 | } | ||
| 312 | }); | ||
| 313 | |||
| 314 | return this; | ||
| 315 | }; | ||
| 316 | |||
| 317 | |||
| 318 | |||
| 319 | // Loop through accordion settings objects | ||
| 320 | // Wait for the entire page to load before loading the accordion | ||
| 321 | $(window).on('load', function() { | ||
| 322 | $('.js-accordion-item').each(function() { | ||
| 323 | $(this).accordionBlockItem({ | ||
| 324 | // Set default settings | ||
| 325 | initiallyOpen: $(this).data('initially-open'), | ||
| 326 | autoClose: $(this).data('auto-close'), | ||
| 327 | clickToClose: $(this).data('click-to-close'), | ||
| 328 | scroll: $(this).data('scroll'), | ||
| 329 | scrollOffset: $(this).data('scroll-offset'), | ||
| 330 | }); | ||
| 331 | }); | ||
| 332 | }); | ||
| 333 | }(jQuery)); |
| 1 | !function(u){"use strict";u(".js-accordion-item").removeClass("no-js"),u.fn.accordionBlockItem=function(o){var n=u.extend({initiallyOpen:!1,autoClose:!0,clickToClose:!0,scroll:!1,scrollOffset:!1},o),t=250,c=window.location.hash.replace("#",""),e={};function i(o){return u(o).children(".js-accordion-controller").attr("id").replace("at-","")}function s(){r(),e.content.clearQueue().stop().slideDown(t,function(){n.scroll&&setTimeout(function(){u("html, body").animate({scrollTop:e.self.offset().top-n.scrollOffset},t)},t)}),u(document).trigger("openAccordionItem",e)}function r(){e.self.addClass("is-open is-read"),e.controller.attr("aria-expanded",!0),e.content.prop("hidden",!1)}function l(){e.content.slideUp(t,function(){a()})}function a(){e.self.removeClass("is-open"),e.controller.attr("aria-expanded",!1),e.content.attr("hidden",!0)}function d(){n.autoClose&&e.self.hasClass("is-open")&&l()}return e.self=u(this),e.id=u(this).attr("id"),e.controller=u(this).children(".js-accordion-controller"),e.uuid=i(e.self),e.content=u("#ac-"+e.uuid),e.accordionGroupItems=[e.uuid],e.accordionAncestorItems=[],e.controller.attr({tabindex:0,"aria-controls":"ac-"+e.uuid}),n.scrollOffset=Math.floor(parseInt(n.scrollOffset,10))||0,u.each(e.self.siblings(".js-accordion-item"),function(o,n){var t=i(n);e.accordionGroupItems.push(t)}),u.each(e.self.parents(".js-accordion-item"),function(o,n){var t=i(n);e.accordionAncestorItems.push(t)}),n.initiallyOpen?r():e.id===c?(s(),u.each(e.accordionAncestorItems,function(o,n){u(document).trigger("openAncestorAccordionItem",n)})):a(),e.controller.on("click",function(){return e.self.hasClass("is-open")?n.clickToClose&&l():s(),!1}),u(document).on("openAccordionItem",function(o,n){n!==e&&0<n.accordionGroupItems.indexOf(e.uuid)&&-1===n.accordionAncestorItems.indexOf(e.uuid)&&d()}),u(document).on("openAncestorAccordionItem",function(o,n){n===e.uuid&&s()}),e.controller.on("keydown",function(o){var n=o.which;"BUTTON"!==e.controller.prop("tagName")&&(13!==n&&32!==n||u(this).click()),27===n&&d()}),u(window).on("hashchange",function(){var o;(c=window.location.hash.replace("#",""))!==e.id||(o=u("#"+c)).length&&o.hasClass("js-accordion-item")&&(s(),u.each(e.accordionAncestorItems,function(o,n){u(document).trigger("openAncestorAccordionItem",n)}))}),this},u(window).on("load",function(){u(".js-accordion-item").each(function(){u(this).accordionBlockItem({initiallyOpen:u(this).data("initially-open"),autoClose:u(this).data("auto-close"),clickToClose:u(this).data("click-to-close"),scroll:u(this).data("scroll"),scrollOffset:u(this).data("scroll-offset")})})})}(jQuery); |
| 1 | === Accordion Blocks === | ||
| 2 | Contributors: philbuchanan | ||
| 3 | Author URI: https://philbuchanan.com/ | ||
| 4 | Donate Link: https://philbuchanan.com/donate/ | ||
| 5 | Tags: accordion, accordions, gutenberg, block, responsive | ||
| 6 | Requires at least: 5.9 | ||
| 7 | Tested up to: 5.9 | ||
| 8 | Stable tag: 1.5.0 | ||
| 9 | Requires PHP: 7.3 | ||
| 10 | License: GPLv2 or later | ||
| 11 | License URI: http://www.gnu.org/licenses/gpl-2.0.html | ||
| 12 | |||
| 13 | Gutenberg block for creating responsive accordion drop-downs. | ||
| 14 | |||
| 15 | == Description == | ||
| 16 | |||
| 17 | Accordion Blocks is a simple plugin that adds a Gutenberg block for adding accordion drop-downs to your pages. | ||
| 18 | |||
| 19 | The accordions should blend seamlessly with your theme. However, you may want to add custom styles to your theme. | ||
| 20 | |||
| 21 | = Features = | ||
| 22 | |||
| 23 | * Adds a Gutenberg block for adding accordions to your site. | ||
| 24 | * Supports multiple accordions with individual settings for each accordion item. | ||
| 25 | * Fully responsive. | ||
| 26 | * Support for item IDs and direct links. | ||
| 27 | * Supports nesting accordions. | ||
| 28 | * Accessible (for users requiring tabbed keyboard navigation control). | ||
| 29 | |||
| 30 | = Optional Features = | ||
| 31 | |||
| 32 | * Open individual accordion items by default. | ||
| 33 | * Disable auto closing of accordion items. | ||
| 34 | * Manually close items by clicking the title again. | ||
| 35 | * Scroll page to title when it's clicked open (including setting a scroll offset position). | ||
| 36 | * Set the HTML heading tag for the title element (h1–h6, button). | ||
| 37 | * Set defaults to be applied to all new accordion items or reset a specific accordion item to the defaults. | ||
| 38 | * Supports adding custom block styles using `wp.blocks.registerBlockStyle`. | ||
| 39 | |||
| 40 | = Output = | ||
| 41 | |||
| 42 | The plugin will ultimately output following HTML (simplified for this example): | ||
| 43 | |||
| 44 | <div class="wp-block-pb-accordion-item c-accordion__item js-accordion-item" data-initially-open="false" data-click-to-close="true" data-auto-close="true" data-scroll="false" data-scroll-offset="0"> | ||
| 45 | <h2 id="at-76840" class="c-accordion__title js-accordion-controller" tabindex="0" role="button" aria-controls="ac-76840" aria-expanded="false"> | ||
| 46 | Title with H2 tag | ||
| 47 | </h2> | ||
| 48 | <div id="ac-76840" class="c-accordion__content" style="display:none" aria-hidden="true"> | ||
| 49 | <p>Content</p> | ||
| 50 | </div> | ||
| 51 | </div> | ||
| 52 | |||
| 53 | = Custom CSS = | ||
| 54 | |||
| 55 | You can use the following CSS classes to customize the look of the accordion. | ||
| 56 | |||
| 57 | .c-accordion__item {} /* The accordion item container */ | ||
| 58 | .c-accordion__item.is-open {} /* is-open is added to open accordion items */ | ||
| 59 | .c-accordion__item.is-read {} /* is-read is added to accordion items that have been opened at least once */ | ||
| 60 | .c-accordion__title {} /* An accordion item title */ | ||
| 61 | .c-accordion__title--button {} /* An accordion item title that is using a `<button>` tag */ | ||
| 62 | .c-accordion__title:hover {} /* To modify the style when hovering over an accordion item title */ | ||
| 63 | .c-accordion__title:focus {} /* To modify the style when an accordion item title currently has broswer focus */ | ||
| 64 | .c-accordion__content {} /* An accordion item content container */ | ||
| 65 | |||
| 66 | == Installation == | ||
| 67 | 1. Upload the 'accordion-blocks' folder to the '/wp-content/plugins/' directory. | ||
| 68 | 2. Activate the plugin through the Plugins menu in WordPress. | ||
| 69 | 3. Add the accordions to your content. | ||
| 70 | |||
| 71 | == Frequently Asked Questions == | ||
| 72 | |||
| 73 | = Can I change all my existing accordion items to the defaults? = | ||
| 74 | |||
| 75 | No. It is not possible to change all your accordion item's settings (within the same page or across multiple pages) to the defaults. | ||
| 76 | |||
| 77 | Although I would like to offer this feature, based on my research it would require a significant amount of development time that I am unable to devote to a free plugin. If you are a developer and would be interested in helping implement a feature like that, please let me know. | ||
| 78 | |||
| 79 | = Why isn't the JavaScript file loading on my site? = | ||
| 80 | |||
| 81 | This is most likely caused by a poorly coded theme. This plugin makes use of the `wp_footer()` function to load the JavaScript file and it's dependancy (jQuery). Check your theme to ensure that the `wp_footer()` function is being called right before the closing `</body>` tag in your theme's footer.php file. | ||
| 82 | |||
| 83 | = Issues/Suggestions = | ||
| 84 | |||
| 85 | For bug reports or feature requests or if you'd like to contribute to the plugin you can check everything out on [Github](https://github.com/philbuchanan/Accordion-Blocks/). | ||
| 86 | |||
| 87 | == Screenshots == | ||
| 88 | |||
| 89 | 1. Accordion block settings sidebar | ||
| 90 | 2. Accordion block in the editor | ||
| 91 | |||
| 92 | == Changelog == | ||
| 93 | = 1.5.0 = | ||
| 94 | * Plugin now requires WordPress 5.9. | ||
| 95 | * Use `useInnerBlocksProps` and `useInnerBlocksProps.save()` for inner blocks handling. | ||
| 96 | |||
| 97 | = 1.4.1 = | ||
| 98 | * Fixed: Fixed UUID not generating properly in widget editor. | ||
| 99 | |||
| 100 | = 1.4.0 = | ||
| 101 | * New: Use block API v2 with useBlockProps. | ||
| 102 | * Fixed: Registering block with block.json file. | ||
| 103 | * Fixed: Use BlockControls group setting for title tag toolbar. | ||
| 104 | * Fixed: Replaced deprecated `registerStore` with `register`. | ||
| 105 | * Fixed: Reference to which script contains translations is now correct. | ||
| 106 | |||
| 107 | = 1.3.5 = | ||
| 108 | * Fixed: An issue where the global loading of scripts and styles checkbox was checked when the setting was actually off. | ||
| 109 | |||
| 110 | = 1.3.4 = | ||
| 111 | * Fixed: Made turning off global loading of scripts and styles an explicit setting. You can turn off this off in Settings > Accordion Blocks. | ||
| 112 | |||
| 113 | = 1.3.3 = | ||
| 114 | * Fixed: Rolled back deprecated `registerStore` with `register` change since it only applies to WordPress 5.7+. | ||
| 115 | |||
| 116 | = 1.3.2 = | ||
| 117 | * New: Visual indicator of bottom of block when the block is selected. | ||
| 118 | * New: Only load plugin assets when the page contains an accordion block. | ||
| 119 | * Fixed: Replaced deprecated `registerStore` with `register`. | ||
| 120 | |||
| 121 | = 1.3.1 = | ||
| 122 | * Added support for WordPress 5.7. | ||
| 123 | * New method for generating uuids that should be more reliable. | ||
| 124 | |||
| 125 | = 1.3.0 = | ||
| 126 | * New: Added h5 and h6 as options for title tag. | ||
| 127 | * New: Only users with the role of Editor or Administrator can set new default settings. All users can restore settings to defaults. This lays the groundwork for the ability to make this user definable in a settings page which may come in a future release. | ||
| 128 | * Fixed: New accordions added by Authors wouldn't function properly. | ||
| 129 | |||
| 130 | = 1.2.2 = | ||
| 131 | * Fixed: Unique IDs were not set for new accordion items for sites that didn't already have default options stored in the database. | ||
| 132 | |||
| 133 | = 1.2.1 = | ||
| 134 | * Fixed PHP error that slipped through. | ||
| 135 | |||
| 136 | = 1.2.0 = | ||
| 137 | * Added support for WordPress 5.6, including fixing jQuery Migrate issues. | ||
| 138 | * Added support for grouping accordion items. | ||
| 139 | * Added support for nested accordion items. | ||
| 140 | * Removed accordion settings API for getting and setting defaults in favour of use useEntityProp. | ||
| 141 | |||
| 142 | = 1.1.6 = | ||
| 143 | * Fixed: Use sample content (instead of real content) to preview custom blocks styles in the editor. | ||
| 144 | * Fixed: Bumped required version to WordPress 5.4. | ||
| 145 | |||
| 146 | = 1.1.5 = | ||
| 147 | * Fixed: Resolved issue with PHP notice for not setting permission_callback in REST API. | ||
| 148 | |||
| 149 | = 1.1.4 = | ||
| 150 | * Added: Support for WordPress 5.5 | ||
| 151 | * Fixed: no-js styles are now specific to the accordion item block | ||
| 152 | |||
| 153 | = 1.1.3 = | ||
| 154 | * Fixed: When typing backspace on a button title, it would delete the entire accordion item instead of backspacing a character | ||
| 155 | |||
| 156 | = 1.1.2 = | ||
| 157 | * Fixed: Accordion titles once again support bold and italic formats | ||
| 158 | * Fixed: Translation should now be possible via WordPress translation site | ||
| 159 | |||
| 160 | = 1.1.1 = | ||
| 161 | * Fixed: An issue where, on some sites, accordion content would not smoothly animate open, instead just appearing instantly after a short delay | ||
| 162 | * Fixed: Duplicated accordion items now have unique IDs which should resolve the issue where clicking on the duplicate title opens the original block | ||
| 163 | |||
| 164 | = 1.1.0 = | ||
| 165 | * New: An option to set default accordion item settings that will be applied to all newly created accordions. Individual accordion items can be reset to whatever is set as the defaults. | ||
| 166 | * Fixed: Accordions not working if showing multiple posts' content on one page. Unfortunately this will only apply to newly created accordions. Old accordions will need to be replaced to work properly. | ||
| 167 | * Fixed: Users without the `unfiltered_html` permission (i.e. users with Author or lower user role) would get an "invalid content" error when viewing an accordion added by a user with the `unfiltered_html` permission (and vise-versa). | ||
| 168 | |||
| 169 | = 1.0.6 = | ||
| 170 | * Fixed typo in plugin settings | ||
| 171 | |||
| 172 | = 1.0.5 = | ||
| 173 | * Added minified versions of JS and CSS files | ||
| 174 | |||
| 175 | = 1.0.4 = | ||
| 176 | * Made plugin translatable | ||
| 177 | * Code cleanup | ||
| 178 | |||
| 179 | = 1.0.3 = | ||
| 180 | * Added the ability to convert a paragraph or heading into an accordion. | ||
| 181 | |||
| 182 | = 1.0.2 = | ||
| 183 | * Added the ability for the block in the editor to accept custom css classes (allows for custom registration of Block Styles) | ||
| 184 | * Accessibility fix: Removed aria-hidden=false from closed accordions. | ||
| 185 | |||
| 186 | = 1.0.1 = | ||
| 187 | * Updated readme. | ||
| 188 | |||
| 189 | = 1.0.0 = | ||
| 190 | * All new plugin to support the new WordPress Gutenberg editor. | ||
| 191 | |||
| 192 | == Upgrade Notice == | ||
| 193 | = 1.5.0 = | ||
| 194 | Fixed compatibility issues with WordPress 5.9. Plugin now requires WordPress 5.9 (the changes are fundamentally incompatible with previous versions of WordPress). | ||
| 195 | |||
| 196 | = 1.4.1 = | ||
| 197 | Fixed accordions not generating UUIDs in the widgets editor, therefore breaking when returning to the widgets editor. | ||
| 198 | |||
| 199 | = 1.4.0 = | ||
| 200 | Fixed a bunch of compatibility issues with WordPress 5.8 (and the widgets block editor). | ||
| 201 | |||
| 202 | = 1.3.5 = | ||
| 203 | Fixed an issue where the global loading of scripts and styles checkbox was checked when the setting was actually off. | ||
| 204 | |||
| 205 | = 1.3.4 = | ||
| 206 | Made turning off global loading of scripts and styles an explicit setting. You can turn off this off in Settings > Accordion Blocks. | ||
| 207 | |||
| 208 | = 1.3.3 = | ||
| 209 | Rolled back deprecated `registerStore` with `register` change since it only applies to WordPress 5.7+. | ||
| 210 | |||
| 211 | = 1.3.2 = | ||
| 212 | Only load assets on pages that use the block. Added visual indicator to show bottom of block. | ||
| 213 | |||
| 214 | = 1.3.1 = | ||
| 215 | Support for WordPress 5.7 and a new method for generating uuids that should be more reliable. | ||
| 216 | |||
| 217 | = 1.3.0 = | ||
| 218 | Added h5 and h6 options for the title tag and fixed a bug where Authors may not be able to create functioning accordions. | ||
| 219 | |||
| 220 | = 1.2.2 = | ||
| 221 | Fixed an issue where all accordion item titles would open the first accordion only. | ||
| 222 | |||
| 223 | = 1.2.1 = | ||
| 224 | Fixed PHP error that slipped through in 1.2.0. Sorry about that. | ||
| 225 | |||
| 226 | = 1.2.0 = | ||
| 227 | Adds support for WordPress 5.6. Also adds support for nested and grouped accordion items. | ||
| 228 | |||
| 229 | = 1.1.6 = | ||
| 230 | Accordions now use sample content (instead of real content) to preview custom blocks styles in the editor. This should resolved slow performance in the editor if an accordion using custom block styles and has a lot of content. | ||
| 231 | |||
| 232 | = 1.1.5 = | ||
| 233 | Fixed PHP notice for API. | ||
| 234 | |||
| 235 | = 1.1.4 = | ||
| 236 | Added support for WordPress 5.5 and made no-js styles specific to the accordion item block. | ||
| 237 | |||
| 238 | = 1.1.3 = | ||
| 239 | Fixed an issue where typing backspace on a button title type would delete the entire accordion item instead of backspacing a character. | ||
| 240 | |||
| 241 | = 1.1.2 = | ||
| 242 | Restored bold and italic formatting of accordion titles and fixed translation strings. | ||
| 243 | |||
| 244 | = 1.1.1 = | ||
| 245 | Fixed a couple small bugs accidentally introduced in version 1.1.0 of the plugin. | ||
| 246 | |||
| 247 | = 1.1.0 = | ||
| 248 | Medium sized update to the plugin with a few fixes and some feature additions. | ||
| 249 | |||
| 250 | NOTE: If you have dequeued the default plugin stylesheet you may see all of your accordions animate from open to closed for a split second when the page loads. You can resolve this by adding `[data-initially-open="false"] .c-accordion__content { display: none }` to your theme stylesheet. | ||
| 251 | |||
| 252 | = 1.0.6 = | ||
| 253 | Fixed typo in plugin settings. | ||
| 254 | |||
| 255 | = 1.0.5 = | ||
| 256 | Added minified versions of JS and CSS files. | ||
| 257 | |||
| 258 | = 1.0.4 = | ||
| 259 | Made plugin translatable. | ||
| 260 | |||
| 261 | = 1.0.3 = | ||
| 262 | Added the ability to convert a paragraph or heading into an accordion. | ||
| 263 | |||
| 264 | = 1.0.2 = | ||
| 265 | Added the ability for the block in the editor to accept custom css classes (allows for custom registration of Block Styles). | ||
| 266 | |||
| 267 | = 1.0.1 = | ||
| 268 | Updated readme. | ||
| 269 | |||
| 270 | = 1.0.0 = | ||
| 271 | ALL NEW plugin to support the new WordPress Gutenberg editor. |
| ... | @@ -8,11 +8,9 @@ | ... | @@ -8,11 +8,9 @@ |
| 8 | align-items: center; | 8 | align-items: center; |
| 9 | justify-content: center; | 9 | justify-content: center; |
| 10 | color:#fff; | 10 | color:#fff; |
| 11 | margin:40px -50%; | 11 | margin:40px -50% 0px -50%; |
| 12 | |||
| 13 | padding:0px 50%; | 12 | padding:0px 50%; |
| 14 | 13 | ||
| 15 | |||
| 16 | } | 14 | } |
| 17 | 15 | ||
| 18 | .call-out-block h2{ | 16 | .call-out-block h2{ | ... | ... |
| ... | @@ -98,9 +98,10 @@ error_log($carousel_style ); | ... | @@ -98,9 +98,10 @@ error_log($carousel_style ); |
| 98 | <?php endwhile; ?> | 98 | <?php endwhile; ?> |
| 99 | </div> | 99 | </div> |
| 100 | <div class="swiper-pagination"></div> | 100 | <div class="swiper-pagination"></div> |
| 101 | </div> | 101 | |
| 102 | <div class="swiper-button-prev" data-id="<?= $id ?>"></div> | 102 | <div class="swiper-button-prev" data-id="<?= $id ?>"></div> |
| 103 | <div class="swiper-button-next" data-id="<?= $id ?>"></div> | 103 | <div class="swiper-button-next" data-id="<?= $id ?>"></div> |
| 104 | </div> | ||
| 104 | <?php else: ?> | 105 | <?php else: ?> |
| 105 | <p>Please add some slides.</p> | 106 | <p>Please add some slides.</p> |
| 106 | <?php endif; ?> | 107 | <?php endif; ?> | ... | ... |
| ... | @@ -15604,11 +15604,10 @@ h1, .h1 { | ... | @@ -15604,11 +15604,10 @@ h1, .h1 { |
| 15604 | } | 15604 | } |
| 15605 | 15605 | ||
| 15606 | h2, .h2 { | 15606 | h2, .h2 { |
| 15607 | text-align: center; | ||
| 15608 | color: #0484B8; | 15607 | color: #0484B8; |
| 15609 | font-size: 40px; | 15608 | font-size: 40px; |
| 15610 | line-height: 49px; | 15609 | line-height: 49px; |
| 15611 | margin-bottom: 40px; | 15610 | margin-bottom: 20px; |
| 15612 | } | 15611 | } |
| 15613 | 15612 | ||
| 15614 | h3, .h3 { | 15613 | h3, .h3 { |
| ... | @@ -15618,6 +15617,14 @@ h3, .h3 { | ... | @@ -15618,6 +15617,14 @@ h3, .h3 { |
| 15618 | margin-top: 20px; | 15617 | margin-top: 20px; |
| 15619 | } | 15618 | } |
| 15620 | 15619 | ||
| 15620 | a { | ||
| 15621 | color: #2C2C2C; | ||
| 15622 | } | ||
| 15623 | |||
| 15624 | div#full-width-page-wrapper { | ||
| 15625 | padding-bottom: 0px; | ||
| 15626 | } | ||
| 15627 | |||
| 15621 | input[type=text], input[type=email] { | 15628 | input[type=text], input[type=email] { |
| 15622 | border-radius: 0px !important; | 15629 | border-radius: 0px !important; |
| 15623 | border: 0px solid #fff !important; | 15630 | border: 0px solid #fff !important; |
| ... | @@ -15659,16 +15666,21 @@ input[type=checkbox] { | ... | @@ -15659,16 +15666,21 @@ input[type=checkbox] { |
| 15659 | border-bottom: 20px solid #0484B8; | 15666 | border-bottom: 20px solid #0484B8; |
| 15660 | } | 15667 | } |
| 15661 | 15668 | ||
| 15662 | #wpcf7-f115-p18-o1 { | 15669 | .wpcf7 { |
| 15670 | max-width: 100% !important; | ||
| 15671 | } | ||
| 15672 | .wpcf7 .contact-form { | ||
| 15673 | padding-top: 40px; | ||
| 15663 | max-width: 80% !important; | 15674 | max-width: 80% !important; |
| 15675 | margin: auto; | ||
| 15664 | } | 15676 | } |
| 15665 | #wpcf7-f115-p18-o1 input[type=text], #wpcf7-f115-p18-o1 input[type=email], #wpcf7-f115-p18-o1 textarea { | 15677 | .wpcf7 .contact-form input[type=text], .wpcf7 .contact-form input[type=email], .wpcf7 .contact-form textarea { |
| 15666 | background-color: #E5F2F8; | 15678 | background-color: #E5F2F8; |
| 15667 | } | 15679 | } |
| 15668 | #wpcf7-f115-p18-o1 .wpcf7-list-item { | 15680 | .wpcf7 .contact-form .wpcf7-list-item { |
| 15669 | margin: 0px; | 15681 | margin: 0px; |
| 15670 | } | 15682 | } |
| 15671 | #wpcf7-f115-p18-o1 input[type=submit] { | 15683 | .wpcf7 .contact-form input[type=submit] { |
| 15672 | text-align: center; | 15684 | text-align: center; |
| 15673 | margin: auto; | 15685 | margin: auto; |
| 15674 | margin-top: 20px; | 15686 | margin-top: 20px; |
| ... | @@ -15677,6 +15689,22 @@ input[type=checkbox] { | ... | @@ -15677,6 +15689,22 @@ input[type=checkbox] { |
| 15677 | color: #fff; | 15689 | color: #fff; |
| 15678 | text-transform: uppercase; | 15690 | text-transform: uppercase; |
| 15679 | display: block; | 15691 | display: block; |
| 15692 | font-size: 18px; | ||
| 15693 | } | ||
| 15694 | |||
| 15695 | .no-bullets { | ||
| 15696 | list-style: none; | ||
| 15697 | -webkit-margin-before: 0em; | ||
| 15698 | margin-block-start: 0em; | ||
| 15699 | -webkit-padding-start: 0px; | ||
| 15700 | padding-inline-start: 0px; | ||
| 15701 | } | ||
| 15702 | .no-bullets li { | ||
| 15703 | margin-bottom: 10px; | ||
| 15704 | } | ||
| 15705 | |||
| 15706 | .wp-block-image.is-style-rounded img { | ||
| 15707 | border-radius: 25px; | ||
| 15680 | } | 15708 | } |
| 15681 | 15709 | ||
| 15682 | .pre-header { | 15710 | .pre-header { |
| ... | @@ -15828,11 +15856,11 @@ input[type=checkbox] { | ... | @@ -15828,11 +15856,11 @@ input[type=checkbox] { |
| 15828 | background-position: center; | 15856 | background-position: center; |
| 15829 | background-repeat: no-repeat; | 15857 | background-repeat: no-repeat; |
| 15830 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23.024' height='23.545' viewBox='0 0 23.024 23.545'%3E%3Cg id='Group_1373' data-name='Group 1373' transform='translate(0 1.5)'%3E%3Cline id='Line_15' data-name='Line 15' y1='15.007' transform='translate(11.512 7.038)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath id='Path_1388' data-name='Path 1388' d='M3331.593 12517.547h23.024' transform='translate(-3331.593 -12517.547)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath id='Path_1389' data-name='Path 1389' d='M3279.832 12508.2l8.216-8.217 8.216 8.217' transform='translate(-3276.535 -12494.895)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E"); | 15858 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23.024' height='23.545' viewBox='0 0 23.024 23.545'%3E%3Cg id='Group_1373' data-name='Group 1373' transform='translate(0 1.5)'%3E%3Cline id='Line_15' data-name='Line 15' y1='15.007' transform='translate(11.512 7.038)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath id='Path_1388' data-name='Path 1388' d='M3331.593 12517.547h23.024' transform='translate(-3331.593 -12517.547)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath id='Path_1389' data-name='Path 1389' d='M3279.832 12508.2l8.216-8.217 8.216 8.217' transform='translate(-3276.535 -12494.895)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E"); |
| 15859 | z-index: 999; | ||
| 15831 | } | 15860 | } |
| 15832 | 15861 | ||
| 15833 | #btn-back-to-top:hover { | 15862 | #btn-back-to-top:hover { |
| 15834 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23.024' height='23.545' viewBox='0 0 23.024 23.545'%3E%3Cg id='Group_1373' data-name='Group 1373' transform='translate(0 1.5)'%3E%3Cline id='Line_15' data-name='Line 15' y1='15.007' transform='translate(11.512 7.038)' fill='none' stroke='%232C2C2C' stroke-width='3'/%3E%3Cpath id='Path_1388' data-name='Path 1388' d='M3331.593 12517.547h23.024' transform='translate(-3331.593 -12517.547)' fill='none' stroke='%232C2C2C' stroke-width='3'/%3E%3Cpath id='Path_1389' data-name='Path 1389' d='M3279.832 12508.2l8.216-8.217 8.216 8.217' transform='translate(-3276.535 -12494.895)' fill='none' stroke='%2C2C2C' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E"); | 15863 | background-color: #000; |
| 15835 | background-color: #fff; | ||
| 15836 | } | 15864 | } |
| 15837 | 15865 | ||
| 15838 | #wrapper-footer-full { | 15866 | #wrapper-footer-full { |
| ... | @@ -15866,7 +15894,7 @@ input[type=checkbox] { | ... | @@ -15866,7 +15894,7 @@ input[type=checkbox] { |
| 15866 | .newsletter { | 15894 | .newsletter { |
| 15867 | background-color: #6ED5FF; | 15895 | background-color: #6ED5FF; |
| 15868 | min-height: 236px; | 15896 | min-height: 236px; |
| 15869 | padding-top: 52px; | 15897 | padding: 52px 0px 32px 0px; |
| 15870 | } | 15898 | } |
| 15871 | .newsletter h2, .newsletter .h2 { | 15899 | .newsletter h2, .newsletter .h2 { |
| 15872 | font-size: 18px; | 15900 | font-size: 18px; |
| ... | @@ -15923,12 +15951,6 @@ input[type=checkbox] { | ... | @@ -15923,12 +15951,6 @@ input[type=checkbox] { |
| 15923 | left: 0 !important; | 15951 | left: 0 !important; |
| 15924 | min-height: 340px !important; | 15952 | min-height: 340px !important; |
| 15925 | } | 15953 | } |
| 15926 | .carousel .carousel-items { | ||
| 15927 | margin-left: 1.75rem; | ||
| 15928 | } | ||
| 15929 | .carousel .swiper-wrapper { | ||
| 15930 | gap: 1rem; | ||
| 15931 | } | ||
| 15932 | .carousel .swiper-button-next { | 15954 | .carousel .swiper-button-next { |
| 15933 | right: 8px !important; | 15955 | right: 8px !important; |
| 15934 | } | 15956 | } |
| ... | @@ -15938,6 +15960,12 @@ input[type=checkbox] { | ... | @@ -15938,6 +15960,12 @@ input[type=checkbox] { |
| 15938 | .carousel .swiper-pagination { | 15960 | .carousel .swiper-pagination { |
| 15939 | bottom: -20px !important; | 15961 | bottom: -20px !important; |
| 15940 | } | 15962 | } |
| 15963 | .carousel .carousel-items { | ||
| 15964 | margin-left: 1.75rem; | ||
| 15965 | } | ||
| 15966 | .carousel .swiper-wrapper { | ||
| 15967 | gap: 1rem; | ||
| 15968 | } | ||
| 15941 | 15969 | ||
| 15942 | .testimonials-carousel .swiper-slide { | 15970 | .testimonials-carousel .swiper-slide { |
| 15943 | width: 890px !important; | 15971 | width: 890px !important; |
| ... | @@ -15945,7 +15973,7 @@ input[type=checkbox] { | ... | @@ -15945,7 +15973,7 @@ input[type=checkbox] { |
| 15945 | .testimonials-carousel .swiper-slide .testimonials { | 15973 | .testimonials-carousel .swiper-slide .testimonials { |
| 15946 | width: 890px; | 15974 | width: 890px; |
| 15947 | background: #E5F2F8; | 15975 | background: #E5F2F8; |
| 15948 | border-radius: 8px 8px 0px 0px; | 15976 | border-radius: 25px 25px 0px 0px; |
| 15949 | margin-right: 20px; | 15977 | margin-right: 20px; |
| 15950 | } | 15978 | } |
| 15951 | .testimonials-carousel .swiper-slide .testimonials .row { | 15979 | .testimonials-carousel .swiper-slide .testimonials .row { |
| ... | @@ -15971,12 +15999,118 @@ input[type=checkbox] { | ... | @@ -15971,12 +15999,118 @@ input[type=checkbox] { |
| 15971 | .testimonials-carousel .swiper-slide:nth-of-type(2) .testimonials .row { | 15999 | .testimonials-carousel .swiper-slide:nth-of-type(2) .testimonials .row { |
| 15972 | border-bottom: 20px solid #3F9C35; | 16000 | border-bottom: 20px solid #3F9C35; |
| 15973 | } | 16001 | } |
| 16002 | .testimonials-carousel .swiper-slide:nth-of-type(2) .promo-img img { | ||
| 16003 | border-bottom: 20px solid #3F9C35; | ||
| 16004 | } | ||
| 15974 | .testimonials-carousel .swiper-slide:nth-of-type(3) .testimonials .row { | 16005 | .testimonials-carousel .swiper-slide:nth-of-type(3) .testimonials .row { |
| 15975 | border-bottom: 20px solid #0484B8; | 16006 | border-bottom: 20px solid #0484B8; |
| 15976 | } | 16007 | } |
| 16008 | .testimonials-carousel .swiper-slide:nth-of-type(3) .promo-img img { | ||
| 16009 | border-bottom: 20px solid #0484B8; | ||
| 16010 | } | ||
| 15977 | .testimonials-carousel .swiper-slide:nth-of-type(4) .testimonials .row { | 16011 | .testimonials-carousel .swiper-slide:nth-of-type(4) .testimonials .row { |
| 15978 | border-bottom: 20px solid #E04E39; | 16012 | border-bottom: 20px solid #E04E39; |
| 15979 | } | 16013 | } |
| 16014 | .testimonials-carousel .swiper-slide:nth-of-type(4) .promo-img img { | ||
| 16015 | border-bottom: 20px solid #E04E39; | ||
| 16016 | } | ||
| 16017 | |||
| 16018 | .promo-carousel { | ||
| 16019 | width: 100% !important; | ||
| 16020 | margin-left: 0px !important; | ||
| 16021 | position: relative; | ||
| 16022 | } | ||
| 16023 | @media only screen and (min-width: 1400px) { | ||
| 16024 | .promo-carousel { | ||
| 16025 | max-width: 100% !important; | ||
| 16026 | } | ||
| 16027 | } | ||
| 16028 | .promo-carousel .swiper-slide { | ||
| 16029 | margin-left: 0px !important; | ||
| 16030 | max-width: 100% !important; | ||
| 16031 | } | ||
| 16032 | @media only screen and (min-width: 1400px) { | ||
| 16033 | .promo-carousel .swiper-slide { | ||
| 16034 | width: 100% !important; | ||
| 16035 | } | ||
| 16036 | } | ||
| 16037 | .promo-carousel .swiper-slide .promo-img { | ||
| 16038 | max-height: 264px; | ||
| 16039 | max-width: 372px; | ||
| 16040 | overflow: hidden; | ||
| 16041 | border-bottom: 20px solid #FFA300; | ||
| 16042 | } | ||
| 16043 | .promo-carousel .swiper-slide .promo-img img { | ||
| 16044 | max-width: 372px; | ||
| 16045 | border-radius: 25px 25px 0px 0px; | ||
| 16046 | } | ||
| 16047 | .promo-carousel .swiper-slide .promo.row { | ||
| 16048 | width: 100%; | ||
| 16049 | border-top: 1px solid #FFA300; | ||
| 16050 | border-bottom: 1px solid #FFA300; | ||
| 16051 | margin: 75px auto; | ||
| 16052 | padding: 56px 0px; | ||
| 16053 | } | ||
| 16054 | @media only screen and (min-width: 1400px) { | ||
| 16055 | .promo-carousel .swiper-slide .promo.row { | ||
| 16056 | max-width: 1344px; | ||
| 16057 | } | ||
| 16058 | } | ||
| 16059 | @media only screen and (max-width: 600px) { | ||
| 16060 | .promo-carousel .swiper-slide .promo.row { | ||
| 16061 | width: 80%; | ||
| 16062 | } | ||
| 16063 | } | ||
| 16064 | .promo-carousel .swiper-button-next { | ||
| 16065 | right: 30px !important; | ||
| 16066 | } | ||
| 16067 | .promo-carousel .swiper-button-prev { | ||
| 16068 | left: 7px !important; | ||
| 16069 | } | ||
| 16070 | .promo-carousel .swiper-pagination { | ||
| 16071 | bottom: 95px !important; | ||
| 16072 | } | ||
| 16073 | .promo-carousel .swiper-slide:nth-of-type(2) .promo-img { | ||
| 16074 | border-bottom: 20px solid #3F9C35; | ||
| 16075 | } | ||
| 16076 | .promo-carousel .swiper-slide:nth-of-type(3) .promo-img { | ||
| 16077 | border-bottom: 20px solid #0484B8; | ||
| 16078 | } | ||
| 16079 | .promo-carousel .swiper-slide:nth-of-type(4) .promo-img { | ||
| 16080 | border-bottom: 20px solid #E04E39; | ||
| 16081 | } | ||
| 16082 | |||
| 16083 | .c-accordion__title:after { | ||
| 16084 | content: "\f343"; | ||
| 16085 | font-family: "Font Awesome"; | ||
| 16086 | right: unset; | ||
| 16087 | left: 0px; | ||
| 16088 | } | ||
| 16089 | |||
| 16090 | .is-open > .c-accordion__title:after { | ||
| 16091 | content: "\f077"; | ||
| 16092 | font-family: "Font Awesome"; | ||
| 16093 | } | ||
| 16094 | |||
| 16095 | .c-accordion__title { | ||
| 16096 | padding-left: 30px; | ||
| 16097 | } | ||
| 16098 | |||
| 16099 | .c-accordion__content { | ||
| 16100 | padding-left: 30px; | ||
| 16101 | } | ||
| 16102 | |||
| 16103 | .js-accordion-item { | ||
| 16104 | background: var(--unnamed-color-ffffff) 0% 0% no-repeat padding-box; | ||
| 16105 | background: #FFFFFF 0% 0% no-repeat padding-box; | ||
| 16106 | box-shadow: 0px 3px 6px #00000029; | ||
| 16107 | border-radius: 10px; | ||
| 16108 | padding: 15px 10px 8px 10px; | ||
| 16109 | margin-bottom: 20px; | ||
| 16110 | } | ||
| 16111 | .js-accordion-item h3, .js-accordion-item .h3 { | ||
| 16112 | margin-top: 0px !important; | ||
| 16113 | } | ||
| 15980 | 16114 | ||
| 15981 | .has-blue-color, | 16115 | .has-blue-color, |
| 15982 | .has-blue-color:visited { | 16116 | .has-blue-color:visited { | ... | ... |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
| ... | @@ -9,6 +9,8 @@ | ... | @@ -9,6 +9,8 @@ |
| 9 | defined( 'ABSPATH' ) || exit; | 9 | defined( 'ABSPATH' ) || exit; |
| 10 | include 'inc/menu-widgets.php'; | 10 | include 'inc/menu-widgets.php'; |
| 11 | include 'inc/blocks.php'; | 11 | include 'inc/blocks.php'; |
| 12 | include 'inc/custom-post-type.php'; | ||
| 13 | include 'inc/shortcodes.php'; | ||
| 12 | 14 | ||
| 13 | 15 | ||
| 14 | /** | 16 | /** | ... | ... |
| 1 | <?php | ||
| 2 | |||
| 3 | function create_posttype() { | ||
| 4 | |||
| 5 | register_post_type( 'promo', | ||
| 6 | array( | ||
| 7 | 'labels' => array( | ||
| 8 | 'name' => __( 'Promos' ), | ||
| 9 | 'singular_name' => __( 'Promo' ) | ||
| 10 | ), | ||
| 11 | 'menu_icon' => 'dashicons-info', | ||
| 12 | 'public' => true, | ||
| 13 | 'has_archive' => false, | ||
| 14 | 'rewrite' => array('slug' => 'promo', 'with_front'=>false), | ||
| 15 | 'show_in_rest' => true, | ||
| 16 | 'taxonomies' => array( 'category' ), | ||
| 17 | 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields' ), | ||
| 18 | |||
| 19 | ) | ||
| 20 | ); | ||
| 21 | |||
| 22 | $labels = array( | ||
| 23 | 'name' => _x( 'Promo Categories', 'taxonomy general name' ), | ||
| 24 | 'singular_name' => _x( 'Promo Category', 'taxonomy singular name' ), | ||
| 25 | 'search_items' => __( 'Search Promo Cats' ), | ||
| 26 | 'all_items' => __( 'All Promo Cats' ), | ||
| 27 | 'parent_item' => __( 'Parent Subject' ), | ||
| 28 | 'parent_item_colon' => __( 'Parent Subject:' ), | ||
| 29 | 'edit_item' => __( 'Edit Subject' ), | ||
| 30 | 'update_item' => __( 'Update Subject' ), | ||
| 31 | 'add_new_item' => __( 'Add New Subject' ), | ||
| 32 | 'new_item_name' => __( 'New Subject Name' ), | ||
| 33 | 'menu_name' => __( 'Promo Category' ), | ||
| 34 | ); | ||
| 35 | |||
| 36 | // Now register the taxonomy | ||
| 37 | register_taxonomy('promo_category',array('promo'), array( | ||
| 38 | 'hierarchical' => true, | ||
| 39 | 'labels' => $labels, | ||
| 40 | 'show_ui' => true, | ||
| 41 | 'show_in_rest' => true, | ||
| 42 | 'show_admin_column' => true, | ||
| 43 | 'query_var' => true, | ||
| 44 | 'rewrite' => array( 'slug' => 'promo-category' ), | ||
| 45 | )); | ||
| 46 | |||
| 47 | } | ||
| 48 | |||
| 49 | add_action( 'init', 'create_posttype' ); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
wp-content/themes/crlg/inc/shortcodes.php
0 → 100644
| 1 | <?php | ||
| 2 | function promos() | ||
| 3 | { | ||
| 4 | $custom_args = array( | ||
| 5 | 'post_type' => 'promo', | ||
| 6 | 'posts_per_page' => 3, | ||
| 7 | 'paged' => 1, | ||
| 8 | ); | ||
| 9 | $custom_query = new \WP_Query($custom_args); | ||
| 10 | |||
| 11 | ob_start(); | ||
| 12 | $uniqid = uniqid(); | ||
| 13 | if ($custom_query->have_posts()):?> | ||
| 14 | <div class="carousel"> | ||
| 15 | <div id="<?php echo $uniqid; ?>" class="promo-carousel carousel-items"> | ||
| 16 | <div class='swiper-wrapper'> | ||
| 17 | <?php while ($custom_query->have_posts()): $custom_query->the_post(); | ||
| 18 | $id = get_the_ID(); | ||
| 19 | $post = get_post($id); | ||
| 20 | $link = get_permalink($id); | ||
| 21 | if ($custom_link = get_post_meta($id, 'link', true)) { | ||
| 22 | $link = $custom_link; | ||
| 23 | } | ||
| 24 | $link_text = "Read More..."; | ||
| 25 | if ($custom_link_text = get_post_meta($id, 'link_text', true)) { | ||
| 26 | $link_text = $custom_link_text; | ||
| 27 | } | ||
| 28 | $text = strip_shortcodes($post->post_content); | ||
| 29 | $text = apply_filters( 'the_content', $text ); | ||
| 30 | $text = str_replace(']]>', ']]>', $text); | ||
| 31 | |||
| 32 | $excerpt_length = apply_filters( 'excerpt_length', 40 ); | ||
| 33 | $text = wp_trim_words( $text, $excerpt_length, ' ...' ); | ||
| 34 | ?> | ||
| 35 | <div class="swiper-slide container"> | ||
| 36 | <div class="promo row align-items-center"> | ||
| 37 | <div class="col-lg-4 col-md-12"> | ||
| 38 | <div class="promo-img"> | ||
| 39 | <?php echo get_the_post_thumbnail($id, 'full' ); ?> | ||
| 40 | <div class="promo-img-over"> </div> | ||
| 41 | </div> | ||
| 42 | </div> | ||
| 43 | <div class="promo_content col-lg-8 col-md-12"> | ||
| 44 | <?php echo '<h3>'.$post->post_title.'</h3><p>'. $text.'</p>'; ?> | ||
| 45 | <a class="promo-link" target="_blank" href="<?php echo $link; ?>" title="<?php the_title_attribute(); ?>"><?php echo $link_text;?></a> | ||
| 46 | </div> | ||
| 47 | </div> | ||
| 48 | </div> | ||
| 49 | <?php endwhile; ?> | ||
| 50 | </div> | ||
| 51 | <div class="swiper-pagination"></div> | ||
| 52 | <div class="swiper-button-prev" data-id="<?= $uniqid; ?>"></div> | ||
| 53 | <div class="swiper-button-next" data-id="<?= $uniqid; ?>"></div> | ||
| 54 | </div> | ||
| 55 | </div> | ||
| 56 | <?php endif; ?> | ||
| 57 | <?php wp_reset_query(); ?> | ||
| 58 | <?php $output = ob_get_clean(); | ||
| 59 | |||
| 60 | return $output; | ||
| 61 | } | ||
| 62 | |||
| 63 | add_shortcode( 'promos', 'promos' ); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -14097,6 +14097,136 @@ | ... | @@ -14097,6 +14097,136 @@ |
| 14097 | }); | 14097 | }); |
| 14098 | Swiper.use([Resize, Observer]); | 14098 | Swiper.use([Resize, Observer]); |
| 14099 | 14099 | ||
| 14100 | /* eslint-disable consistent-return */ | ||
| 14101 | function Keyboard({ | ||
| 14102 | swiper, | ||
| 14103 | extendParams, | ||
| 14104 | on, | ||
| 14105 | emit | ||
| 14106 | }) { | ||
| 14107 | const document = getDocument(); | ||
| 14108 | const window = getWindow(); | ||
| 14109 | swiper.keyboard = { | ||
| 14110 | enabled: false | ||
| 14111 | }; | ||
| 14112 | extendParams({ | ||
| 14113 | keyboard: { | ||
| 14114 | enabled: false, | ||
| 14115 | onlyInViewport: true, | ||
| 14116 | pageUpDown: true | ||
| 14117 | } | ||
| 14118 | }); | ||
| 14119 | |||
| 14120 | function handle(event) { | ||
| 14121 | if (!swiper.enabled) return; | ||
| 14122 | const { | ||
| 14123 | rtlTranslate: rtl | ||
| 14124 | } = swiper; | ||
| 14125 | let e = event; | ||
| 14126 | if (e.originalEvent) e = e.originalEvent; // jquery fix | ||
| 14127 | |||
| 14128 | const kc = e.keyCode || e.charCode; | ||
| 14129 | const pageUpDown = swiper.params.keyboard.pageUpDown; | ||
| 14130 | const isPageUp = pageUpDown && kc === 33; | ||
| 14131 | const isPageDown = pageUpDown && kc === 34; | ||
| 14132 | const isArrowLeft = kc === 37; | ||
| 14133 | const isArrowRight = kc === 39; | ||
| 14134 | const isArrowUp = kc === 38; | ||
| 14135 | const isArrowDown = kc === 40; // Directions locks | ||
| 14136 | |||
| 14137 | if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) { | ||
| 14138 | return false; | ||
| 14139 | } | ||
| 14140 | |||
| 14141 | if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) { | ||
| 14142 | return false; | ||
| 14143 | } | ||
| 14144 | |||
| 14145 | if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { | ||
| 14146 | return undefined; | ||
| 14147 | } | ||
| 14148 | |||
| 14149 | if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) { | ||
| 14150 | return undefined; | ||
| 14151 | } | ||
| 14152 | |||
| 14153 | if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) { | ||
| 14154 | let inView = false; // Check that swiper should be inside of visible area of window | ||
| 14155 | |||
| 14156 | if (swiper.$el.parents(`.${swiper.params.slideClass}`).length > 0 && swiper.$el.parents(`.${swiper.params.slideActiveClass}`).length === 0) { | ||
| 14157 | return undefined; | ||
| 14158 | } | ||
| 14159 | |||
| 14160 | const $el = swiper.$el; | ||
| 14161 | const swiperWidth = $el[0].clientWidth; | ||
| 14162 | const swiperHeight = $el[0].clientHeight; | ||
| 14163 | const windowWidth = window.innerWidth; | ||
| 14164 | const windowHeight = window.innerHeight; | ||
| 14165 | const swiperOffset = swiper.$el.offset(); | ||
| 14166 | if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft; | ||
| 14167 | const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]]; | ||
| 14168 | |||
| 14169 | for (let i = 0; i < swiperCoord.length; i += 1) { | ||
| 14170 | const point = swiperCoord[i]; | ||
| 14171 | |||
| 14172 | if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) { | ||
| 14173 | if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line | ||
| 14174 | |||
| 14175 | inView = true; | ||
| 14176 | } | ||
| 14177 | } | ||
| 14178 | |||
| 14179 | if (!inView) return undefined; | ||
| 14180 | } | ||
| 14181 | |||
| 14182 | if (swiper.isHorizontal()) { | ||
| 14183 | if (isPageUp || isPageDown || isArrowLeft || isArrowRight) { | ||
| 14184 | if (e.preventDefault) e.preventDefault();else e.returnValue = false; | ||
| 14185 | } | ||
| 14186 | |||
| 14187 | if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext(); | ||
| 14188 | if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev(); | ||
| 14189 | } else { | ||
| 14190 | if (isPageUp || isPageDown || isArrowUp || isArrowDown) { | ||
| 14191 | if (e.preventDefault) e.preventDefault();else e.returnValue = false; | ||
| 14192 | } | ||
| 14193 | |||
| 14194 | if (isPageDown || isArrowDown) swiper.slideNext(); | ||
| 14195 | if (isPageUp || isArrowUp) swiper.slidePrev(); | ||
| 14196 | } | ||
| 14197 | |||
| 14198 | emit('keyPress', kc); | ||
| 14199 | return undefined; | ||
| 14200 | } | ||
| 14201 | |||
| 14202 | function enable() { | ||
| 14203 | if (swiper.keyboard.enabled) return; | ||
| 14204 | $(document).on('keydown', handle); | ||
| 14205 | swiper.keyboard.enabled = true; | ||
| 14206 | } | ||
| 14207 | |||
| 14208 | function disable() { | ||
| 14209 | if (!swiper.keyboard.enabled) return; | ||
| 14210 | $(document).off('keydown', handle); | ||
| 14211 | swiper.keyboard.enabled = false; | ||
| 14212 | } | ||
| 14213 | |||
| 14214 | on('init', () => { | ||
| 14215 | if (swiper.params.keyboard.enabled) { | ||
| 14216 | enable(); | ||
| 14217 | } | ||
| 14218 | }); | ||
| 14219 | on('destroy', () => { | ||
| 14220 | if (swiper.keyboard.enabled) { | ||
| 14221 | disable(); | ||
| 14222 | } | ||
| 14223 | }); | ||
| 14224 | Object.assign(swiper.keyboard, { | ||
| 14225 | enable, | ||
| 14226 | disable | ||
| 14227 | }); | ||
| 14228 | } | ||
| 14229 | |||
| 14100 | function createElementIfNotDefined(swiper, originalParams, params, checkProps) { | 14230 | function createElementIfNotDefined(swiper, originalParams, params, checkProps) { |
| 14101 | const document = getDocument(); | 14231 | const document = getDocument(); |
| 14102 | 14232 | ||
| ... | @@ -14770,6 +14900,356 @@ | ... | @@ -14770,6 +14900,356 @@ |
| 14770 | }); | 14900 | }); |
| 14771 | } | 14901 | } |
| 14772 | 14902 | ||
| 14903 | function A11y({ | ||
| 14904 | swiper, | ||
| 14905 | extendParams, | ||
| 14906 | on | ||
| 14907 | }) { | ||
| 14908 | extendParams({ | ||
| 14909 | a11y: { | ||
| 14910 | enabled: true, | ||
| 14911 | notificationClass: 'swiper-notification', | ||
| 14912 | prevSlideMessage: 'Previous slide', | ||
| 14913 | nextSlideMessage: 'Next slide', | ||
| 14914 | firstSlideMessage: 'This is the first slide', | ||
| 14915 | lastSlideMessage: 'This is the last slide', | ||
| 14916 | paginationBulletMessage: 'Go to slide {{index}}', | ||
| 14917 | slideLabelMessage: '{{index}} / {{slidesLength}}', | ||
| 14918 | containerMessage: null, | ||
| 14919 | containerRoleDescriptionMessage: null, | ||
| 14920 | itemRoleDescriptionMessage: null, | ||
| 14921 | slideRole: 'group', | ||
| 14922 | id: null | ||
| 14923 | } | ||
| 14924 | }); | ||
| 14925 | swiper.a11y = { | ||
| 14926 | clicked: false | ||
| 14927 | }; | ||
| 14928 | let liveRegion = null; | ||
| 14929 | |||
| 14930 | function notify(message) { | ||
| 14931 | const notification = liveRegion; | ||
| 14932 | if (notification.length === 0) return; | ||
| 14933 | notification.html(''); | ||
| 14934 | notification.html(message); | ||
| 14935 | } | ||
| 14936 | |||
| 14937 | function getRandomNumber(size = 16) { | ||
| 14938 | const randomChar = () => Math.round(16 * Math.random()).toString(16); | ||
| 14939 | |||
| 14940 | return 'x'.repeat(size).replace(/x/g, randomChar); | ||
| 14941 | } | ||
| 14942 | |||
| 14943 | function makeElFocusable($el) { | ||
| 14944 | $el.attr('tabIndex', '0'); | ||
| 14945 | } | ||
| 14946 | |||
| 14947 | function makeElNotFocusable($el) { | ||
| 14948 | $el.attr('tabIndex', '-1'); | ||
| 14949 | } | ||
| 14950 | |||
| 14951 | function addElRole($el, role) { | ||
| 14952 | $el.attr('role', role); | ||
| 14953 | } | ||
| 14954 | |||
| 14955 | function addElRoleDescription($el, description) { | ||
| 14956 | $el.attr('aria-roledescription', description); | ||
| 14957 | } | ||
| 14958 | |||
| 14959 | function addElControls($el, controls) { | ||
| 14960 | $el.attr('aria-controls', controls); | ||
| 14961 | } | ||
| 14962 | |||
| 14963 | function addElLabel($el, label) { | ||
| 14964 | $el.attr('aria-label', label); | ||
| 14965 | } | ||
| 14966 | |||
| 14967 | function addElId($el, id) { | ||
| 14968 | $el.attr('id', id); | ||
| 14969 | } | ||
| 14970 | |||
| 14971 | function addElLive($el, live) { | ||
| 14972 | $el.attr('aria-live', live); | ||
| 14973 | } | ||
| 14974 | |||
| 14975 | function disableEl($el) { | ||
| 14976 | $el.attr('aria-disabled', true); | ||
| 14977 | } | ||
| 14978 | |||
| 14979 | function enableEl($el) { | ||
| 14980 | $el.attr('aria-disabled', false); | ||
| 14981 | } | ||
| 14982 | |||
| 14983 | function onEnterOrSpaceKey(e) { | ||
| 14984 | if (e.keyCode !== 13 && e.keyCode !== 32) return; | ||
| 14985 | const params = swiper.params.a11y; | ||
| 14986 | const $targetEl = $(e.target); | ||
| 14987 | |||
| 14988 | if (swiper.navigation && swiper.navigation.$nextEl && $targetEl.is(swiper.navigation.$nextEl)) { | ||
| 14989 | if (!(swiper.isEnd && !swiper.params.loop)) { | ||
| 14990 | swiper.slideNext(); | ||
| 14991 | } | ||
| 14992 | |||
| 14993 | if (swiper.isEnd) { | ||
| 14994 | notify(params.lastSlideMessage); | ||
| 14995 | } else { | ||
| 14996 | notify(params.nextSlideMessage); | ||
| 14997 | } | ||
| 14998 | } | ||
| 14999 | |||
| 15000 | if (swiper.navigation && swiper.navigation.$prevEl && $targetEl.is(swiper.navigation.$prevEl)) { | ||
| 15001 | if (!(swiper.isBeginning && !swiper.params.loop)) { | ||
| 15002 | swiper.slidePrev(); | ||
| 15003 | } | ||
| 15004 | |||
| 15005 | if (swiper.isBeginning) { | ||
| 15006 | notify(params.firstSlideMessage); | ||
| 15007 | } else { | ||
| 15008 | notify(params.prevSlideMessage); | ||
| 15009 | } | ||
| 15010 | } | ||
| 15011 | |||
| 15012 | if (swiper.pagination && $targetEl.is(classesToSelector(swiper.params.pagination.bulletClass))) { | ||
| 15013 | $targetEl[0].click(); | ||
| 15014 | } | ||
| 15015 | } | ||
| 15016 | |||
| 15017 | function updateNavigation() { | ||
| 15018 | if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return; | ||
| 15019 | const { | ||
| 15020 | $nextEl, | ||
| 15021 | $prevEl | ||
| 15022 | } = swiper.navigation; | ||
| 15023 | |||
| 15024 | if ($prevEl && $prevEl.length > 0) { | ||
| 15025 | if (swiper.isBeginning) { | ||
| 15026 | disableEl($prevEl); | ||
| 15027 | makeElNotFocusable($prevEl); | ||
| 15028 | } else { | ||
| 15029 | enableEl($prevEl); | ||
| 15030 | makeElFocusable($prevEl); | ||
| 15031 | } | ||
| 15032 | } | ||
| 15033 | |||
| 15034 | if ($nextEl && $nextEl.length > 0) { | ||
| 15035 | if (swiper.isEnd) { | ||
| 15036 | disableEl($nextEl); | ||
| 15037 | makeElNotFocusable($nextEl); | ||
| 15038 | } else { | ||
| 15039 | enableEl($nextEl); | ||
| 15040 | makeElFocusable($nextEl); | ||
| 15041 | } | ||
| 15042 | } | ||
| 15043 | } | ||
| 15044 | |||
| 15045 | function hasPagination() { | ||
| 15046 | return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length; | ||
| 15047 | } | ||
| 15048 | |||
| 15049 | function hasClickablePagination() { | ||
| 15050 | return hasPagination() && swiper.params.pagination.clickable; | ||
| 15051 | } | ||
| 15052 | |||
| 15053 | function updatePagination() { | ||
| 15054 | const params = swiper.params.a11y; | ||
| 15055 | if (!hasPagination()) return; | ||
| 15056 | swiper.pagination.bullets.each(bulletEl => { | ||
| 15057 | const $bulletEl = $(bulletEl); | ||
| 15058 | |||
| 15059 | if (swiper.params.pagination.clickable) { | ||
| 15060 | makeElFocusable($bulletEl); | ||
| 15061 | |||
| 15062 | if (!swiper.params.pagination.renderBullet) { | ||
| 15063 | addElRole($bulletEl, 'button'); | ||
| 15064 | addElLabel($bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, $bulletEl.index() + 1)); | ||
| 15065 | } | ||
| 15066 | } | ||
| 15067 | |||
| 15068 | if ($bulletEl.is(`.${swiper.params.pagination.bulletActiveClass}`)) { | ||
| 15069 | $bulletEl.attr('aria-current', 'true'); | ||
| 15070 | } else { | ||
| 15071 | $bulletEl.removeAttr('aria-current'); | ||
| 15072 | } | ||
| 15073 | }); | ||
| 15074 | } | ||
| 15075 | |||
| 15076 | const initNavEl = ($el, wrapperId, message) => { | ||
| 15077 | makeElFocusable($el); | ||
| 15078 | |||
| 15079 | if ($el[0].tagName !== 'BUTTON') { | ||
| 15080 | addElRole($el, 'button'); | ||
| 15081 | $el.on('keydown', onEnterOrSpaceKey); | ||
| 15082 | } | ||
| 15083 | |||
| 15084 | addElLabel($el, message); | ||
| 15085 | addElControls($el, wrapperId); | ||
| 15086 | }; | ||
| 15087 | |||
| 15088 | const handlePointerDown = () => { | ||
| 15089 | swiper.a11y.clicked = true; | ||
| 15090 | }; | ||
| 15091 | |||
| 15092 | const handlePointerUp = () => { | ||
| 15093 | requestAnimationFrame(() => { | ||
| 15094 | requestAnimationFrame(() => { | ||
| 15095 | if (!swiper.destroyed) { | ||
| 15096 | swiper.a11y.clicked = false; | ||
| 15097 | } | ||
| 15098 | }); | ||
| 15099 | }); | ||
| 15100 | }; | ||
| 15101 | |||
| 15102 | const handleFocus = e => { | ||
| 15103 | if (swiper.a11y.clicked) return; | ||
| 15104 | const slideEl = e.target.closest(`.${swiper.params.slideClass}`); | ||
| 15105 | if (!slideEl || !swiper.slides.includes(slideEl)) return; | ||
| 15106 | const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex; | ||
| 15107 | const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl); | ||
| 15108 | if (isActive || isVisible) return; | ||
| 15109 | if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return; | ||
| 15110 | |||
| 15111 | if (swiper.isHorizontal()) { | ||
| 15112 | swiper.el.scrollLeft = 0; | ||
| 15113 | } else { | ||
| 15114 | swiper.el.scrollTop = 0; | ||
| 15115 | } | ||
| 15116 | |||
| 15117 | swiper.slideTo(swiper.slides.indexOf(slideEl), 0); | ||
| 15118 | }; | ||
| 15119 | |||
| 15120 | const initSlides = () => { | ||
| 15121 | const params = swiper.params.a11y; | ||
| 15122 | |||
| 15123 | if (params.itemRoleDescriptionMessage) { | ||
| 15124 | addElRoleDescription($(swiper.slides), params.itemRoleDescriptionMessage); | ||
| 15125 | } | ||
| 15126 | |||
| 15127 | if (params.slideRole) { | ||
| 15128 | addElRole($(swiper.slides), params.slideRole); | ||
| 15129 | } | ||
| 15130 | |||
| 15131 | const slidesLength = swiper.params.loop ? swiper.slides.filter(el => !el.classList.contains(swiper.params.slideDuplicateClass)).length : swiper.slides.length; | ||
| 15132 | |||
| 15133 | if (params.slideLabelMessage) { | ||
| 15134 | swiper.slides.each((slideEl, index) => { | ||
| 15135 | const $slideEl = $(slideEl); | ||
| 15136 | const slideIndex = swiper.params.loop ? parseInt($slideEl.attr('data-swiper-slide-index'), 10) : index; | ||
| 15137 | const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength); | ||
| 15138 | addElLabel($slideEl, ariaLabelMessage); | ||
| 15139 | }); | ||
| 15140 | } | ||
| 15141 | }; | ||
| 15142 | |||
| 15143 | const init = () => { | ||
| 15144 | const params = swiper.params.a11y; | ||
| 15145 | swiper.$el.append(liveRegion); // Container | ||
| 15146 | |||
| 15147 | const $containerEl = swiper.$el; | ||
| 15148 | |||
| 15149 | if (params.containerRoleDescriptionMessage) { | ||
| 15150 | addElRoleDescription($containerEl, params.containerRoleDescriptionMessage); | ||
| 15151 | } | ||
| 15152 | |||
| 15153 | if (params.containerMessage) { | ||
| 15154 | addElLabel($containerEl, params.containerMessage); | ||
| 15155 | } // Wrapper | ||
| 15156 | |||
| 15157 | |||
| 15158 | const $wrapperEl = swiper.$wrapperEl; | ||
| 15159 | const wrapperId = params.id || $wrapperEl.attr('id') || `swiper-wrapper-${getRandomNumber(16)}`; | ||
| 15160 | const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite'; | ||
| 15161 | addElId($wrapperEl, wrapperId); | ||
| 15162 | addElLive($wrapperEl, live); // Slide | ||
| 15163 | |||
| 15164 | initSlides(); // Navigation | ||
| 15165 | |||
| 15166 | let $nextEl; | ||
| 15167 | let $prevEl; | ||
| 15168 | |||
| 15169 | if (swiper.navigation && swiper.navigation.$nextEl) { | ||
| 15170 | $nextEl = swiper.navigation.$nextEl; | ||
| 15171 | } | ||
| 15172 | |||
| 15173 | if (swiper.navigation && swiper.navigation.$prevEl) { | ||
| 15174 | $prevEl = swiper.navigation.$prevEl; | ||
| 15175 | } | ||
| 15176 | |||
| 15177 | if ($nextEl && $nextEl.length) { | ||
| 15178 | initNavEl($nextEl, wrapperId, params.nextSlideMessage); | ||
| 15179 | } | ||
| 15180 | |||
| 15181 | if ($prevEl && $prevEl.length) { | ||
| 15182 | initNavEl($prevEl, wrapperId, params.prevSlideMessage); | ||
| 15183 | } // Pagination | ||
| 15184 | |||
| 15185 | |||
| 15186 | if (hasClickablePagination()) { | ||
| 15187 | swiper.pagination.$el.on('keydown', classesToSelector(swiper.params.pagination.bulletClass), onEnterOrSpaceKey); | ||
| 15188 | } // Tab focus | ||
| 15189 | |||
| 15190 | |||
| 15191 | swiper.$el.on('focus', handleFocus, true); | ||
| 15192 | swiper.$el.on('pointerdown', handlePointerDown, true); | ||
| 15193 | swiper.$el.on('pointerup', handlePointerUp, true); | ||
| 15194 | }; | ||
| 15195 | |||
| 15196 | function destroy() { | ||
| 15197 | if (liveRegion && liveRegion.length > 0) liveRegion.remove(); | ||
| 15198 | let $nextEl; | ||
| 15199 | let $prevEl; | ||
| 15200 | |||
| 15201 | if (swiper.navigation && swiper.navigation.$nextEl) { | ||
| 15202 | $nextEl = swiper.navigation.$nextEl; | ||
| 15203 | } | ||
| 15204 | |||
| 15205 | if (swiper.navigation && swiper.navigation.$prevEl) { | ||
| 15206 | $prevEl = swiper.navigation.$prevEl; | ||
| 15207 | } | ||
| 15208 | |||
| 15209 | if ($nextEl) { | ||
| 15210 | $nextEl.off('keydown', onEnterOrSpaceKey); | ||
| 15211 | } | ||
| 15212 | |||
| 15213 | if ($prevEl) { | ||
| 15214 | $prevEl.off('keydown', onEnterOrSpaceKey); | ||
| 15215 | } // Pagination | ||
| 15216 | |||
| 15217 | |||
| 15218 | if (hasClickablePagination()) { | ||
| 15219 | swiper.pagination.$el.off('keydown', classesToSelector(swiper.params.pagination.bulletClass), onEnterOrSpaceKey); | ||
| 15220 | } // Tab focus | ||
| 15221 | |||
| 15222 | |||
| 15223 | swiper.$el.off('focus', handleFocus, true); | ||
| 15224 | swiper.$el.off('pointerdown', handlePointerDown, true); | ||
| 15225 | swiper.$el.off('pointerup', handlePointerUp, true); | ||
| 15226 | } | ||
| 15227 | |||
| 15228 | on('beforeInit', () => { | ||
| 15229 | liveRegion = $(`<span class="${swiper.params.a11y.notificationClass}" aria-live="assertive" aria-atomic="true"></span>`); | ||
| 15230 | }); | ||
| 15231 | on('afterInit', () => { | ||
| 15232 | if (!swiper.params.a11y.enabled) return; | ||
| 15233 | init(); | ||
| 15234 | }); | ||
| 15235 | on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => { | ||
| 15236 | if (!swiper.params.a11y.enabled) return; | ||
| 15237 | initSlides(); | ||
| 15238 | }); | ||
| 15239 | on('fromEdge toEdge afterInit lock unlock', () => { | ||
| 15240 | if (!swiper.params.a11y.enabled) return; | ||
| 15241 | updateNavigation(); | ||
| 15242 | }); | ||
| 15243 | on('paginationUpdate', () => { | ||
| 15244 | if (!swiper.params.a11y.enabled) return; | ||
| 15245 | updatePagination(); | ||
| 15246 | }); | ||
| 15247 | on('destroy', () => { | ||
| 15248 | if (!swiper.params.a11y.enabled) return; | ||
| 15249 | destroy(); | ||
| 15250 | }); | ||
| 15251 | } | ||
| 15252 | |||
| 14773 | function styleInject(css, ref) { | 15253 | function styleInject(css, ref) { |
| 14774 | if ( ref === void 0 ) ref = {}; | 15254 | if ( ref === void 0 ) ref = {}; |
| 14775 | var insertAt = ref.insertAt; | 15255 | var insertAt = ref.insertAt; |
| ... | @@ -14797,36 +15277,65 @@ | ... | @@ -14797,36 +15277,65 @@ |
| 14797 | } | 15277 | } |
| 14798 | } | 15278 | } |
| 14799 | 15279 | ||
| 14800 | var css_248z$2 = "/**\n * Swiper 8.4.6\n * Most modern mobile touch slider and framework with hardware accelerated transitions\n * https://swiperjs.com\n *\n * Copyright 2014-2023 Vladimir Kharlampidi\n *\n * Released under the MIT License\n *\n * Released on: January 17, 2023\n */\n\n@font-face{font-family:swiper-icons;src:url('data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA');font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;box-sizing:content-box}.swiper-android .swiper-slide,.swiper-wrapper{transform:translate3d(0px,0,0)}.swiper-pointer-events{touch-action:pan-y}.swiper-pointer-events.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d,.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-cube-shadow,.swiper-3d .swiper-slide,.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:rgba(0,0,0,.15)}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-horizontal.swiper-css-mode>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-vertical.swiper-css-mode>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-centered>.swiper-wrapper::before{content:'';flex-shrink:0;order:9999}.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-horizontal>.swiper-wrapper::before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-vertical>.swiper-wrapper::before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}"; | 15280 | var css_248z$4 = "/**\n * Swiper 8.4.6\n * Most modern mobile touch slider and framework with hardware accelerated transitions\n * https://swiperjs.com\n *\n * Copyright 2014-2023 Vladimir Kharlampidi\n *\n * Released under the MIT License\n *\n * Released on: January 17, 2023\n */\n\n@font-face{font-family:swiper-icons;src:url('data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA');font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;box-sizing:content-box}.swiper-android .swiper-slide,.swiper-wrapper{transform:translate3d(0px,0,0)}.swiper-pointer-events{touch-action:pan-y}.swiper-pointer-events.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d,.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-cube-shadow,.swiper-3d .swiper-slide,.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:rgba(0,0,0,.15)}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-horizontal.swiper-css-mode>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-vertical.swiper-css-mode>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-centered>.swiper-wrapper::before{content:'';flex-shrink:0;order:9999}.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-horizontal>.swiper-wrapper::before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-vertical>.swiper-wrapper::before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}"; |
| 15281 | styleInject(css_248z$4); | ||
| 15282 | |||
| 15283 | var css_248z$3 = ":root{--swiper-navigation-size:44px}.swiper-button-next,.swiper-button-prev{position:absolute;top:50%;width:calc(var(--swiper-navigation-size)/ 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - (var(--swiper-navigation-size)/ 2));z-index:10;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--swiper-navigation-color,var(--swiper-theme-color))}.swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{opacity:.35;cursor:auto;pointer-events:none}.swiper-button-next.swiper-button-hidden,.swiper-button-prev.swiper-button-hidden{opacity:0;cursor:auto;pointer-events:none}.swiper-navigation-disabled .swiper-button-next,.swiper-navigation-disabled .swiper-button-prev{display:none!important}.swiper-button-next:after,.swiper-button-prev:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none!important;letter-spacing:0;font-variant:initial;line-height:1}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:10px;right:auto}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:'prev'}.swiper-button-next,.swiper-rtl .swiper-button-prev{right:10px;left:auto}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:'next'}.swiper-button-lock{display:none}"; | ||
| 15284 | styleInject(css_248z$3); | ||
| 15285 | |||
| 15286 | var css_248z$2 = ".swiper-pagination{position:absolute;text-align:center;transition:.3s opacity;transform:translate3d(0,0,0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none!important}.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal,.swiper-pagination-custom,.swiper-pagination-fraction{bottom:10px;left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width,var(--swiper-pagination-bullet-size,8px));height:var(--swiper-pagination-bullet-height,var(--swiper-pagination-bullet-size,8px));display:inline-block;border-radius:50%;background:var(--swiper-pagination-bullet-inactive-color,#000);opacity:var(--swiper-pagination-bullet-inactive-opacity, .2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;-webkit-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none!important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color,var(--swiper-theme-color))}.swiper-pagination-vertical.swiper-pagination-bullets,.swiper-vertical>.swiper-pagination-bullets{right:10px;top:50%;transform:translate3d(0px,-50%,0)}.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap,6px) 0;display:block}.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:.2s transform,.2s top}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap,4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translateX(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s left}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s right}.swiper-pagination-progressbar{background:rgba(0,0,0,.25);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color,var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{width:100%;height:4px;left:0;top:0}.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-vertical>.swiper-pagination-progressbar{width:4px;height:100%;left:0;top:0}.swiper-pagination-lock{display:none}"; | ||
| 14801 | styleInject(css_248z$2); | 15287 | styleInject(css_248z$2); |
| 14802 | 15288 | ||
| 14803 | var css_248z$1 = ":root{--swiper-navigation-size:44px}.swiper-button-next,.swiper-button-prev{position:absolute;top:50%;width:calc(var(--swiper-navigation-size)/ 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - (var(--swiper-navigation-size)/ 2));z-index:10;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--swiper-navigation-color,var(--swiper-theme-color))}.swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{opacity:.35;cursor:auto;pointer-events:none}.swiper-button-next.swiper-button-hidden,.swiper-button-prev.swiper-button-hidden{opacity:0;cursor:auto;pointer-events:none}.swiper-navigation-disabled .swiper-button-next,.swiper-navigation-disabled .swiper-button-prev{display:none!important}.swiper-button-next:after,.swiper-button-prev:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none!important;letter-spacing:0;font-variant:initial;line-height:1}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:10px;right:auto}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:'prev'}.swiper-button-next,.swiper-rtl .swiper-button-prev{right:10px;left:auto}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:'next'}.swiper-button-lock{display:none}"; | 15289 | var css_248z$1 = ""; |
| 14804 | styleInject(css_248z$1); | 15290 | styleInject(css_248z$1); |
| 14805 | 15291 | ||
| 14806 | var css_248z = ".swiper-pagination{position:absolute;text-align:center;transition:.3s opacity;transform:translate3d(0,0,0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none!important}.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal,.swiper-pagination-custom,.swiper-pagination-fraction{bottom:10px;left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(.33)}.swiper-pagination-bullet{width:var(--swiper-pagination-bullet-width,var(--swiper-pagination-bullet-size,8px));height:var(--swiper-pagination-bullet-height,var(--swiper-pagination-bullet-size,8px));display:inline-block;border-radius:50%;background:var(--swiper-pagination-bullet-inactive-color,#000);opacity:var(--swiper-pagination-bullet-inactive-opacity, .2)}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;-webkit-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none!important}.swiper-pagination-bullet-active{opacity:var(--swiper-pagination-bullet-opacity, 1);background:var(--swiper-pagination-color,var(--swiper-theme-color))}.swiper-pagination-vertical.swiper-pagination-bullets,.swiper-vertical>.swiper-pagination-bullets{right:10px;top:50%;transform:translate3d(0px,-50%,0)}.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{margin:var(--swiper-pagination-bullet-vertical-gap,6px) 0;display:block}.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:.2s transform,.2s top}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap,4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translateX(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s left}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:.2s transform,.2s right}.swiper-pagination-progressbar{background:rgba(0,0,0,.25);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color,var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{width:100%;height:4px;left:0;top:0}.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-vertical>.swiper-pagination-progressbar{width:4px;height:100%;left:0;top:0}.swiper-pagination-lock{display:none}"; | 15292 | var css_248z = ".swiper .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}"; |
| 14807 | styleInject(css_248z); | 15293 | styleInject(css_248z); |
| 14808 | 15294 | ||
| 14809 | jQuery(document).ready(function ($) { | 15295 | jQuery(document).ready(function ($) { |
| 14810 | var offset = (window.innerWidth - $('.entry-content').width()) / 2 - 28; | ||
| 14811 | jQuery('.carousel-items').each(function () { | 15296 | jQuery('.carousel-items').each(function () { |
| 15297 | var offset = (window.innerWidth - $('.entry-content').width()) / 2 - 28; | ||
| 15298 | var offsetAfter = 0; | ||
| 15299 | var PerView = 'auto'; | ||
| 15300 | var space = 20; | ||
| 15301 | |||
| 14812 | var _id = jQuery(this).parent().attr('id'); | 15302 | var _id = jQuery(this).parent().attr('id'); |
| 14813 | 15303 | ||
| 15304 | if (jQuery(this).hasClass('promo-carousel')) { | ||
| 15305 | offset = 0; | ||
| 15306 | PerView = 1; | ||
| 15307 | space = 0; | ||
| 15308 | offsetAfter = 0; | ||
| 15309 | _id = jQuery(this).attr('id'); | ||
| 15310 | } | ||
| 15311 | |||
| 14814 | var swiper_params = { | 15312 | var swiper_params = { |
| 14815 | modules: [Navigation, Pagination], | 15313 | modules: [Navigation, Pagination, A11y, Keyboard], |
| 14816 | slidesPerView: "auto", | 15314 | slidesPerView: PerView, |
| 15315 | slidesOffsetAfter: offsetAfter, | ||
| 14817 | slidesOffsetBefore: offset, | 15316 | slidesOffsetBefore: offset, |
| 14818 | spaceBetween: 25, | 15317 | spaceBetween: space, |
| 15318 | slidesPerGroup: 1, | ||
| 14819 | pagination: { | 15319 | pagination: { |
| 14820 | el: ".swiper-pagination", | 15320 | el: ".swiper-pagination", |
| 14821 | type: 'bullets' | 15321 | type: 'bullets', |
| 15322 | clickable: "true" | ||
| 14822 | }, | 15323 | }, |
| 14823 | // Navigation arrows | ||
| 14824 | navigation: { | 15324 | navigation: { |
| 14825 | nextEl: '.swiper-button-next[data-id="' + _id + '"]', | 15325 | nextEl: '.swiper-button-next[data-id="' + _id + '"]', |
| 14826 | prevEl: '.swiper-button-prev[data-id="' + _id + '"]' | 15326 | prevEl: '.swiper-button-prev[data-id="' + _id + '"]' |
| 15327 | }, | ||
| 15328 | a11y: { | ||
| 15329 | prevSlideMessage: 'Previous slide', | ||
| 15330 | nextSlideMessage: 'Next slide' | ||
| 15331 | }, | ||
| 15332 | keyboard: { | ||
| 15333 | enabled: true, | ||
| 15334 | onlyInViewport: false | ||
| 14827 | } | 15335 | } |
| 14828 | }; | 15336 | }; |
| 14829 | new Swiper(this, swiper_params); | 15337 | new Swiper(this, swiper_params); |
| 15338 | console.log(swiper_params); | ||
| 14830 | }); | 15339 | }); |
| 14831 | }); | 15340 | }); |
| 14832 | 15341 | ... | ... |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
| 1 | module.exports = { | 1 | module.exports = { |
| 2 | "proxy": "localhost/", | 2 | "proxy": "http://st-joes.test/", |
| 3 | "notify": false, | 3 | "notify": false, |
| 4 | "files": ["./css/*.min.css", "./js/*.min.js", "./**/*.php"] | 4 | "files": ["./css/*.min.css", "./js/*.min.js", "./**/*.php"] |
| 5 | }; | 5 | }; |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | import Swiper, { Navigation, Pagination } from 'swiper'; | 1 | import Swiper, { Navigation, Pagination, A11y, Keyboard } from 'swiper'; |
| 2 | import 'swiper/css'; | 2 | import 'swiper/css'; |
| 3 | import 'swiper/css/navigation'; | 3 | import 'swiper/css/navigation'; |
| 4 | import 'swiper/css/pagination'; | 4 | import 'swiper/css/pagination'; |
| 5 | 5 | import 'swiper/css/keyboard'; | |
| 6 | import 'swiper/css/a11y'; | ||
| 6 | 7 | ||
| 7 | jQuery(document).ready(function($) { | 8 | jQuery(document).ready(function($) { |
| 8 | 9 | ||
| 9 | 10 | ||
| 10 | var offset = ((window.innerWidth - $('.entry-content').width() ) / 2) - 28; | ||
| 11 | 11 | ||
| 12 | jQuery('.carousel-items').each(function() { | 12 | jQuery('.carousel-items').each(function() { |
| 13 | 13 | ||
| 14 | var offset = ((window.innerWidth - $('.entry-content').width() ) / 2) - 28; | ||
| 15 | var offsetAfter = 0; | ||
| 16 | var PerView = 'auto'; | ||
| 17 | var space = 20; | ||
| 18 | |||
| 14 | var _id = jQuery(this).parent().attr('id'); | 19 | var _id = jQuery(this).parent().attr('id'); |
| 15 | 20 | ||
| 16 | var swiper_params = { | 21 | if(jQuery(this).hasClass('promo-carousel')) { |
| 17 | modules: [Navigation, Pagination], | 22 | offset = 0; |
| 23 | PerView = 1; | ||
| 24 | space = 0; | ||
| 25 | offsetAfter = 0; | ||
| 26 | _id = jQuery(this).attr('id'); | ||
| 27 | } | ||
| 28 | |||
| 18 | 29 | ||
| 19 | slidesPerView:"auto", | ||
| 20 | slidesOffsetBefore:offset, | ||
| 21 | spaceBetween:25, | ||
| 22 | 30 | ||
| 31 | var swiper_params = { | ||
| 32 | modules: [Navigation, Pagination, A11y, Keyboard], | ||
| 33 | slidesPerView:PerView, | ||
| 34 | slidesOffsetAfter:offsetAfter, | ||
| 35 | slidesOffsetBefore:offset, | ||
| 36 | spaceBetween:space, | ||
| 37 | slidesPerGroup:1, | ||
| 23 | pagination: { | 38 | pagination: { |
| 24 | el: ".swiper-pagination", | 39 | el: ".swiper-pagination", |
| 25 | type: 'bullets', | 40 | type: 'bullets', |
| 41 | clickable:"true", | ||
| 26 | }, | 42 | }, |
| 27 | 43 | ||
| 28 | // Navigation arrows | ||
| 29 | navigation: { | 44 | navigation: { |
| 30 | nextEl: '.swiper-button-next[data-id="'+_id+'"]', | 45 | nextEl: '.swiper-button-next[data-id="'+_id+'"]', |
| 31 | prevEl: '.swiper-button-prev[data-id="'+_id+'"]', | 46 | prevEl: '.swiper-button-prev[data-id="'+_id+'"]', |
| 32 | }, | 47 | }, |
| 33 | 48 | ||
| 34 | }; | 49 | a11y: { |
| 50 | prevSlideMessage: 'Previous slide', | ||
| 51 | nextSlideMessage: 'Next slide', | ||
| 52 | }, | ||
| 53 | keyboard: { | ||
| 54 | enabled: true, | ||
| 55 | onlyInViewport: false, | ||
| 56 | }, | ||
| 35 | 57 | ||
| 58 | }; | ||
| 36 | 59 | ||
| 37 | 60 | ||
| 38 | new Swiper(this, swiper_params); | 61 | new Swiper(this, swiper_params); |
| 39 | 62 | console.log(swiper_params); | |
| 40 | 63 | ||
| 41 | }); | 64 | }); |
| 42 | 65 | ... | ... |
| ... | @@ -12,6 +12,7 @@ | ... | @@ -12,6 +12,7 @@ |
| 12 | @import "theme/header"; | 12 | @import "theme/header"; |
| 13 | @import "theme/footer"; | 13 | @import "theme/footer"; |
| 14 | @import "theme/carousel"; | 14 | @import "theme/carousel"; |
| 15 | @import "theme/accordion"; | ||
| 15 | 16 | ||
| 16 | @import "assets/understrap/theme/colors"; // <-------- This creates the necessary bootstrap color classes. | 17 | @import "assets/understrap/theme/colors"; // <-------- This creates the necessary bootstrap color classes. |
| 17 | @import "assets/understrap/theme/blocks"; // <-------- This adds Bootstrap styles to blocks. | 18 | @import "assets/understrap/theme/blocks"; // <-------- This adds Bootstrap styles to blocks. | ... | ... |
| 1 | .c-accordion__title:after{ | ||
| 2 | content: "\f343"; | ||
| 3 | font-family: "Font Awesome"; | ||
| 4 | right: unset; | ||
| 5 | left:0px; | ||
| 6 | } | ||
| 7 | |||
| 8 | .is-open>.c-accordion__title:after { | ||
| 9 | content: "\f077"; | ||
| 10 | font-family: "Font Awesome"; | ||
| 11 | } | ||
| 12 | |||
| 13 | .c-accordion__title{ | ||
| 14 | padding-left: 30px; | ||
| 15 | } | ||
| 16 | .c-accordion__content{ | ||
| 17 | padding-left: 30px; | ||
| 18 | } | ||
| 19 | .js-accordion-item{ | ||
| 20 | background: var(--unnamed-color-ffffff) 0% 0% no-repeat padding-box; | ||
| 21 | background: #FFFFFF 0% 0% no-repeat padding-box; | ||
| 22 | box-shadow: 0px 3px 6px #00000029; | ||
| 23 | border-radius: 10px; | ||
| 24 | padding: 15px 10px 8px 10px; | ||
| 25 | margin-bottom: 20px; | ||
| 26 | h3{ | ||
| 27 | margin-top: 0px !important; | ||
| 28 | } | ||
| 29 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -30,14 +30,6 @@ | ... | @@ -30,14 +30,6 @@ |
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | .carousel { | 32 | .carousel { |
| 33 | .carousel-items { | ||
| 34 | margin-left:1.75rem; | ||
| 35 | } | ||
| 36 | .swiper-wrapper { | ||
| 37 | gap: 1rem; | ||
| 38 | } | ||
| 39 | |||
| 40 | |||
| 41 | width:100vw; | 33 | width:100vw; |
| 42 | margin-left:calc((100% - 100vw) / 2); | 34 | margin-left:calc((100% - 100vw) / 2); |
| 43 | left:0 !important; | 35 | left:0 !important; |
| ... | @@ -51,6 +43,12 @@ | ... | @@ -51,6 +43,12 @@ |
| 51 | .swiper-pagination{ | 43 | .swiper-pagination{ |
| 52 | bottom: -20px !important; | 44 | bottom: -20px !important; |
| 53 | } | 45 | } |
| 46 | .carousel-items { | ||
| 47 | margin-left:1.75rem; | ||
| 48 | } | ||
| 49 | .swiper-wrapper { | ||
| 50 | gap: 1rem; | ||
| 51 | } | ||
| 54 | } | 52 | } |
| 55 | 53 | ||
| 56 | // testimonials carousel css | 54 | // testimonials carousel css |
| ... | @@ -61,7 +59,7 @@ | ... | @@ -61,7 +59,7 @@ |
| 61 | .testimonials{ | 59 | .testimonials{ |
| 62 | width:890px; | 60 | width:890px; |
| 63 | background:#E5F2F8; | 61 | background:#E5F2F8; |
| 64 | border-radius: 8px 8px 0px 0px; | 62 | border-radius: 25px 25px 0px 0px; |
| 65 | margin-right: 20px; | 63 | margin-right: 20px; |
| 66 | .row{ | 64 | .row{ |
| 67 | margin-right: 0rem !important; | 65 | margin-right: 0rem !important; |
| ... | @@ -96,6 +94,9 @@ | ... | @@ -96,6 +94,9 @@ |
| 96 | border-bottom:20px solid #3F9C35; | 94 | border-bottom:20px solid #3F9C35; |
| 97 | } | 95 | } |
| 98 | } | 96 | } |
| 97 | .promo-img img{ | ||
| 98 | border-bottom:20px solid #3F9C35; | ||
| 99 | } | ||
| 99 | } | 100 | } |
| 100 | .swiper-slide:nth-of-type(3){ | 101 | .swiper-slide:nth-of-type(3){ |
| 101 | .testimonials{ | 102 | .testimonials{ |
| ... | @@ -103,6 +104,9 @@ | ... | @@ -103,6 +104,9 @@ |
| 103 | border-bottom:20px solid #0484B8; | 104 | border-bottom:20px solid #0484B8; |
| 104 | } | 105 | } |
| 105 | } | 106 | } |
| 107 | .promo-img img{ | ||
| 108 | border-bottom:20px solid #0484B8; | ||
| 109 | } | ||
| 106 | } | 110 | } |
| 107 | .swiper-slide:nth-of-type(4){ | 111 | .swiper-slide:nth-of-type(4){ |
| 108 | .testimonials{ | 112 | .testimonials{ |
| ... | @@ -110,9 +114,80 @@ | ... | @@ -110,9 +114,80 @@ |
| 110 | border-bottom:20px solid #E04E39; | 114 | border-bottom:20px solid #E04E39; |
| 111 | } | 115 | } |
| 112 | } | 116 | } |
| 117 | .promo-img img{ | ||
| 118 | border-bottom:20px solid #E04E39; | ||
| 119 | } | ||
| 113 | } | 120 | } |
| 114 | 121 | ||
| 115 | 122 | ||
| 116 | 123 | ||
| 117 | 124 | ||
| 118 | } | 125 | } |
| 126 | |||
| 127 | |||
| 128 | .promo-carousel{ | ||
| 129 | width:100% !important; | ||
| 130 | margin-left:0px !important; | ||
| 131 | position: relative; | ||
| 132 | @media only screen and (min-width:1400px) { | ||
| 133 | max-width: 100% !important; | ||
| 134 | } | ||
| 135 | .swiper-slide{ | ||
| 136 | margin-left:0px !important; | ||
| 137 | max-width: 100% !important; | ||
| 138 | @media only screen and (min-width:1400px) { | ||
| 139 | width:100% !important; | ||
| 140 | } | ||
| 141 | .promo-img{ | ||
| 142 | max-height: 264px; | ||
| 143 | max-width: 372px; | ||
| 144 | overflow: hidden; | ||
| 145 | border-bottom:20px solid #FFA300; | ||
| 146 | } | ||
| 147 | .promo-img img{ | ||
| 148 | max-width: 372px; | ||
| 149 | border-radius: 25px 25px 0px 0px; | ||
| 150 | |||
| 151 | } | ||
| 152 | .promo.row{ | ||
| 153 | width:100%; | ||
| 154 | border-top:1px solid #FFA300; | ||
| 155 | border-bottom:1px solid #FFA300; | ||
| 156 | @media only screen and (min-width:1400px) { | ||
| 157 | max-width: 1344px; | ||
| 158 | } | ||
| 159 | @media only screen and (max-width: 600px) { | ||
| 160 | width:80%; | ||
| 161 | } | ||
| 162 | margin: 75px auto; | ||
| 163 | padding: 56px 0px; | ||
| 164 | |||
| 165 | } | ||
| 166 | } | ||
| 167 | .swiper-button-next { | ||
| 168 | right:30px !important; | ||
| 169 | } | ||
| 170 | .swiper-button-prev { | ||
| 171 | left:7px !important; | ||
| 172 | } | ||
| 173 | .swiper-pagination{ | ||
| 174 | bottom: 95px !important; | ||
| 175 | } | ||
| 176 | |||
| 177 | |||
| 178 | .swiper-slide:nth-of-type(2){ | ||
| 179 | .promo-img { | ||
| 180 | border-bottom:20px solid #3F9C35; | ||
| 181 | } | ||
| 182 | } | ||
| 183 | .swiper-slide:nth-of-type(3){ | ||
| 184 | .promo-img { | ||
| 185 | border-bottom:20px solid #0484B8; | ||
| 186 | } | ||
| 187 | } | ||
| 188 | .swiper-slide:nth-of-type(4){ | ||
| 189 | .promo-img { | ||
| 190 | border-bottom:20px solid #E04E39; | ||
| 191 | } | ||
| 192 | } | ||
| 193 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -4,11 +4,11 @@ h1{ | ... | @@ -4,11 +4,11 @@ h1{ |
| 4 | } | 4 | } |
| 5 | 5 | ||
| 6 | h2{ | 6 | h2{ |
| 7 | text-align: center; | 7 | |
| 8 | color: #0484B8; | 8 | color: #0484B8; |
| 9 | font-size: 40px; | 9 | font-size: 40px; |
| 10 | line-height: 49px; | 10 | line-height: 49px; |
| 11 | margin-bottom: 40px; | 11 | margin-bottom: 20px; |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | h3{ | 14 | h3{ |
| ... | @@ -17,6 +17,14 @@ h3{ | ... | @@ -17,6 +17,14 @@ h3{ |
| 17 | line-height: 32px; | 17 | line-height: 32px; |
| 18 | margin-top: 20px; | 18 | margin-top: 20px; |
| 19 | } | 19 | } |
| 20 | a{ | ||
| 21 | color:#2C2C2C; | ||
| 22 | } | ||
| 23 | |||
| 24 | div#full-width-page-wrapper { | ||
| 25 | padding-bottom: 0px; | ||
| 26 | } | ||
| 27 | |||
| 20 | 28 | ||
| 21 | input[type=text],input[type=email]{ | 29 | input[type=text],input[type=email]{ |
| 22 | border-radius: 0px !important; | 30 | border-radius: 0px !important; |
| ... | @@ -65,9 +73,12 @@ input[type=checkbox] | ... | @@ -65,9 +73,12 @@ input[type=checkbox] |
| 65 | } | 73 | } |
| 66 | } | 74 | } |
| 67 | } | 75 | } |
| 68 | 76 | .wpcf7{ | |
| 69 | #wpcf7-f115-p18-o1{ | 77 | max-width: 100% !important; |
| 78 | .contact-form{ | ||
| 79 | padding-top: 40px; | ||
| 70 | max-width: 80% !important; | 80 | max-width: 80% !important; |
| 81 | margin: auto; | ||
| 71 | input[type=text],input[type=email],textarea{ | 82 | input[type=text],input[type=email],textarea{ |
| 72 | background-color: #E5F2F8; | 83 | background-color: #E5F2F8; |
| 73 | } | 84 | } |
| ... | @@ -83,6 +94,21 @@ input[type=checkbox] | ... | @@ -83,6 +94,21 @@ input[type=checkbox] |
| 83 | color: #fff; | 94 | color: #fff; |
| 84 | text-transform: uppercase; | 95 | text-transform: uppercase; |
| 85 | display: block; | 96 | display: block; |
| 97 | font-size: 18px; | ||
| 86 | 98 | ||
| 87 | } | 99 | } |
| 100 | } | ||
| 101 | } | ||
| 102 | |||
| 103 | .no-bullets{ | ||
| 104 | list-style: none; | ||
| 105 | margin-block-start: 0em; | ||
| 106 | padding-inline-start: 0px; | ||
| 107 | li{ | ||
| 108 | margin-bottom: 10px; | ||
| 109 | } | ||
| 110 | } | ||
| 111 | |||
| 112 | .wp-block-image.is-style-rounded img{ | ||
| 113 | border-radius: 25px; | ||
| 88 | } | 114 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -41,7 +41,7 @@ | ... | @@ -41,7 +41,7 @@ |
| 41 | .newsletter{ | 41 | .newsletter{ |
| 42 | background-color: #6ED5FF; | 42 | background-color: #6ED5FF; |
| 43 | min-height: 236px; | 43 | min-height: 236px; |
| 44 | padding-top: 52px; | 44 | padding: 52px 0px 32px 0px; |
| 45 | h2{ | 45 | h2{ |
| 46 | font-size: 18px; | 46 | font-size: 18px; |
| 47 | line-height: 24px; | 47 | line-height: 24px; | ... | ... |
| ... | @@ -151,11 +151,11 @@ | ... | @@ -151,11 +151,11 @@ |
| 151 | background-position: center; | 151 | background-position: center; |
| 152 | background-repeat: no-repeat; | 152 | background-repeat: no-repeat; |
| 153 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23.024' height='23.545' viewBox='0 0 23.024 23.545'%3E%3Cg id='Group_1373' data-name='Group 1373' transform='translate(0 1.5)'%3E%3Cline id='Line_15' data-name='Line 15' y1='15.007' transform='translate(11.512 7.038)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath id='Path_1388' data-name='Path 1388' d='M3331.593 12517.547h23.024' transform='translate(-3331.593 -12517.547)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath id='Path_1389' data-name='Path 1389' d='M3279.832 12508.2l8.216-8.217 8.216 8.217' transform='translate(-3276.535 -12494.895)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E"); | 153 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23.024' height='23.545' viewBox='0 0 23.024 23.545'%3E%3Cg id='Group_1373' data-name='Group 1373' transform='translate(0 1.5)'%3E%3Cline id='Line_15' data-name='Line 15' y1='15.007' transform='translate(11.512 7.038)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath id='Path_1388' data-name='Path 1388' d='M3331.593 12517.547h23.024' transform='translate(-3331.593 -12517.547)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath id='Path_1389' data-name='Path 1389' d='M3279.832 12508.2l8.216-8.217 8.216 8.217' transform='translate(-3276.535 -12494.895)' fill='none' stroke='%23fff' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E"); |
| 154 | 154 | z-index: 999; | |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | #btn-back-to-top:hover{ | 157 | #btn-back-to-top:hover{ |
| 158 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23.024' height='23.545' viewBox='0 0 23.024 23.545'%3E%3Cg id='Group_1373' data-name='Group 1373' transform='translate(0 1.5)'%3E%3Cline id='Line_15' data-name='Line 15' y1='15.007' transform='translate(11.512 7.038)' fill='none' stroke='%232C2C2C' stroke-width='3'/%3E%3Cpath id='Path_1388' data-name='Path 1388' d='M3331.593 12517.547h23.024' transform='translate(-3331.593 -12517.547)' fill='none' stroke='%232C2C2C' stroke-width='3'/%3E%3Cpath id='Path_1389' data-name='Path 1389' d='M3279.832 12508.2l8.216-8.217 8.216 8.217' transform='translate(-3276.535 -12494.895)' fill='none' stroke='%2C2C2C' stroke-width='3'/%3E%3C/g%3E%3C/svg%3E"); | 158 | |
| 159 | background-color:#fff; | 159 | background-color:#000; |
| 160 | 160 | ||
| 161 | } | 161 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment