Changeset 3458213
- Timestamp:
- 02/10/2026 04:05:25 PM (12 days ago)
- Location:
- a1-tools/trunk
- Files:
-
- 3 edited
-
a1-tools.php (modified) (3 diffs)
-
includes/class-a1-tools-elementor-widget.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
a1-tools/trunk/a1-tools.php
r3458205 r3458213 4 4 * Plugin URI: https://tools.a-1chimney.com 5 5 * Description: Connects your WordPress site to the A1 Tools platform for centralized management of contact information, social media links, and business details. 6 * Version: 1.4. 86 * Version: 1.4.9 7 7 * Requires at least: 5.0 8 8 * Requires PHP: 7.4 … … 21 21 22 22 // Plugin constants. 23 define( 'A1TOOLS_VERSION', '1.4. 8' );23 define( 'A1TOOLS_VERSION', '1.4.9' ); 24 24 define( 'A1TOOLS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 25 25 define( 'A1TOOLS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); … … 1012 1012 } 1013 1013 add_action( 'elementor/widgets/register', 'a1tools_register_elementor_widgets' ); 1014 1015 /** 1016 * Register Elementor widget styles. 1017 * 1018 * Registers the base CSS for the A1 Social Icons Elementor widget as an inline 1019 * stylesheet so it loads once and works in both frontend and editor. 1020 * 1021 * @since 1.4.8 1022 * @return void 1023 */ 1024 function a1tools_register_elementor_styles() { 1025 $css = ' 1026 .a1tools-social-icons-styled { 1027 font-size: 0; 1028 } 1029 .a1tools-social-icons-styled .a1tools-social-icon { 1030 display: inline-flex; 1031 align-items: center; 1032 justify-content: center; 1033 vertical-align: middle; 1034 text-decoration: none !important; 1035 transition: all 0.3s ease; 1036 box-sizing: border-box; 1037 } 1038 .a1tools-social-icons-styled .a1tools-social-icon i { 1039 color: inherit; 1040 line-height: 1; 1041 } 1042 /* Style presets for non-custom styles */ 1043 .a1tools-style-default .a1tools-social-icon, 1044 .a1tools-style-official .a1tools-social-icon { color: #fff; } 1045 .a1tools-style-default .a1tools-social-icon i, 1046 .a1tools-style-official .a1tools-social-icon i { color: #fff; } 1047 .a1tools-style-outline .a1tools-social-icon { background: transparent; border: 2px solid; } 1048 .a1tools-style-minimal .a1tools-social-icon { background: transparent; } 1049 .a1tools-style-light .a1tools-social-icon { background: #f5f5f5; } 1050 .a1tools-style-dark .a1tools-social-icon { background: #333; color: #fff; } 1051 .a1tools-style-dark .a1tools-social-icon i { color: #fff; } 1052 /* Hover effects via prefix_class */ 1053 .a1tools-hover-scale .a1tools-social-icon:hover { transform: scale(1.1); } 1054 .a1tools-hover-lift .a1tools-social-icon:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); } 1055 .a1tools-hover-rotate .a1tools-social-icon:hover { transform: rotate(15deg); } 1056 .a1tools-hover-pulse .a1tools-social-icon:hover { animation: a1tools-pulse 0.5s ease; } 1057 @keyframes a1tools-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } } 1058 '; 1059 1060 wp_register_style( 'a1tools-elementor-icons', false, array(), A1TOOLS_VERSION ); 1061 wp_enqueue_style( 'a1tools-elementor-icons' ); 1062 wp_add_inline_style( 'a1tools-elementor-icons', $css ); 1063 } 1064 add_action( 'wp_enqueue_scripts', 'a1tools_register_elementor_styles' ); 1065 add_action( 'elementor/editor/before_enqueue_styles', 'a1tools_register_elementor_styles' ); 1066 add_action( 'elementor/preview/enqueue_styles', 'a1tools_register_elementor_styles' ); 1014 1067 1015 1068 // ============================================================================ -
a1-tools/trunk/includes/class-a1-tools-elementor-widget.php
r3458205 r3458213 452 452 453 453 /** 454 * Get style dependencies for this widget. 455 */ 456 public function get_style_depends() { 457 return array( 'a1tools-elementor-icons' ); 458 } 459 460 /** 454 461 * Render widget output on the frontend. 455 462 * … … 468 475 $style = ! empty( $settings['icon_style'] ) ? $settings['icon_style'] : 'default'; 469 476 470 // Base CSS for all styles (layout only - colors handled by selectors or inline) 471 $base_css = '.a1tools-social-icons-styled { line-height: 0; }'; 472 $base_css .= '.a1tools-social-icons-styled .a1tools-social-icon { '; 473 $base_css .= 'display: inline-flex; align-items: center; justify-content: center;'; 474 $base_css .= 'vertical-align: middle; text-decoration: none !important;'; 475 $base_css .= 'transition: all 0.3s ease; box-sizing: border-box;'; 476 $base_css .= '}'; 477 $base_css .= '.a1tools-social-icons-styled .a1tools-social-icon i { '; 478 $base_css .= 'color: inherit; line-height: 1;'; 479 $base_css .= '}'; 480 481 // Hover effect CSS (using prefix_class a1tools-hover-*) 482 $base_css .= '.a1tools-hover-scale .a1tools-social-icon:hover { transform: scale(1.1); }'; 483 $base_css .= '.a1tools-hover-lift .a1tools-social-icon:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }'; 484 $base_css .= '.a1tools-hover-rotate .a1tools-social-icon:hover { transform: rotate(15deg); }'; 485 $base_css .= '.a1tools-hover-pulse .a1tools-social-icon:hover { animation: a1tools-pulse 0.5s ease; }'; 486 $base_css .= '@keyframes a1tools-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }'; 487 488 // Style-specific base CSS for non-custom styles 489 if ( 'default' === $style || 'official' === $style ) { 490 $base_css .= '.a1tools-social-icons-styled .a1tools-social-icon { color: #fff; }'; 491 $base_css .= '.a1tools-social-icons-styled .a1tools-social-icon i { color: #fff; }'; 492 } elseif ( 'outline' === $style ) { 493 $base_css .= '.a1tools-social-icons-styled .a1tools-social-icon { background: transparent; border: 2px solid; }'; 494 } elseif ( 'minimal' === $style ) { 495 $base_css .= '.a1tools-social-icons-styled .a1tools-social-icon { background: transparent; }'; 496 } elseif ( 'light' === $style ) { 497 $base_css .= '.a1tools-social-icons-styled .a1tools-social-icon { background: #f5f5f5; }'; 498 } elseif ( 'dark' === $style ) { 499 $base_css .= '.a1tools-social-icons-styled .a1tools-social-icon { background: #333; color: #fff; }'; 500 $base_css .= '.a1tools-social-icons-styled .a1tools-social-icon i { color: #fff; }'; 501 } 502 503 // Output base CSS once 504 echo '<style>' . $base_css . '</style>'; 505 506 // Output HTML 507 echo '<div class="a1tools-social-icons-styled">'; 477 // Output HTML - add style class for non-custom per-platform color targeting 478 echo '<div class="a1tools-social-icons-styled a1tools-style-' . esc_attr( $style ) . '">'; 508 479 509 480 foreach ( $platforms as $key => $data ) { … … 577 548 var platforms = <?php echo wp_json_encode( $js_platforms ); ?>; 578 549 #> 579 <div class="a1tools-social-icons-styled ">550 <div class="a1tools-social-icons-styled a1tools-style-{{ style }}"> 580 551 <# _.each(platforms, function(platform) { 581 552 var inlineStyle = ''; -
a1-tools/trunk/readme.txt
r3458205 r3458213 4 4 Requires at least: 5.0 5 5 Tested up to: 6.9 6 Stable tag: 1.4. 86 Stable tag: 1.4.9 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 151 151 152 152 == Changelog == 153 154 = 1.4.9 = 155 * Fixed icons being pushed upwards in their container 156 * Moved base CSS to properly enqueued stylesheet (loads once, works in editor and frontend) 157 * Removed inline style block from widget render for cleaner output 158 * Added style-class approach for non-custom style presets 153 159 154 160 = 1.4.8 =
Note: See TracChangeset
for help on using the changeset viewer.