ru-se.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

bottom-arrow.php (9103B)


      1 <?php
      2 
      3 
      4 add_action("materialis_header_background_overlay_settings", "materialis_front_page_header_bottom_arrow_settings", 1, 5);
      5 
      6 function materialis_front_page_header_bottom_arrow_settings($section, $prefix, $group, $inner, $priority)
      7 {
      8 
      9     if ($inner) return;
     10 
     11     $priority = 5;
     12 
     13     $prefix   = $inner ? "inner_header_" : "header_";
     14     $section  = "header_background_chooser";
     15 
     16     $group = "{$prefix}bottom_arrow_options_group_button";
     17 
     18     materialis_add_kirki_field(array(
     19         'priority' => $priority,
     20         'type'     => 'checkbox',
     21         'settings' => 'header_show_bottom_arrow',
     22         'label'    => esc_html__('Use Bottom Arrow', 'materialis'),
     23         'section'  => $section,
     24         'default'  => false
     25     ));
     26 
     27      materialis_add_kirki_field(array(
     28         'type'            => 'sidebar-button-group',
     29         'settings'        => $group,
     30         'label'           => esc_html__('Options', 'materialis'),
     31         'section'         => $section,
     32         'priority'        => $priority,
     33         'active_callback' => array(
     34             array(
     35                 'setting'  => 'header_show_bottom_arrow',
     36                 'operator' => '==',
     37                 'value'    => true,
     38             ),
     39         ),
     40         'in_row_with' => array('header_show_bottom_arrow')
     41     ));
     42 
     43     materialis_add_kirki_field(array(
     44         'type'            => 'checkbox',
     45         'settings'        => 'header_bounce_bottom_arrow',
     46         'label'           => esc_html__('Bounce arrow', 'materialis'),
     47         'section'         => $section,
     48         'default'         => true,
     49         'priority'        => $priority,
     50         'active_callback' => array(
     51             array(
     52                 'setting'  => 'header_show_bottom_arrow',
     53                 'operator' => '==',
     54                 'value'    => true,
     55             ),
     56         ),
     57         'group' => $group
     58     ));
     59 
     60     materialis_add_kirki_field(array(
     61         'priority' => $priority,
     62 
     63         'type'            => 'material-icons-icon-control',
     64         'settings'        => 'header_bottom_arrow',
     65         'label'           => esc_html__('Icon', 'materialis'),
     66         'section'         => $section,
     67         'default'         => "mdi-arrow-down-bold-circle",
     68         'active_callback' => array(
     69             array(
     70                 'setting'  => 'header_show_bottom_arrow',
     71                 'operator' => '==',
     72                 'value'    => true,
     73             ),
     74         ),
     75         'group' => $group
     76     ));
     77 
     78     materialis_add_kirki_field(array(
     79         'priority' => $priority,
     80 
     81         'type'            => 'slider',
     82         'settings'        => 'header_size_bottom_arrow',
     83         'label'           => esc_html__('Icon Size', 'materialis'),
     84         'section'         => $section,
     85         'default'         => "50",
     86         'choices'         => array(
     87             'min'  => '10',
     88             'max'  => '100',
     89             'step' => '1',
     90         ),
     91         "output"          => array(
     92             array(
     93                 'element'  => '.header-homepage-arrow',
     94                 'property' => 'font-size',
     95                 'suffix'   => 'px !important',
     96             ),
     97             array(
     98                 'element'  => '.header-homepage-arrow > i',
     99                 'property' => 'width',
    100                 'suffix'   => 'px',
    101             ),
    102             array(
    103                 'element'  => '.header-homepage-arrow > i',
    104                 'property' => 'height',
    105                 'suffix'   => 'px',
    106             ),
    107         ),
    108         'transport'       => 'postMessage',
    109         'js_vars'         => array(
    110             array(
    111                 'element'  => '.header-homepage-arrow',
    112                 'function' => 'css',
    113                 'property' => 'font-size',
    114                 'suffix'   => 'px !important',
    115             ),
    116             array(
    117                 'element'  => '.header-homepage-arrow > i',
    118                 'function' => 'css',
    119                 'property' => 'width',
    120                 'suffix'   => 'px',
    121             ),
    122             array(
    123                 'element'  => '.header-homepage-arrow > i',
    124                 'function' => 'css',
    125                 'property' => 'height',
    126                 'suffix'   => 'px',
    127             ),
    128         ),
    129         'active_callback' => array(
    130             array(
    131                 'setting'  => 'header_show_bottom_arrow',
    132                 'operator' => '==',
    133                 'value'    => true,
    134             ),
    135         ),
    136         'active_callback' => array(
    137             array(
    138                 'setting'  => 'header_show_bottom_arrow',
    139                 'operator' => '==',
    140                 'value'    => true,
    141             ),
    142         ),
    143         'group' => $group
    144     ));
    145 
    146 
    147     materialis_add_kirki_field(array(
    148         'priority' => $priority,
    149 
    150         'type'            => 'slider',
    151         'settings'        => 'header_offset_bottom_arrow',
    152         'label'           => esc_html__('Icon Bottom Offset', 'materialis'),
    153         'section'         => $section,
    154         'default'         => "20",
    155         'choices'         => array(
    156             'min'  => '0',
    157             'max'  => '200',
    158             'step' => '1',
    159         ),
    160         "output"          => array(
    161             array(
    162                 'element'  => '.header-homepage-arrow',
    163                 'property' => 'bottom',
    164                 'suffix'   => 'px !important',
    165             ),
    166         ),
    167         'transport'       => 'postMessage',
    168         'js_vars'         => array(
    169             array(
    170                 'element'  => '.header-homepage-arrow',
    171                 'function' => 'css',
    172                 'property' => 'bottom',
    173                 'suffix'   => 'px !important',
    174             ),
    175         ),
    176         'active_callback' => array(
    177             array(
    178                 'setting'  => 'header_show_bottom_arrow',
    179                 'operator' => '==',
    180                 'value'    => true,
    181             ),
    182         ),
    183         'active_callback' => array(
    184             array(
    185                 'setting'  => 'header_show_bottom_arrow',
    186                 'operator' => '==',
    187                 'value'    => true,
    188             ),
    189         ),
    190         'group' => $group
    191     ));
    192 
    193     materialis_add_kirki_field(array(
    194         'priority' => $priority,
    195 
    196         'type'            => 'color',
    197         'settings'        => 'header_color_bottom_arrow',
    198         'label'           => esc_html__('Icon Color', 'materialis'),
    199         'section'         => $section,
    200         'default'         => "#ffffff",
    201         'choices'         => array(
    202             'alpha' => true,
    203         ),
    204         "output"          => array(
    205             array(
    206                 'element'  => '.header-homepage-arrow > i',
    207                 'property' => 'color',
    208             ),
    209         ),
    210         'transport'       => 'postMessage',
    211         'js_vars'         => array(
    212             array(
    213                 'element'  => '.header-homepage-arrow > i',
    214                 'function' => 'css',
    215                 'property' => 'color',
    216                 'suffix'   => ' !important',
    217             ),
    218         ),
    219         'active_callback' => array(
    220             array(
    221                 'setting'  => 'header_show_bottom_arrow',
    222                 'operator' => '==',
    223                 'value'    => true,
    224             ),
    225         ),
    226         'group' => $group
    227     ));
    228 
    229     materialis_add_kirki_field(array(
    230         'priority'        => $priority,
    231         'type'            => 'color',
    232         'settings'        => 'header_background_bottom_arrow',
    233         'label'           => esc_html__('Icon Background Color', 'materialis'),
    234         'section'         => $section,
    235         'default'         => "rgba(255,255,255,0)",
    236         'choices'         => array(
    237             'alpha' => true,
    238         ),
    239         "output"          => array(
    240             array(
    241                 'element'  => '.header-homepage-arrow',
    242                 'property' => 'background',
    243             ),
    244         ),
    245         'transport'       => 'postMessage',
    246         'js_vars'         => array(
    247             array(
    248                 'element'  => '.header-homepage-arrow',
    249                 'function' => 'css',
    250                 'property' => 'background',
    251                 'suffix'   => ' !important',
    252             ),
    253         ),
    254         'active_callback' => array(
    255             array(
    256                 'setting'  => 'header_show_bottom_arrow',
    257                 'operator' => '==',
    258                 'value'    => true,
    259             ),
    260         ),
    261         'group' => $group
    262     ));
    263 
    264 }
    265 
    266 
    267 function materialis_header_bottom_arrow()
    268 {
    269     $show   = materialis_get_theme_mod('header_show_bottom_arrow', false);
    270     $bounce = materialis_get_theme_mod('header_bounce_bottom_arrow', true);
    271 
    272     $class = "header-homepage-arrow ";
    273 
    274     if ($bounce) {
    275         $class .= "move-down-bounce";
    276     }
    277 
    278     if ($show) {
    279         $icon = materialis_get_theme_mod('header_bottom_arrow', "mdi-arrow-down-bold-circle");
    280         ?>
    281         <div class="header-homepage-arrow-c">
    282             <span class="<?php echo esc_attr($class); ?>"> <i class="mdi arrow <?php echo esc_attr($icon); ?>" aria-hidden="true"></i>
    283             </span>
    284         </div>
    285         <?php
    286     }
    287 }
    288 
    289 add_action('materialis_after_header_content', 'materialis_header_bottom_arrow');