card_open() etc. * * @package Admbud */ if ( ! defined( 'ABSPATH' ) ) { exit; } // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Variables scoped to this included template file. use Admbud\Colours; /** @var \Admbud\Settings $settings */ $logo_url = esc_url( admbud_get_option( 'admbud_login_logo_url', '' ) ); $logo_width = absint( admbud_get_option( 'admbud_login_logo_width', 84 ) ); $logo_height = absint( admbud_get_option( 'admbud_login_logo_height', 0 ) ); $card_position = admbud_get_option( 'admbud_login_card_position', 'center' ); $bg_type = admbud_get_option( 'admbud_login_bg_type', 'solid' ); $bg_color = esc_attr( admbud_get_option( 'admbud_login_bg_color', Colours::DEFAULT_PAGE_BG ) ); $grad_from = esc_attr( admbud_get_option( 'admbud_login_grad_from', Colours::DEFAULT_SIDEBAR_GRAD_FROM ) ); $grad_to = esc_attr( admbud_get_option( 'admbud_login_grad_to', Colours::DEFAULT_SIDEBAR_GRAD_TO ) ); $grad_dir = admbud_get_option( 'admbud_login_grad_direction', 'to bottom right' ); $bg_image = esc_url( admbud_get_option( 'admbud_login_bg_image_url', '' ) ); $overlay_color = esc_attr( admbud_get_option( 'admbud_login_bg_overlay_color', '#000000' ) ); $overlay_op = absint( admbud_get_option( 'admbud_login_bg_overlay_opacity', 30 ) ); $card_bg_color = esc_attr( admbud_get_option( 'admbud_login_card_bg_color', '#ffffff' ) ); $card_text_auto = admbud_get_option( 'admbud_login_card_text_auto', '1' ); $card_text_color= esc_attr( admbud_get_option( 'admbud_login_card_text_color', '#3c434a' ) ); $card_width = absint( admbud_get_option( 'admbud_login_card_width', 400 ) ); $btn_auto = admbud_get_option( 'admbud_login_btn_auto', '1' ); $btn_bg = esc_attr( admbud_get_option( 'admbud_login_btn_bg', '#2271b1' ) ); $directions = [ 'to top left' => '↖', 'to top' => '↑', 'to top right' => '↗', 'to left' => '←', 'to right' => '→', 'to bottom left' => '↙', 'to bottom' => '↓', 'to bottom right' => '↘', ]; $grid_order = [ 'to top left', 'to top', 'to top right', 'to left', null, 'to right', 'to bottom left', 'to bottom', 'to bottom right', ]; $positions = [ 'left' => [ 'icon' => '⬅', 'label' => __( 'Left', 'admin-buddy' ) ], 'center' => [ 'icon' => '↔', 'label' => __( 'Center', 'admin-buddy' ) ], 'right' => [ 'icon' => '➡', 'label' => __( 'Right', 'admin-buddy' ) ], ]; $hs = $bg_type !== 'solid' ? 'ab-hidden' : ''; $hg = $bg_type !== 'gradient' ? 'ab-hidden' : ''; $hi = $bg_type !== 'image' ? 'ab-hidden' : ''; // Colours module OFF: the login page follows the WP admin colour // scheme. Mirror that in the preview - the background override is // skipped when an explicit image is set (still honoured on the live // page), but the button / logo accent follows the scheme either way. $colours_off = ! \Admbud\Settings::colours_module_active(); $login_scheme_active = ( $colours_off && ! ( $bg_type === 'image' && $bg_image ) ); $login_scheme_bg = ''; if ( $login_scheme_active ) { $login_pal = \Admbud\Settings::scheme_page_palette(); $login_scheme_bg = 'linear-gradient(to bottom right, ' . $login_pal['grad_from'] . ', ' . $login_pal['grad_to'] . ')'; } // Preview accent for the mock Log In button + default WP logo mark: // the WP admin scheme accent when Colours is off (class-colours.php's // inject_login_css() isn't running), the brand primary when it is. $preview_accent = $colours_off ? \Admbud\Settings::scheme_accent_hex() : admbud_get_option( 'admbud_colours_primary', '#7c3aed' ); $preview_btn_bg = esc_attr( $preview_accent ); ?>