Skip to content

Commit

Permalink
Merge branch 'master' into feature/apply-kit
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoladj77 authored Oct 27, 2024
2 parents e9777d2 + 340a090 commit 52aa109
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 67 deletions.
22 changes: 18 additions & 4 deletions modules/content/assets/scss/hello-plus-cta.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,18 @@
--cta-button-icon-spacing: var(--cta-button-primary-icon-spacing);
--cta-button-icon-size: var(--cta-button-primary-icon-size);

--cta-box-padding-block-end: 60px;
--cta-box-padding-block-start: 60px;
--cta-box-padding-inline-end: 60px;
--cta-box-padding-inline-start: 60px;

display: flex;
justify-content: center;
height: var(--cta-box-height);
padding-block-end: var(--cta-box-padding-block-end);
padding-block-start: var(--cta-box-padding-block-start);
padding-inline-end: var(--cta-box-padding-inline-end);
padding-inline-start: var(--cta-box-padding-inline-start);

@media screen and (min-width: $screen-tablet-min) {
--cta-text-default-heading: 512px;
Expand Down Expand Up @@ -144,12 +153,16 @@

&__ctas-container {
flex-grow: 1;
}

&__buttons-wrapper {
display: flex;
flex-direction: column;
gap: var(--cta-buttons-space-between);
flex-direction: column;
justify-content: center;

@media screen and (min-width: $screen-tablet-min) {
align-items: center;
flex-direction: row;
justify-content: flex-start;
}
Expand Down Expand Up @@ -226,6 +239,7 @@

&-link,
&-link:not([href]):not([tabindex]) {
align-self: center;
text-decoration: underline;
}

Expand Down Expand Up @@ -280,7 +294,7 @@

&-center {

.ehp-cta__ctas-container {
.ehp-cta__buttons-wrapper {
justify-content: center;
}
}
Expand All @@ -301,7 +315,7 @@
flex-direction: row;
}

.ehp-cta__ctas-container {
.ehp-cta__buttons-wrapper {
align-items: var(--cta-buttons-position);
justify-content: flex-end;
}
Expand Down
15 changes: 1 addition & 14 deletions modules/content/assets/scss/hello-plus-zigzag.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,6 @@
&.is-graphic-icon {
width: calc(100% - var(--zigzag-icon-width));
}

.row-even & {

@media screen and (min-width: $screen-tablet-min) {
padding-inline-end: var(--zigzag-elements-gap);
}
}

.row-odd & {

@media screen and (min-width: $screen-tablet-min) {
padding-inline-start: var(--zigzag-elements-gap);
}
}
}

&__title {
Expand Down Expand Up @@ -200,6 +186,7 @@

&__item-container {
display: flex;
gap: var(--zigzag-elements-gap);
padding-block: calc(var(--zigzag-rows-spacing) / 2);
max-width: var(--zigzag-content-width);
width: 100%;
Expand Down
14 changes: 8 additions & 6 deletions modules/content/classes/render/widget-cta-render.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ protected function render_ctas_container() {
] );
?>
<div <?php echo $this->widget->get_render_attribute_string( 'ctas-container' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php if ( $has_primary_button ) {
$this->render_button( 'primary' );
} ?>
<?php if ( $has_secondary_button ) {
$this->render_button( 'secondary' );
} ?>
<div class="ehp-cta__buttons-wrapper">
<?php if ( $has_primary_button ) {
$this->render_button( 'primary' );
} ?>
<?php if ( $has_secondary_button ) {
$this->render_button( 'secondary' );
} ?>
</div>
</div>
<?php
}
Expand Down
48 changes: 41 additions & 7 deletions modules/content/widgets/cta.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,17 @@ protected function add_content_cta_section() {
);

$this->add_control(
'primary_cta_button_text',
'primary_cta_heading',
[
'label' => esc_html__( 'Primary CTA', 'hello-plus' ),
'type' => Controls_Manager::HEADING,
]
);

$this->add_control(
'primary_cta_button_text',
[
'label' => esc_html__( 'Text', 'hello-plus' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Schedule Now', 'hello-plus' ),
'dynamic' => [
Expand Down Expand Up @@ -201,15 +209,15 @@ protected function add_content_cta_section() {
'label_on' => esc_html__( 'Show', 'hello-plus' ),
'label_off' => esc_html__( 'Hide', 'hello-plus' ),
'return_value' => 'yes',
'default' => 'no',
'default' => 'yes',
'separator' => 'before',
]
);

$this->add_control(
'secondary_cta_button_text',
[
'label' => esc_html__( 'Secondary CTA', 'hello-plus' ),
'label' => esc_html__( 'Text', 'hello-plus' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Contact Us', 'hello-plus' ),
'dynamic' => [
Expand Down Expand Up @@ -330,7 +338,7 @@ protected function add_style_section_text() {
'name' => 'heading_typography',
'selector' => '{{WRAPPER}} .ehp-cta__heading',
'global' => [
'default' => Global_Typography::TYPOGRAPHY_ACCENT,
'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
],
]
);
Expand Down Expand Up @@ -413,9 +421,8 @@ protected function add_style_section_cta() {
$this->add_control(
'cta_position',
[
'label' => esc_html__( 'Position', 'hello-plus' ),
'label' => esc_html__( 'Desktop Position', 'hello-plus' ),
'type' => Controls_Manager::CHOOSE,
'description' => esc_html__( 'Position controls Desktop layout', 'hello-plus' ),
'options' => [
'flex-start' => [
'title' => esc_html__( 'Start', 'hello-plus' ),
Expand Down Expand Up @@ -815,7 +822,14 @@ protected function add_style_box_section() {
'types' => [ 'classic', 'gradient' ],
'exclude' => [ 'image' ],
'selector' => '{{WRAPPER}} .ehp-cta',

'fields_options' => [
'background' => [
'default' => 'classic',
],
'color' => [
'default' => '#F6F7F8',
],
],
]
);

Expand Down Expand Up @@ -877,6 +891,26 @@ protected function add_style_box_section() {
]
);

$this->add_responsive_control(
'box_padding',
[
'label' => esc_html__( 'Padding', 'hello-plus' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem' ],
'selectors' => [
'{{WRAPPER}} .ehp-cta' => '--cta-box-padding-block-end: {{BOTTOM}}{{UNIT}}; --cta-box-padding-block-start: {{TOP}}{{UNIT}}; --cta-box-padding-inline-end: {{RIGHT}}{{UNIT}}; --cta-box-padding-inline-start: {{LEFT}}{{UNIT}};',
],
'default' => [
'top' => '60',
'right' => '60',
'bottom' => '60',
'left' => '60',
'unit' => 'px',
],
'separator' => 'before',
]
);

$this->add_control(
'box_full_screen_height',
[
Expand Down
4 changes: 2 additions & 2 deletions modules/content/widgets/zig-zag.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ private function add_style_zigzags_section() {
],
],
'default' => 'left',
'description' => esc_html__( 'Zigzag content will be stacked on smaller screens.', 'hello-plus' ),
'description' => esc_html__( 'Content will be stacked on smaller screens', 'hello-plus' ),
]
);

Expand Down Expand Up @@ -475,7 +475,7 @@ private function add_style_zigzags_section() {
$this->add_control(
'style_description',
[
'label' => esc_html__( 'Paragraph', 'hello-plus' ),
'label' => esc_html__( 'Description', 'hello-plus' ),
'type' => Controls_Manager::HEADING,
'separator' => 'default',
]
Expand Down
29 changes: 19 additions & 10 deletions modules/template-parts/classes/render/widget-footer-render.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
<?php

namespace HelloPlus\Modules\TemplateParts\Classes\Render;

use Elementor\Group_Control_Image_Size;
use Elementor\Icons_Manager;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}

use Elementor\{
Group_Control_Image_Size,
Icons_Manager,
Utils
};

use HelloPlus\Modules\TemplateParts\Widgets\Footer;

/**
* class Widget_Footer_Render
*/
class Widget_Footer_Render {
protected Footer $widget;
const LAYOUT_CLASSNAME = 'ehp-footer';
const SITE_LINK_CLASSNAME = 'ehp-footer__site-link';

protected array $settings;
protected Footer $widget;

public function __construct( Footer $widget ) {
$this->widget = $widget;
$this->settings = $widget->get_settings_for_display();
}
protected array $settings;

public function render(): void {
$layout_classnames = self::LAYOUT_CLASSNAME;
Expand Down Expand Up @@ -267,4 +271,9 @@ public function handle_link_classes( $atts, $item ) {

return $atts;
}

public function __construct( Footer $widget ) {
$this->widget = $widget;
$this->settings = $widget->get_settings_for_display();
}
}
40 changes: 24 additions & 16 deletions modules/template-parts/classes/render/widget-header-render.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@

namespace HelloPlus\Modules\TemplateParts\Classes\Render;

use Elementor\Group_Control_Image_Size;
use Elementor\Icons_Manager;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}

use Elementor\{
Group_Control_Image_Size,
Icons_Manager,
Utils
};

use HelloPlus\Modules\TemplateParts\Widgets\Header;

/**
* class Widget_Header_Render
*/
class Widget_Header_Render {

protected Header $widget;

const LAYOUT_CLASSNAME = 'ehp-header';
const SITE_LINK_CLASSNAME = 'ehp-header__site-link';
const CTAS_CONTAINER_CLASSNAME = 'ehp-header__ctas-container';
const BUTTON_CLASSNAME = 'ehp-header__button';

protected array $settings;
protected Header $widget;

public function __construct( Header $widget ) {
$this->widget = $widget;
$this->settings = $widget->get_settings_for_display();
}
protected array $settings;

public function render(): void {
$layout_classnames = self::LAYOUT_CLASSNAME;
Expand Down Expand Up @@ -58,7 +61,7 @@ public function render(): void {
'data-behavior-float' => $behavior_float,
] );
?>
<div <?php echo $this->widget->get_render_attribute_string( 'layout' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div <?php $this->widget->print_render_attribute_string( 'layout' ); ?>>
<div class="ehp-header__elements-container">
<?php
$this->render_site_link();
Expand Down Expand Up @@ -86,7 +89,7 @@ public function render_site_link(): void {
$this->widget->add_link_attributes( 'site-link', $site_link );
}
?>
<a <?php echo $this->widget->get_render_attribute_string( 'site-link' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<a <?php $this->widget->print_render_attribute_string( 'site-link' ); ?>>
<?php if ( $site_logo_image ) { ?>
<?php Group_Control_Image_Size::print_attachment_image_html( $this->settings, 'site_logo_image' ); ?>
<?php } else {
Expand Down Expand Up @@ -199,7 +202,7 @@ private function render_menu_toggle() {
);
?>
<i class="eicon-close ehp-header__toggle-icon ehp-header__toggle-icon--close"></i>
<span class="elementor-screen-only"><?php echo esc_html__( 'Menu', 'hello-plus' ); ?></span>
<span class="elementor-screen-only"><?php esc_html_e( 'Menu', 'hello-plus' ); ?></span>
</button>
<?php
}
Expand All @@ -216,7 +219,7 @@ protected function render_ctas_container() {
'class' => $ctas_container_classnames,
] );
?>
<div <?php echo $this->widget->get_render_attribute_string( 'ctas-container' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div <?php $this->widget->print_render_attribute_string( 'ctas-container' ); ?>>
<?php if ( $has_primary_button ) {
$this->render_button( 'primary' );
} ?>
Expand Down Expand Up @@ -264,7 +267,7 @@ protected function render_button( $type ) {
}

?>
<a <?php echo $this->widget->get_render_attribute_string( $type . '-button' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<a <?php $this->widget->print_render_attribute_string( $type . '-button' ); ?>>
<?php
Icons_Manager::render_icon( $button_icon,
[
Expand Down Expand Up @@ -333,4 +336,9 @@ public function handle_walker_menu_start_el( $item_output, $item ) {

return $item_output;
}

public function __construct( Header $widget ) {
$this->widget = $widget;
$this->settings = $widget->get_settings_for_display();
}
}
Loading

0 comments on commit 52aa109

Please sign in to comment.