This commit is contained in:
2025-10-23 15:54:28 +02:00
parent f24b46d28c
commit 728c9eaad4
7 changed files with 633 additions and 0 deletions

View File

@@ -0,0 +1,159 @@
.elementor-widget-author_big_box .box-row {
display: flex;
align-items: flex-start;
-moz-column-gap: 160px;
column-gap: 160px;
}
.elementor-widget-author_big_box .box-row .box-col-1 {
width: 415px;
min-width: 415px;
}
.elementor-widget-author_big_box .box-row .box-col-1 .box-img img {
width: 100%;
max-width: 415px;
}
.elementor-widget-author_big_box .box-row .box-col-2 {
width: 100%;
max-width: 850px;
display: flex;
flex-direction: column;
row-gap: 50px;
}
.elementor-widget-author_big_box .box-row .box-col-2 .author-head {
display: flex;
flex-direction: column;
row-gap: 10px;
}
.elementor-widget-author_big_box .box-row .box-col-2 .author-head h2 {
color: #0d183d;
font-family: "General Sans Variable", sans-serif;
font-weight: 500;
font-size: 32px;
line-height: 1.05;
margin: 0;
}
.elementor-widget-author_big_box .box-row .box-col-2 .author-head h3 {
color: #b58857;
font-family: "General Sans Variable", sans-serif;
font-weight: 400;
font-size: 32px;
line-height: 1.05;
margin: 0;
}
.elementor-widget-author_big_box .box-row .box-col-2 .author-content p {
color: #0c1e21;
font-family: "General Sans Variable", sans-serif;
font-weight: 400;
font-size: 20px;
line-height: 1.6;
margin-top: 0;
}
.elementor-widget-author_big_box .box-row .box-col-2 .author-content p:last-child {
margin-bottom: 0;
}
.elementor-widget-author_mini_box .box-row {
display: flex;
align-items: flex-start;
-moz-column-gap: 50px;
column-gap: 50px;
}
.elementor-widget-author_mini_box .box-row .box-col-1 {
width: 270px;
min-width: 270px;
}
.elementor-widget-author_mini_box .box-row .box-col-1 .box-img img {
width: 100%;
max-width: 270px;
}
.elementor-widget-author_mini_box .box-row .box-col-2 {
width: 100%;
max-width: 850px;
display: flex;
flex-direction: column;
row-gap: 50px;
padding-top: 60px;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-head {
display: flex;
flex-direction: column;
row-gap: 10px;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-head h2 {
color: #0d183d;
font-family: "General Sans Variable", sans-serif;
font-weight: 500;
font-size: 32px;
line-height: 1.05;
margin: 0;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-head h3 {
color: #b58857;
font-family: "General Sans Variable", sans-serif;
font-weight: 400;
font-size: 32px;
line-height: 1.05;
margin: 0;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-content.active .author-content-head span::after {
height: 0;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-content .author-content-head {
display: inline-flex;
flex-direction: row;
align-items: center;
gap: 10px;
cursor: pointer;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-content .author-content-head p {
color: #0c1e21;
font-family: "General Sans Variable", sans-serif;
font-weight: 400;
font-size: 20px;
line-height: 1;
margin: 0;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-content .author-content-head span {
position: relative;
display: inline-block;
width: 10px;
height: 10px;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-content .author-content-head span::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 10px;
height: 2px;
background: #0d183d;
transform: translate(-50%, -50%);
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-content .author-content-head span::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 2px;
height: 10px;
background: #0d183d;
transform: translate(-50%, -50%);
transition: all 250ms ease-in-out;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-content .author-content-body {
display: none;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-content .author-content-body--wrapper {
padding-top: 40px;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-content .author-content-body p {
color: #0c1e21;
font-family: "General Sans Variable", sans-serif;
font-weight: 400;
font-size: 20px;
line-height: 1.6;
margin-top: 0;
}
.elementor-widget-author_mini_box .box-row .box-col-2 .author-content .author-content-body p:last-child {
margin-bottom: 0;
}/*# sourceMappingURL=main.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["main.scss","main.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EACA,SAAA;EACA,WAAA;EACA,WAAA;EACA,mBAAA;EACA,gCAAA;ACzBP;AD2BM;EACC,WAAA;EACA,kBAAA;EACA,QAAA;EACA,SAAA;EACA,UAAA;EACA,YAAA;EACA,mBAAA;EACA,gCAAA;EACA,iCAAA;ACzBP;AD6BI;EACC,aAAA;AC3BL;AD6BK;EACC,iBAAA;AC3BN;AD6BK;EACC,cAAA;EACA,gDAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,aAAA;AC3BN;AD6BM;EACC,gBAAA;AC3BP","file":"main.css"}

View File

@@ -0,0 +1,191 @@
.elementor-widget-author_big_box {
.box-row {
display: flex;
align-items: flex-start;
column-gap: 160px;
.box-col-1 {
width: 415px;
min-width: 415px;
.box-img {
img {
width: 100%;
max-width: 415px;
}
}
}
.box-col-2 {
width: 100%;
max-width: 850px;
display: flex;
flex-direction: column;
row-gap: 50px;
.author-head {
display: flex;
flex-direction: column;
row-gap: 10px;
h2 {
color: #0d183d;
font-family: 'General Sans Variable', sans-serif;
font-weight: 500;
font-size: 32px;
line-height: 1.05;
margin: 0;
}
h3 {
color: #b58857;
font-family: 'General Sans Variable', sans-serif;
font-weight: 400;
font-size: 32px;
line-height: 1.05;
margin: 0;
}
}
.author-content {
p {
color: #0c1e21;
font-family: 'General Sans Variable', sans-serif;
font-weight: 400;
font-size: 20px;
line-height: 1.6;
margin-top: 0;
&:last-child {
margin-bottom: 0;
}
}
}
}
}
}
.elementor-widget-author_mini_box {
.box-row {
display: flex;
align-items: flex-start;
column-gap: 50px;
.box-col-1 {
width: 270px;
min-width: 270px;
.box-img {
img {
width: 100%;
max-width: 270px;
}
}
}
.box-col-2 {
width: 100%;
max-width: 850px;
display: flex;
flex-direction: column;
row-gap: 50px;
padding-top: 60px;
.author-head {
display: flex;
flex-direction: column;
row-gap: 10px;
h2 {
color: #0d183d;
font-family: 'General Sans Variable', sans-serif;
font-weight: 500;
font-size: 32px;
line-height: 1.05;
margin: 0;
}
h3 {
color: #b58857;
font-family: 'General Sans Variable', sans-serif;
font-weight: 400;
font-size: 32px;
line-height: 1.05;
margin: 0;
}
}
.author-content {
&.active {
.author-content-head {
span {
&::after {
height: 0;
}
}
}
}
.author-content-head {
display: inline-flex;
flex-direction: row;
align-items: center;
gap: 10px;
cursor: pointer;
p {
color: #0c1e21;
font-family: 'General Sans Variable', sans-serif;
font-weight: 400;
font-size: 20px;
line-height: 1;
margin: 0;
}
span {
position: relative;
display: inline-block;
width: 10px;
height: 10px;
&::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 10px;
height: 2px;
background: #0d183d;
transform: translate(-50%, -50%);
}
&::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 2px;
height: 10px;
background: #0d183d;
transform: translate(-50%, -50%);
transition: all 250ms ease-in-out;
}
}
}
.author-content-body {
display: none;
&--wrapper {
padding-top: 40px;
}
p {
color: #0c1e21;
font-family: 'General Sans Variable', sans-serif;
font-weight: 400;
font-size: 20px;
line-height: 1.6;
margin-top: 0;
&:last-child {
margin-bottom: 0;
}
}
}
}
}
}
}

View File

@@ -0,0 +1,17 @@
jQuery(function($) {
$('body').on('click', '.elementor-widget-author_mini_box .author-content .author-content-head', function(e) {
e.preventDefault();
var $currentItem = $(this).closest('.author-content');
var $currentBody = $currentItem.find('.author-content-body');
$('.elementor-widget-author_mini_box .author-content')
.not($currentItem)
.removeClass('active')
.find('.author-content-body')
.slideUp();
$currentItem.toggleClass('active');
$currentBody.stop(true, true).slideToggle();
});
});

View File

@@ -0,0 +1,49 @@
<?php
/**
* Plugin Name: Elementor Addon
* Description: Simple hello world widgets for Elementor.
* Version: 1.0.0
* Author: Elementor Developer
* Author URI: https://developers.elementor.com/
* Text Domain: elementor-addon
*/
function register_hello_world_widget($widgets_manager)
{
require_once(__DIR__ . '/widgets/author-big-box.php');
require_once(__DIR__ . '/widgets/author-mini-box.php');
$widgets_manager->register(new \Custom_Author_Big_Box());
$widgets_manager->register(new \Custom_Author_Mini_Box());
}
add_action('elementor/widgets/register', 'register_hello_world_widget');
function enqueue_elementor_addon_styles()
{
if (did_action('elementor/loaded'))
{
wp_enqueue_style(
'elementor-addon-main-css',
plugins_url('assets/css/main.css', __FILE__),
[],
'1.0.0'
);
}
}
add_action('wp_enqueue_scripts', 'enqueue_elementor_addon_styles');
function enqueue_elementor_addon_scripts()
{
if (did_action('elementor/loaded'))
{
wp_enqueue_script(
'elementor-addon-main-js',
plugins_url('assets/js/main.js', __FILE__),
['jquery'],
'1.0.0',
true
);
}
}
add_action('wp_enqueue_scripts', 'enqueue_elementor_addon_scripts');

View File

@@ -0,0 +1,104 @@
<?php
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Repeater;
class Custom_Author_Big_Box extends Widget_Base {
public function get_name() {
return 'author_big_box';
}
public function get_title() {
return 'Author Big Box';
}
public function get_icon() {
return 'eicon-code';
}
public function get_categories() {
return [ 'general' ];
}
public function get_script_depends() {
return [ 'author' ];
}
protected function _register_controls() {
$this->start_controls_section(
'Box',
[
'label' => esc_html__( 'Box', 'elementor-addon' ),
]
);
$this->add_control(
'author_image',
[
'label' => esc_html__( 'Image', 'elementor-addon' ),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [
'url' => \Elementor\Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
'author_name',
[
'label' => esc_html__( 'Name', 'elementor-addon' ),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => esc_html__( 'Lorem ipsum', 'elementor-addon' ),
'label_block' => true,
]
);
$this->add_control(
'author_position',
[
'label' => esc_html__( 'Position', 'elementor-addon' ),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => esc_html__( 'Lorem ipsum', 'elementor-addon' ),
'label_block' => true,
]
);
$this->add_control(
'author_content',
[
'label' => esc_html__( 'Text', 'elementor-addon' ),
'type' => \Elementor\Controls_Manager::WYSIWYG,
'default' => esc_html__( 'Lorem ipsum ...', 'elementor-addon' ),
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
?>
<div class="box-row">
<div class="box-col-1">
<div class="box-img">
<?php if ( !empty( $settings['author_image']['url'] ) ) : ?>
<img src="<?php echo esc_url( $settings['author_image']['url'] ); ?>" alt="<?php echo esc_attr( $settings['author_name'] ); ?>">
<?php endif; ?>
</div>
</div>
<div class="box-col-2">
<div class="author-head">
<h2><?php echo esc_html( $settings['author_name'] ); ?></h2>
<h3><?php echo esc_html( $settings['author_position'] ); ?></h3>
</div>
<div class="author-content">
<?php echo wp_kses_post( $settings['author_content'] ); ?>
</div>
</div>
</div>
<?php
}
}

View File

@@ -0,0 +1,112 @@
<?php
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Repeater;
class Custom_Author_Mini_Box extends Widget_Base {
public function get_name() {
return 'author_mini_box';
}
public function get_title() {
return 'Author Mini Box';
}
public function get_icon() {
return 'eicon-code';
}
public function get_categories() {
return [ 'general' ];
}
public function get_script_depends() {
return [ 'author' ];
}
protected function _register_controls() {
$this->start_controls_section(
'Box',
[
'label' => esc_html__( 'Box', 'elementor-addon' ),
]
);
$this->add_control(
'author_image',
[
'label' => esc_html__( 'Image', 'elementor-addon' ),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [
'url' => \Elementor\Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
'author_name',
[
'label' => esc_html__( 'Name', 'elementor-addon' ),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => esc_html__( 'Lorem ipsum', 'elementor-addon' ),
'label_block' => true,
]
);
$this->add_control(
'author_position',
[
'label' => esc_html__( 'Position', 'elementor-addon' ),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => esc_html__( 'Lorem ipsum', 'elementor-addon' ),
'label_block' => true,
]
);
$this->add_control(
'author_content',
[
'label' => esc_html__( 'Text', 'elementor-addon' ),
'type' => \Elementor\Controls_Manager::WYSIWYG,
'default' => esc_html__( 'Lorem ipsum ...', 'elementor-addon' ),
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
?>
<div class="box-row">
<div class="box-col-1">
<div class="box-img">
<?php if ( !empty( $settings['author_image']['url'] ) ) : ?>
<img src="<?php echo esc_url( $settings['author_image']['url'] ); ?>" alt="<?php echo esc_attr( $settings['author_name'] ); ?>">
<?php endif; ?>
</div>
</div>
<div class="box-col-2">
<div class="author-head">
<h2><?php echo esc_html( $settings['author_name'] ); ?></h2>
<h3><?php echo esc_html( $settings['author_position'] ); ?></h3>
</div>
<div class="author-content">
<div class="author-content-head">
<p>Rozwiń pełny opis</p>
<span></span>
</div>
<div class="author-content-body">
<div class="author-content-body--wrapper">
<?php echo wp_kses_post( $settings['author_content'] ); ?>
</div>
</div>
</div>
</div>
</div>
<?php
}
}