Your IP : 216.73.216.162


Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/
Upload File :
Current File : /home/x/b/o/xbodynamge/namtation/wp-content/pricing-table.tar

pricing-table.php000066600000043354151142514630010014 0ustar00<?php
/**
 * Pricing table module.
 *
 * @package themeisle-companion
 */

// Get the module directory.
$module_directory = $this->get_dir();

// Include common functions file.
require_once( $module_directory . '/inc/common-functions.php' );

// Include custom fields
require_once( $module_directory . '/custom-fields/toggle-field/toggle_field.php' );

/**
 * Class PricingTableModule
 */
class PricingTableModule extends FLBuilderModule {

	/**
	 * Constructor function for the module. You must pass the
	 * name, description, dir and url in an array to the parent class.
	 *
	 * @method __construct
	 */
	public function __construct() {
		parent::__construct(
			array(
				'name'          => esc_html__( 'Pricing table', 'themeisle-companion' ),
				'description'   => esc_html__( 'Pricing Tables are the perfect option when showcasing services you have on offer.', 'themeisle-companion' ),
				'category'      => esc_html__( 'Orbit Fox Modules', 'themeisle-companion' ),
				'dir'           => BEAVER_WIDGETS_PATH . 'modules/pricing-table/',
				'url'           => BEAVER_WIDGETS_URL . 'modules/pricing-table/',
				'editor_export' => true, // Defaults to true and can be omitted.
				'enabled'       => true, // Defaults to true and can be omitted.
			)
		);
	}
}

/**
 * Register the module and its form settings.
 */
FLBuilder::register_module(
	'PricingTableModule',
	array(
		'content' => array(
			'title' => esc_html__( 'Content', 'themeisle-companion' ), // Tab title
			'sections' => array(
				'header' => array(
					'title'  => esc_html__( 'Plan Header', 'themeisle-companion' ),
					'fields' => array(
						'plan_title' => array(
							'type'    => 'text',
							'label'   => esc_html__( 'Title', 'themeisle-companion' ),
							'default' => esc_html__( 'Plan title', 'themeisle-companion' ),
							'preview' => array(
								'type'     => 'text',
								'selector' => '.obfx-plan-title',
							),
						),
						'plan_title_tag' => array(
							'type'    => 'select',
							'label'   => esc_html__( 'Title tag', 'themeisle-companion' ),
							'default' => 'h2',
							'options' => array(
								'h1' => esc_html__( 'h1', 'themeisle-companion' ),
								'h2' => esc_html__( 'h2', 'themeisle-companion' ),
								'h3' => esc_html__( 'h3', 'themeisle-companion' ),
								'h4' => esc_html__( 'h4', 'themeisle-companion' ),
								'h5' => esc_html__( 'h5', 'themeisle-companion' ),
								'h6' => esc_html__( 'h6', 'themeisle-companion' ),
								'p'  => esc_html__( 'p', 'themeisle-companion' ),
							),
						),
						'plan_subtitle' => array(
							'type'    => 'text',
							'label'   => esc_html__( 'Subtitle', 'themeisle-companion' ),
							'default' => esc_html__( 'Plan subtitle', 'themeisle-companion' ),
							'preview' => array(
								'type'     => 'text',
								'selector' => '.obfx-plan-subtitle',
							),
						),
						'plan_subtitle_tag' => array(
							'type'    => 'select',
							'label'   => esc_html__( 'Subtitle tag', 'themeisle-companion' ),
							'default' => 'p',
							'options' => array(
								'h1' => esc_html__( 'h1', 'themeisle-companion' ),
								'h2' => esc_html__( 'h2', 'themeisle-companion' ),
								'h3' => esc_html__( 'h3', 'themeisle-companion' ),
								'h4' => esc_html__( 'h4', 'themeisle-companion' ),
								'h5' => esc_html__( 'h5', 'themeisle-companion' ),
								'h6' => esc_html__( 'h6', 'themeisle-companion' ),
								'p'  => esc_html__( 'p', 'themeisle-companion' ),
							),
						),
					),
				),
				'price' => array(
					'title'  => esc_html__( 'Price Tag', 'themeisle-companion' ),
					'fields' => array(
						'price' => array(
							'type'    => 'text',
							'label'   => esc_html__( 'Price', 'themeisle-companion' ),
							'default' => '50',
							'preview' => array(
								'type'     => 'text',
								'selector' => '.obfx-price',
							),
						),
						'currency' => array(
							'type'    => 'text',
							'label'   => esc_html__( 'Currency', 'themeisle-companion' ),
							'default' => '$',
							'preview' => array(
								'type'     => 'text',
								'selector' => '.obfx-currency',
							),
						),
						'currency_position' => array(
							'type'    => 'select',
							'label'   => esc_html__( 'Currency position', 'themeisle-companion' ),
							'default' => 'after',
							'options' => array(
								'before' => esc_html__( 'Before', 'themeisle-companion' ),
								'after'  => esc_html__( 'After', 'themeisle-companion' ),
							),
						),
						'period' => array(
							'type'    => 'text',
							'label'   => esc_html__( 'Period', 'themeisle-companion' ),
							'default' => esc_html__( '/month', 'themeisle-companion' ),
							'preview' => array(
								'type'     => 'text',
								'selector' => '.obfx-period',
							),
						),
					),
				),
				'features' => array(
					'title' => esc_html__( 'Features list', 'themeisle-companion' ),
					'fields' => array(
						'features' => array(
							'multiple' => true,
							'type'          => 'form',
							'label'         => esc_html__( 'Feature', 'themeisle-companion' ),
							'form'          => 'feature_field', // ID of a registered form.
							'preview_text'  => 'text', // ID of a field to use for the preview text.
						),
					),
				),
				'button' => array(
					'title' => esc_html__( 'Button', 'themeisle-companion' ),
					'fields' => array(
						'text' => array(
							'type'    => 'text',
							'label'   => esc_html__( 'Button text', 'themeisle-companion' ),
							'default' => esc_html__( 'Button', 'themeisle-companion' ),
							'preview' => array(
								'type'     => 'text',
								'selector' => '.obfx-plan-button',
							),
						),
						'link' => array(
							'type' => 'link',
							'label' => esc_html__( 'Button link', 'themeisle-companion' ),
						),
					),
				),
				'appearance' => array(
					'title' => esc_html__( 'Appearance', 'themeisle-companion' ),
					'fields' => array(
						'card_layout' => array(
							'type'          => 'obfx_toggle',
							'label'         => esc_html__( 'Card layout', 'themeisle-companion' ),
							'default'       => 'yes',
						),
						'text_position' => array(
							'type'    => 'select',
							'label'   => esc_html__( 'Align', 'themeisle-companion' ),
							'default' => 'center',
							'options' => array(
								'center' => esc_html__( 'Center', 'themeisle-companion' ),
								'left'  => esc_html__( 'Left', 'themeisle-companion' ),
								'right'  => esc_html__( 'Right', 'themeisle-companion' ),
							),
						),
					),
				),
			),
		),
		'header_style' => array(
			'title' => esc_html__( 'Header Style', 'themeisle-companion' ),
			'sections' => array(
				'header_padding' => themeisle_four_fields_control(
					array(
						'default' => array(
							'top' => 15,
							'bottom' => 15,
							'left' => 0,
							'right' => 0,
						),
						'selector' => '.obfx-pricing-header',
						'field_name_prefix' => '',
					)
				),
				'colors' => array(
					'title'  => esc_html__( 'Colors', 'themeisle-companion' ),
					'fields' => array(
						'title_color' => array(
							'type' => 'color',
							'label' => esc_html__( 'Title color', 'themeisle-companion' ),
							'preview' => array(
								'type' => 'css',
								'rules' => array(
									array(
										'selector' => '.obfx-pricing-header *:first-child',
										'property'     => 'color',
									),
								),
							),
						),
						'subtitle_color' => array(
							'type' => 'color',
							'label' => esc_html__( 'Subtitle color', 'themeisle-companion' ),
							'preview' => array(
								'type' => 'css',
								'rules' => array(
									array(
										'selector' => '.obfx-pricing-header *:last-child',
										'property'     => 'color',
									),
								),
							),
						),
					),
				),
				'title_typography' => themeisle_typography_settings(
					array(
						'title' => esc_html__( 'Title typography', 'themeisle-companion' ),
						'prefix' => 'title_',
						'selector' => '.obfx-pricing-header *:first-child',
					)
				),
				'subtitle_typography' => themeisle_typography_settings(
					array(
						'title' => esc_html__( 'Subtitle typography', 'themeisle-companion' ),
						'prefix' => 'subtitle_',
						'selector' => '.obfx-pricing-header *:last-child',
					)
				),
				'header_background' => array(
					'title' => esc_html__( 'Background', 'themeisle-companion' ),
					'fields' => array(
						'bg_type' => array(
							'type'    => 'select',
							'label'   => esc_html__( 'Type', 'themeisle-companion' ),
							'default' => 'color',
							'options' => array(
								'color' => esc_html__( 'Color', 'themeisle-companion' ),
								'image' => esc_html__( 'Background', 'themeisle-companion' ),
								'gradient' => esc_html__( 'Gradient', 'themeisle-companion' ),
							),
							'toggle' => array(
								'color' => array(
									'fields' => array('header_bg_color'),
								),
								'image' => array(
									'fields' => array('header_bg_image'),
								),
								'gradient' => array(
									'fields' => array('gradient_color1', 'gradient_color2', 'gradient_orientation'),
								),
							),
						),
						'header_bg_color' => array(
							'type' => 'color',
							'label' => esc_html__( 'Background color', 'themeisle-companion' ),
							'show_reset'    => true,
							'preview' => array(
								'type' => 'css',
								'rules' => array(
									array(
										'selector' => '.obfx-pricing-header',
										'property'     => 'background-color',
									),
								),
							),
						),
						'header_bg_image' => array(
							'type'          => 'photo',
							'label'         => esc_html__( 'Photo Field', 'themeisle-companion' ),
							'show_remove'    => true,
						),
						'gradient_color1' => array(
							'type' => 'color',
							'label' => esc_html__( 'Gradient color 1', 'themeisle-companion' ),
							'show_reset'    => true,
						),
						'gradient_color2' => array(
							'type' => 'color',
							'label' => esc_html__( 'Gradient color 2', 'themeisle-companion' ),
							'show_reset'    => true,
						),
						'gradient_orientation' => array(
							'type'    => 'select',
							'label'   => esc_html__( 'Orientation', 'themeisle-companion' ),
							'default' => 'horizontal',
							'options' => array(
								'horizontal' => esc_html__( 'Horizontal', 'themeisle-companion' ),
								'vertical' => esc_html__( 'Vertical', 'themeisle-companion' ),
								'diagonal_bottom' => esc_html__( 'Diagonal bottom', 'themeisle-companion' ),
								'diagonal_top' => esc_html__( 'Diagonal top', 'themeisle-companion' ),
								'radial' => esc_html__( 'Radial', 'themeisle-companion' ),
							),
						),
					),
				),
			),
		),
		'price_style' => array(
			'title' => esc_html__( 'Price Style', 'themeisle-companion' ),
			'sections' => array(
				'price_padding' => themeisle_four_fields_control(
					array(
						'default' => array(
							'top' => 15,
							'bottom' => 15,
							'left' => 0,
							'right' => 0,
						),
						'selector' => '.obfx-pricing-price',
						'field_name_prefix' => 'price_',
					)
				),
				'price_colors' => array(
					'title' => esc_html__( 'Colors', 'themeisle-companion' ),
					'fields' => array(
						'price_color' => array(
							'type'          => 'color',
							'label'         => esc_html__( 'Price color', 'themeisle-companion' ),
							'preview'       => array(
								'type'          => 'css',
								'rules'           => array(
									array(
										'selector'     => '.obfx-price',
										'property'     => 'color',
									),
								),
							),
						),
						'currency_color' => array(
							'type'          => 'color',
							'label'         => esc_html__( 'Currency color', 'themeisle-companion' ),
							'preview'       => array(
								'type'          => 'css',
								'rules'           => array(
									array(
										'selector'     => '.obfx-pricing-price sup',
										'property'     => 'color',
									),
								),
							),
						),
						'period_color' => array(
							'type'          => 'color',
							'label'         => esc_html__( 'Period color', 'themeisle-companion' ),
							'preview'       => array(
								'type'          => 'css',
								'rules'           => array(
									array(
										'selector'     => '.obfx-period',
										'property'     => 'color',
									),
								),
							),
						),
					),
				),
				'price_typography' => themeisle_typography_settings(
					array(
						'prefix' => 'price_',
						'selector' => '.obfx-pricing-price',
						'font_size_default' => 40,
					)
				),
			),
		),
		'features_style' => array(
			'title' => esc_html__( 'Features Style', 'themeisle-companion' ),
			'sections' => array(
				'features_padding' => themeisle_four_fields_control(
					array(
						'default' => array(
							'top' => 15,
							'bottom' => 15,
							'left' => 0,
							'right' => 0,
						),
						'selector' => '.obfx-pricing-price',
						'field_name_prefix' => 'features_',
					)
				),
				'features_colors' => array(
					'title' => esc_html__( 'Colors', 'themeisle-companion' ),
					'fields' => array(
						'icon_color' => array(
							'type'          => 'color',
							'label'         => esc_html__( 'Icon color', 'themeisle-companion' ),
							'preview'       => array(
								'type'          => 'css',
								'rules'           => array(
									array(
										'selector'     => '.obfx-pricing-feature-content i',
										'property'     => 'color',
									),
								),
							),
						),
						'bold_color' => array(
							'type'          => 'color',
							'label'         => esc_html__( 'Bold text color', 'themeisle-companion' ),
							'preview'       => array(
								'type'          => 'css',
								'rules'           => array(
									array(
										'selector'     => '.obfx-pricing-feature-content strong',
										'property'     => 'color',
									),
								),
							),
						),
						'feature_color' => array(
							'type'          => 'color',
							'label'         => esc_html__( 'Text color', 'themeisle-companion' ),
							'preview'       => array(
								'type'          => 'css',
								'rules'           => array(
									array(
										'selector'     => '.obfx-pricing-feature-content:not(i):not(strong)',
										'property'     => 'color',
									),
								),
							),
						),
					),
				),
				'feature_typography' => themeisle_typography_settings(
					array(
						'prefix' => 'feature_',
						'selector' => '.obfx-pricing-feature-content *',
						'font_size_default' => 17,
					)
				),
			),
		),
		'button_style' => array(
			'title' => esc_html__( 'Button Style', 'themeisle-companion' ),
			'sections' => array(
				'button_margins' => themeisle_four_fields_control(
					array(
						'default' => array(
							'top' => 15,
							'bottom' => 15,
							'left' => 0,
							'right' => 0,
						),
						'selector' => '.obfx-plan-bottom',
						'field_name_prefix' => 'button_margin_',
						'type' => 'margin',
					)
				),
				'button_padding' => themeisle_four_fields_control(
					array(
						'default' => array(
							'top' => 6,
							'bottom' => 6,
							'left' => 12,
							'right' => 12,
						),
						'selector' => '.obfx-plan-button',
						'field_name_prefix' => 'button_padding_',
					)
				),
				'button_colors' => array(
					'title' => esc_html__( 'Colors', 'themeisle-companion' ),
					'fields' => array(
						'button_text_color' => array(
							'type'          => 'color',
							'label'         => esc_html__( 'Text', 'themeisle-companion' ),
							'preview'       => array(
								'type'          => 'css',
								'rules'           => array(
									array(
										'selector'     => '.obfx-plan-button',
										'property'     => 'color',
									),
								),
							),
						),
						'button_text_color_hover' => array(
							'type'          => 'color',
							'label'         => esc_html__( 'Text on hover', 'themeisle-companion' ),
							'preview'       => array(
								'type'          => 'css',
								'rules'           => array(
									array(
										'selector'     => '.obfx-plan-button:hover',
										'property'     => 'color',
									),
								),
							),
						),
						'button_bg_color' => array(
							'type'          => 'color',
							'label'         => esc_html__( 'Button background', 'themeisle-companion' ),
							'preview'       => array(
								'type'          => 'css',
								'rules'           => array(
									array(
										'selector'     => '.obfx-plan-button',
										'property'     => 'background-color',
									),
								),
							),
						),
						'button_bg_color_hover' => array(
							'type'          => 'color',
							'label'         => esc_html__( 'Button background on hover', 'themeisle-companion' ),
							'preview'       => array(
								'type'          => 'css',
								'rules'           => array(
									array(
										'selector'     => '.obfx-plan-button:hover',
										'property'     => 'background-color',
									),
								),
							),
						),
					),
				),
				'button_typography' => themeisle_typography_settings(
					array(
						'prefix' => 'button_',
						'selector' => '.obfx-plan-button',
						'font_size_default' => 15,
					)
				),
			),
		),
	)
);


FLBuilder::register_settings_form(
	'feature_field',
	array(
		'title' => __( 'Feature', 'themeisle-companion' ),
		'tabs'  => array(
			'general'      => array(
				'title'         => esc_html__( 'General', 'themeisle-companion' ),
				'sections'      => array(
					'general'       => array(
						'title'         => '',
						'fields'        => array(
							'bold_text' => array(
								'type'  => 'text',
								'label' => esc_html__( 'Bold text', 'themeisle-companion' ),
							),
							'text' => array(
								'type'  => 'text',
								'label' => esc_html__( 'Text', 'themeisle-companion' ),
							),
							'icon' => array(
								'type'          => 'icon',
								'label'         => esc_html__( 'Icon', 'themeisle-companion' ),
								'show_remove'   => true,
							),
						),
					),
				),
			),
		),
	)
);
.htaccess000066600000000424151142514630006350 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>includes/.htaccess000066600000000424151142514630010156 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>includes/frontend.css.php000066600000041430151142514630011501 0ustar00<?php
$text_position = ! empty( $settings->text_position ) ? $settings->text_position : '';
if ( ! empty( $text_position ) ) {
	echo '.fl-node-' . $id . ' .obfx-pricing-plan > div,.fl-node-' . $id . ' .obfx-pricing-plan li{';
	echo 'text-align:' . $text_position . ';';
	echo '}';
}

$padding_top = ! empty( $settings->top ) ? $settings->top : '';
$padding_bottom = ! empty( $settings->bottom ) ? $settings->bottom : '';
$padding_left = ! empty( $settings->left ) ? $settings->left : '';
$padding_right = ! empty( $settings->right ) ? $settings->right : '';
echo '.fl-node-' . $id . '.obfx-pricing-header{';
	echo ! empty( $padding_top ) ? 'padding-top: ' . $padding_top . 'px;' : '';
	echo ! empty( $padding_bottom ) ? 'padding-bottom: ' . $padding_bottom . 'px;' : '';
	echo ! empty( $padding_left ) ? 'padding-left: ' . $padding_left . 'px;' : '';
	echo ! empty( $padding_right ) ? 'padding-right: ' . $padding_right . 'px;' : '';

	$type = $settings->bg_type;
switch ( $type ) {
	case 'color':
		$bg_color = ! empty( $settings->header_bg_color ) ? $settings->header_bg_color : '';
		if ( ! empty( $bg_color ) ) {
			$bg_color = strpos( $bg_color, 'rgba' ) !== false ? 'background-color:' . $bg_color : 'background-color:#' . $bg_color;
			echo $bg_color . ';';
		}
		break;
	case 'image':
		$bg_image = ! empty( $settings->header_bg_image ) ? $settings->header_bg_image : '';
		if ( ! empty( $bg_image ) ) {
			echo 'background-image:url(' . wp_get_attachment_url( $bg_image ) . ');';
		}
		break;
	case 'gradient':
		$gradient_color1 = ! empty( $settings->gradient_color1 ) ? $settings->gradient_color1 : '';
		$gradient_color2 = ! empty( $settings->gradient_color2 ) ? $settings->gradient_color2 : '';
		$gradient_orientation = ! empty( $settings->gradient_orientation ) ? $settings->gradient_orientation : '';
		$pos1 = 'left';
		$pos2 = 'left';
		$pos3 = 'to right';
		switch ( $gradient_orientation ) {
			case 'vertical':
				$pos1 = 'top';
				$pos2 = 'to bottom';
				$type = 'linear-gradient';
				break;
			case 'diagonal_bottom':
				$pos1 = '-45deg';
				$pos2 = '135deg';
				$type = 'linear-gradient';
				break;
			case 'diagonal_top':
				$pos1 = '45deg';
				$pos2 = '45deg';
				$type = 'linear-gradient';
				break;
			case 'radial':
				$pos1 = 'center, ellipse cover';
				$pos2 = 'ellipse at center';
				$type = 'radial-gradient';
				break;
		}

		if ( ! empty( $gradient_color1 ) ) {
			$gradient_color1 = strpos( $gradient_color1, 'rgba' ) !== false ? $gradient_color1 : '#' . $gradient_color1;
			if ( ! empty( $gradient_color2 ) ) {
				$gradient_color2 = strpos( $gradient_color2, 'rgba' ) !== false ? $gradient_color2 : '#' . $gradient_color2;
				echo '
					background: -moz-' . esc_attr( $type ) . '(' . esc_attr( $pos1 ) . ', ' . esc_attr( $gradient_color1 ) . ' 0%, ' . esc_attr( $gradient_color2 ) . ' 100%); 
					background: -webkit-' . esc_attr( $type ) . '(' . esc_attr( $pos1 ) . ', ' . esc_attr( $gradient_color1 ) . ' 0%, ' . esc_attr( $gradient_color2 ) . ' 100%); 
					background: ' . esc_attr( $type ) . '(' . esc_attr( $pos2 ) . ', ' . esc_attr( $gradient_color1 ) . ' 0%, ' . esc_attr( $gradient_color2 ) . ' 100%);';
			} else {
				echo 'background-color:' . esc_attr( $gradient_color1 ) . ';';
			}
		}
		break;
}
echo '}';

$title_color = ! empty( $settings->title_color ) ? $settings->title_color : '';
if ( ! empty( $title_color ) ) {
	$title_color = strpos( $title_color, 'rgba' ) !== false ? $title_color : '#' . $title_color;
}
$title_font_size = ! empty( $settings->title_font_size ) ? $settings->title_font_size : '';
$title_font_family = ! empty( $settings->title_font_family['family'] ) ? $settings->title_font_family['family'] : '';
$title_font_weight = ! empty( $settings->title_font_family['weight'] ) ? $settings->title_font_family['weight'] : '';
$title_transform = ! empty( $settings->title_transform ) ? $settings->title_transform : '';
$title_font_style = ! empty( $settings->title_font_style ) ? $settings->title_font_style : '';
$title_line_height = ! empty( $settings->title_line_height ) ? $settings->title_line_height : '';
$title_letter_spacing = ! empty( $settings->title_letter_spacing ) ? $settings->title_letter_spacing : '';
echo '.fl-node-' . $id . ' .obfx-pricing-header *:first-child{';
	echo ! empty( $title_color ) ? 'color: ' . $title_color . ';' : '';
	echo ! empty( $title_font_size ) ? 'font-size: ' . $title_font_size . 'px;' : '';
	echo ! empty( $title_font_family ) ? 'font-family: ' . $title_font_family . ';' : '';
	echo ! empty( $title_font_weight ) ? 'font-weight: ' . $title_font_weight . ';' : '';
	echo ! empty( $title_transform ) ? 'text-transform: ' . $title_transform . ';' : '';
	echo ! empty( $title_font_style ) ? 'font-style: ' . $title_font_style . ';' : '';
	echo ! empty( $title_line_height ) ? 'line-height: ' . $title_line_height . 'px;' : '';
	echo ! empty( $title_letter_spacing ) ? 'letter-spacing: ' . $title_letter_spacing . 'px;' : '';
echo '}';


$subtitle_color = ! empty( $settings->subtitle_color ) ? $settings->subtitle_color : '';
if ( ! empty( $subtitle_color ) ) {
	$subtitle_color = strpos( $subtitle_color, 'rgba' ) !== false ? $subtitle_color : '#' . $subtitle_color;
}
$subtitle_font_size = ! empty( $settings->subtitle_font_size ) ? $settings->subtitle_font_size : '';
$subtitle_font_family = ! empty( $settings->subtitle_font_family['family'] ) ? $settings->subtitle_font_family : '';
$subtitle_font_weight = ! empty( $settings->subtitle_font_family['weight'] ) ? $settings->subtitle_font_family : '';
$subtitle_transform = ! empty( $settings->subtitle_transform ) ? $settings->subtitle_transform : '';
$subtitle_font_style = ! empty( $settings->subtitle_font_style ) ? $settings->subtitle_font_style : '';
$subtitle_line_height = ! empty( $settings->subtitle_line_height ) ? $settings->subtitle_line_height : '';
$subtitle_letter_spacing = ! empty( $settings->subtitle_letter_spacing ) ? $settings->subtitle_letter_spacing : '';
echo '.fl-node-' . $id . ' .obfx-pricing-header *:last-child{';
	echo ! empty( $subtitle_color ) ? 'color: ' . $subtitle_color . ';' : '';
	echo ! empty( $subtitle_font_size ) ? 'font-size: ' . $subtitle_font_size . 'px;' : '';
	echo ! empty( $subtitle_font_family ) ? 'font-family: ' . $subtitle_font_family . ';' : '';
	echo ! empty( $subtitle_font_weight ) ? 'font-weight: ' . $subtitle_font_weight . ';' : '';
	echo ! empty( $subtitle_transform ) ? 'text-transform: ' . $subtitle_transform . ';' : '';
	echo ! empty( $subtitle_font_style ) ? 'font-style: ' . $subtitle_font_style . ';' : '';
	echo ! empty( $subtitle_line_height ) ? 'line-height: ' . $subtitle_line_height . 'px;' : '';
	echo ! empty( $subtitle_letter_spacing ) ? 'letter-spacing: ' . $subtitle_letter_spacing . 'px;' : '';
echo '}';

$price_top = ! empty( $settings->price_top ) ? $settings->price_top : '';
$price_bottom = ! empty( $settings->price_bottom ) ? $settings->price_bottom : '';
$price_left = ! empty( $settings->price_left ) ? $settings->price_left : '';
$price_right = ! empty( $settings->price_right ) ? $settings->price_right : '';
$price_font_size = ! empty( $settings->price_font_size ) ? $settings->price_font_size : '';
$price_font_family = ! empty( $settings->price_font_family['family'] ) ? $settings->price_font_family['family'] : '';
$price_font_weight = ! empty( $settings->price_font_family['weight'] ) ? $settings->price_font_family['weight'] : '';
$price_transform = ! empty( $settings->price_transform ) ? $settings->price_transform : '';
$price_font_style = ! empty( $settings->price_font_style ) ? $settings->price_font_style : '';
$price_line_height = ! empty( $settings->price_line_height ) ? $settings->price_line_height : '';
$price_letter_spacing = ! empty( $settings->price_letter_spacing ) ? $settings->price_letter_spacing : '';
echo '.fl-node-' . $id . ' .obfx-pricing-price{';
	echo ! empty( $price_top ) ? 'padding-top: ' . $price_top . 'px;' : '';
	echo ! empty( $price_bottom ) ? 'padding-bottom: ' . $price_bottom . 'px;' : '';
	echo ! empty( $price_left ) ? 'padding-left: ' . $price_left . 'px;' : '';
	echo ! empty( $price_right ) ? 'padding-right: ' . $price_right . 'px;' : '';
	echo ! empty( $price_font_size ) ? 'font-size: ' . $price_font_size . 'px;' : '';
	echo ! empty( $price_font_family ) ? 'font-family: ' . $price_font_family . ';' : '';
	echo ! empty( $price_font_weight ) ? 'font-weight: ' . $price_font_weight . ';' : '';
	echo ! empty( $price_transform ) ? 'text-transform: ' . $price_transform . ';' : '';
	echo ! empty( $price_font_style ) ? 'font-style: ' . $price_font_style . ';' : '';
	echo ! empty( $price_line_height ) ? 'line-height: ' . $price_line_height . 'px;' : '';
	echo ! empty( $price_letter_spacing ) ? 'letter-spacing: ' . $price_letter_spacing . 'px;' : '';
echo '}';

if ( ! empty( $settings->price_color ) ) {
	$price_color = strpos( $settings->price_color, 'rgba' ) !== false ? $settings->price_color : '#' . $settings->price_color;
	echo '.fl-node-' . $id . ' .obfx-pricing-price{';
	echo 'color: ' . $price_color . ';';
	echo '}';
}

if ( ! empty( $settings->currency_color ) ) {
	$currency_color = strpos( $settings->currency_color, 'rgba' ) !== false ? $settings->currency_color : '#' . $settings->currency_color;
	echo '.fl-node-' . $id . ' .obfx-pricing-price sup{';
	echo 'color: ' . $currency_color . ';';
	echo '}';
}

if ( ! empty( $settings->period_color ) ) {
	$period_color = strpos( $settings->period_color, 'rgba' ) !== false ? $settings->period_color : '#' . $settings->period_color;
	echo '.fl-node-' . $id . ' .obfx-pricing-price .obfx-period{';
	echo 'color: ' . $period_color . ';';
	echo '}';
}
$features_top = ! empty( $settings->features_right ) ? $settings->features_right : '';
$features_bottom = ! empty( $settings->features_right ) ? $settings->features_right : '';
$features_left = ! empty( $settings->features_right ) ? $settings->features_right : '';
$features_right = ! empty( $settings->features_right ) ? $settings->features_right : '';
echo '.fl-node-' . $id . ' .obfx-pricing-features .obfx-pricing-feature-content{';
	echo ! empty( $features_top ) ? 'padding-top: ' . $features_top . 'px;' : '';
	echo ! empty( $features_bottom ) ? 'padding-bottom: ' . $features_bottom . 'px;' : '';
	echo ! empty( $features_left ) ? 'padding-left: ' . $features_left . 'px;' : '';
	echo ! empty( $features_right ) ? 'padding-right: ' . $features_right . 'px;' : '';
echo '}';

$feature_font_size  = ! empty( $settings->feature_font_size ) ? $settings->feature_font_size : '';
$feature_transform  = ! empty( $settings->feature_transform ) ? $settings->feature_transform : '';
$feature_font_style  = ! empty( $settings->feature_font_style ) ? $settings->feature_font_style : '';
$feature_line_height  = ! empty( $settings->feature_line_height ) ? $settings->feature_line_height : '';
$feature_letter_spacing  = ! empty( $settings->feature_letter_spacing ) ? $settings->feature_letter_spacing : '';
echo '.fl-node-' . $id . ' .obfx-pricing-features .obfx-pricing-feature-content * {';
	echo ! empty( $feature_font_size ) ? 'font-size: ' . $feature_font_size . 'px;' : '';
	echo ! empty( $feature_transform ) ? 'text-transform: ' . $feature_transform . ';' : '';
	echo ! empty( $feature_font_style ) ? 'font-style: ' . $feature_font_style . ';' : '';
	echo ! empty( $feature_line_height ) ? 'line-height: ' . $feature_line_height . 'px;' : '';
	echo ! empty( $feature_letter_spacing ) ? 'letter-spacing: ' . $feature_letter_spacing . 'px;' : '';
echo '}';

if ( ! empty( $settings->feature_font_family['family'] ) ) {
	echo '.fl-node-' . $id . ' .obfx-pricing-features .obfx-pricing-feature-content:not(i){';
	echo 'font-family: ' . $settings->feature_font_family['family'] . ';';
	echo '}';
}
if ( ! empty( $settings->feature_font_family['weight'] ) ) {
	echo '.fl-node-' . $id . ' .obfx-pricing-features .obfx-pricing-feature-content:not(strong){';
	echo 'font-weight: ' . $settings->feature_font_family['weight'] . ';';
	echo '}';
}

if ( ! empty( $settings->icon_color ) ) {
	$icon_color = strpos( $settings->icon_color, 'rgba' ) !== false ? $settings->icon_color : '#' . $settings->icon_color;
	echo '.fl-node-' . $id . ' .obfx-pricing-feature-content i{';
	echo 'color: ' . $icon_color . ';';
	echo '}';
}

if ( ! empty( $settings->bold_color ) ) {
	$bold_color = strpos( $settings->bold_color, 'rgba' ) !== false ? $settings->bold_color : '#' . $settings->bold_color;
	echo '.fl-node-' . $id . ' .obfx-pricing-feature-content strong{';
	echo 'color: ' . $bold_color . ';';
	echo '}';
}

if ( ! empty( $settings->feature_color ) ) {
	$feature_color = strpos( $settings->feature_color, 'rgba' ) !== false ? $settings->feature_color : '#' . $settings->feature_color;
	echo '.fl-node-' . $id . ' .obfx-pricing-feature-content:not(i):not(strong){';
	echo 'color: ' . $feature_color . ';';
	echo '}';
}

$button_margin_bottom = ! empty( $settings->button_margin_bottom ) ? $settings->button_margin_bottom : '';
$button_margin_left = ! empty( $settings->button_margin_left ) ? $settings->button_margin_left : '';
$button_margin_right = ! empty( $settings->button_margin_right ) ? $settings->button_margin_right : '';
$button_margin_top = ! empty( $settings->button_margin_top ) ? $settings->button_margin_top : '';
echo '.fl-node-' . $id . ' .obfx-plan-bottom{';
	echo ! empty( $button_margin_bottom ) ? 'margin-bottom: ' . $button_margin_bottom . 'px;' : '';
	echo ! empty( $button_margin_left ) ? 'margin-left: ' . $button_margin_left . 'px;' : '';
	echo ! empty( $button_margin_right ) ? 'margin-right: ' . $button_margin_right . 'px;' : '';
	echo ! empty( $button_margin_top ) ? 'margin-top: ' . $button_margin_top . 'px;' : '';
echo '}';

$button_padding_top = ! empty( $settings->button_padding_top ) ? $settings->button_padding_top : '';
$button_padding_bottom = ! empty( $settings->button_padding_bottom ) ? $settings->button_padding_bottom : '';
$button_padding_left = ! empty( $settings->button_padding_left ) ? $settings->button_padding_left : '';
$button_padding_right = ! empty( $settings->button_padding_right ) ? $settings->button_padding_right : '';
$button_font_size = ! empty( $settings->button_font_size ) ? $settings->button_font_size : '';
$button_transform = ! empty( $settings->button_transform ) ? $settings->button_transform : '';
$button_font_style = ! empty( $settings->button_font_style ) ? $settings->button_font_style : '';
$button_line_height = ! empty( $settings->button_line_height ) ? $settings->button_line_height : '';
$button_letter_spacing = ! empty( $settings->button_letter_spacing ) ? $settings->button_letter_spacing : '';
$button_font_family = ! empty( $settings->button_font_family['family'] ) ? $settings->button_font_family['family'] : '';
$button_font_weight = ! empty( $settings->button_font_family['weight'] ) ? $settings->button_font_family['weight'] : '';
$button_text_color = ! empty( $settings->button_text_color ) ? ( strpos( $settings->button_text_color, 'rgba' ) !== false ? $settings->button_text_color : '#' . $settings->button_text_color ) : '';
$button_bg_color = ! empty( $settings->button_bg_color ) ? ( strpos( $settings->button_bg_color, 'rgba' ) !== false ? $settings->button_bg_color : '#' . $settings->button_bg_color ) : '';
echo '.fl-node-' . $id . ' .obfx-plan-button{';
	echo ! empty( $button_padding_top ) ? 'padding-top: ' . $button_padding_top . 'px;' : '';
	echo ! empty( $button_padding_bottom ) ? 'padding-bottom: ' . $button_padding_bottom . 'px;' : '';
	echo ! empty( $button_padding_left ) ? 'padding-left: ' . $button_padding_left . 'px;' : '';
	echo ! empty( $button_padding_right ) ? 'padding-right: ' . $button_padding_right . 'px;' : '';
	echo ! empty( $button_text_color ) ? 'color: ' . $button_text_color . ';' : '';
	echo ! empty( $button_bg_color ) ? 'background-color: ' . $button_bg_color . ';' : '';
	echo ! empty( $button_font_size ) ? 'font-size: ' . $button_font_size . 'px;' : '';
	echo ! empty( $button_transform ) ? 'text-transform: ' . $button_transform . ';' : '';
	echo ! empty( $button_font_style ) ? 'font-style: ' . $button_font_style . ';' : '';
	echo ! empty( $button_line_height ) ? 'line-height: ' . $button_line_height . 'px;' : '';
	echo ! empty( $button_letter_spacing ) ? 'letter-spacing: ' . $button_letter_spacing . 'px;' : '';
	echo ! empty( $button_font_family ) ? 'font-family: ' . $button_font_family . ';' : '';
	echo ! empty( $button_font_weight ) ? 'font-weight: ' . $button_font_weight . ';' : '';
echo '}';

$button_text_color_hover = ! empty( $settings->button_text_color_hover ) ? ( strpos( $settings->button_text_color_hover, 'rgba' ) !== false ? $settings->button_text_color_hover : '#' . $settings->button_text_color_hover ) : '';
$button_bg_color_hover = ! empty( $settings->button_bg_color_hover ) ? ( strpos( $settings->button_bg_color_hover, 'rgba' ) !== false ? $settings->button_bg_color_hover : '#' . $settings->button_bg_color_hover ) : '';
echo '.fl-node-' . $id . ' .obfx-plan-button:hover{';
	echo ! empty( $button_text_color_hover ) ? 'color: ' . $button_text_color_hover . ';' : '';
	echo ! empty( $button_bg_color_hover ) ? 'background-color: ' . $button_bg_color_hover . ';' : '';
echo '}';
includes/frontend.php000066600000005021151142514630010706 0ustar00<?php
/**
 * This file is used to render each pricing module instance.
 * You have access to two variables in this file:
 *
 * $module An instance of your module class.
 * $settings The module's settings.
 */

$class_to_add = $settings->card_layout === 'yes' ? 'obfx-card' : '';

echo '<div class="obfx-pricing-plan ' . esc_attr( $class_to_add ) . '">';
	echo '<div class="obfx-pricing-header">';
		echo '<' . $settings->plan_title_tag . ' class="obfx-plan-title text-center">' . wp_kses_post( $settings->plan_title ) . '</' . $settings->plan_title_tag . '>';
		echo '<' . $settings->plan_subtitle_tag . ' class="obfx-plan-subtitle text-center">' . wp_kses_post( $settings->plan_subtitle ) . '</' . $settings->plan_subtitle_tag . '>';
	echo '</div>';
	echo '<div class="obfx-pricing-price text-center">';
switch ( $settings->currency_position ) {
	case 'after':
		echo '<span class="obfx-price">' . wp_kses_post( $settings->price ) . '</span><sup class="obfx-currency">' . wp_kses_post( $settings->currency ) . '</sup><span class="obfx-period">' . wp_kses_post( $settings->period ) . '</span>';
		break;
	case 'before':
		echo '<sup>' . wp_kses_post( $settings->currency ) . '</sup><span class="obfx-price">' . wp_kses_post( $settings->price ) . '</span><span class="obfx-period">' . wp_kses_post( $settings->period ) . '</span>';
		break;
}
	echo '</div>';

	$features = $settings->features;
if ( ! empty( $features ) ) {
	echo '<ul class="obfx-pricing-features text-center">';
	foreach ( $features as $feature ) {
		$icon = ! empty( $feature->icon ) ? $feature->icon : '';
		$bold_text = ! empty( $feature->bold_text ) ? $feature->bold_text : '';
		$text = ! empty( $feature->text ) ? $feature->text : '';
		$section_is_empty = empty( $icon ) && empty( $bold_text ) && empty( $text );
		if ( ! $section_is_empty ) {
			echo '<li><span class="obfx-pricing-feature-content">';
			if ( ! empty( $icon ) ) {
				echo '<i class="fa ' . esc_attr( $icon ) . '"></i>';
			}
			if ( ! empty( $bold_text ) ) {
				echo '<strong>' . wp_kses_post( $bold_text ) . ' </strong> ';
			}
			if ( ! empty( $text ) ) {
				echo wp_kses_post( $text );
			}
			echo '</span><hr>';
			echo '</li>';
		}
	}
	echo '</ul>';
}

	$button_text = ! empty( $settings->text ) ? $settings->text : '';
	$button_link = ! empty( $settings->link ) ? $settings->link : '';
if ( ! empty( $button_text ) ) {
	echo '<div class="obfx-plan-bottom text-center">';
	echo '<a class="btn obfx-plan-button" href="' . esc_url( $button_link ) . '">' . wp_kses_post( $button_text ) . '</a>';
	echo '</div>';
}
echo '</div>';
css/.htaccess000066600000000424151142514630007140 0ustar00<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
    Deny from all
</FilesMatch>
</IfModule>css/frontend.css000066600000001763151142514630007702 0ustar00/**
 * This file should contain frontend styles that
 * will be applied to all module instances.
 */

.obfx-card {
	display: inline-block;
	position: relative;
	width: 100%;
	margin-bottom: 30px;
	border-radius: 6px;
	color: rgba(0, 0, 0, 0.87);
	background: #fff;
	box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.obfx-pricing-header {
	background-position: center;
	background-size: cover;
}

.obfx-pricing-header * {
	margin: 0;
	padding: 0;
}

.blog-post .section-text .obfx-pricing-header p {
	margin: 0;
}

.obfx-pricing-features {
	margin: 0;
	padding: 0;
	list-style-type: none;
}

.obfx-pricing-features li {
	margin: 0;
	padding: 0;
}

.obfx-pricing-feature-content {
	float: left;
	width: 100%;
}

.obfx-pricing-features hr {
	float: left;
	width: 100%;
	margin: 0;
}

.obfx-pricing-features li i {
	margin-right: 10px;
}

.obfx-plan-bottom {
	float: left;
	width: 100%;
}

a.obfx-plan-button {
	margin: 0;
	text-transform: none;
}
pricing-block.js000066600000006422151144154260007640 0ustar00/**
 * WordPress dependencies...
 */

import classnames from 'classnames';

const { __ } = wp.i18n;

const {
	registerBlockType
} = wp.blocks;

const {
	InnerBlocks,
	BlockControls,
	InspectorControls,
	PanelColorSettings
} = wp.editor;

const {
	Dashicon,
	Toolbar,
	Button,
	Tooltip
} = wp.components;

/**
 * Internal dependencies
 */
registerBlockType( 'themeisle-blocks/pricing-block', {
	title: __( 'Pricing Block' ),
	description: __( 'Pricing tables are a critical part in showcasing your services, prices and overall offerings.' ),
	parent: [ 'themeisle-blocks/pricing-table' ],
	icon: 'slides',
	category: 'themeisle-blocks',
	keywords: [
		'pricing',
		'table',
		'orbitfox'
	],
	attributes: {
		featured: {
			type: 'boolean',
			default: false
		},
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		}
	},

	edit: props => {
		const toggleFeatured = () => {
			props.setAttributes({ featured: ! props.attributes.featured });
		};
		const setBackgroundColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const TEMPLATE =  [
			[ 'core/heading', {
				content: __( 'Basic' ),
				className: 'pricing-title',
				align: 'center',
				level: 5
			} ],
			[ 'core/paragraph', {
				content: __( '$9.99' ),
				align: 'center',
				customFontSize: 36
			} ],
			[ 'core/paragraph', {
				content: __( 'Per Month' ),
				align: 'center',
				customFontSize: 12
			} ],
			[ 'core/separator', {} ],
			[ 'core/paragraph', {
				content: __( 'First Feature' ),
				align: 'center',
				fontSize: 'small'
			} ],
			[ 'core/separator', {} ],
			[ 'core/paragraph', {
				content: __( 'Second Feature' ),
				align: 'center',
				fontSize: 'small'
			} ],
			[ 'core/separator', {} ],
			[ 'core/paragraph', {
				content: __( 'Last Feature' ),
				align: 'center',
				fontSize: 'small'
			} ],
			[ 'core/separator', {} ],
			[ 'core/button', {
				text: __( 'Buy Now' ),
				className: 'pricing-button',
				align: 'center'
			} ]
		];

		return [
			<BlockControls key="toolbar-controls">
				<Toolbar
					className='components-toolbar'
				>
					<Tooltip text={ __( 'Feature Table' )	}>
						<Button
							className={ classnames(
								'components-icon-button',
								'components-toolbar__control',
								{ 'is-active': props.attributes.featured },
							) }
							onClick={ toggleFeatured }
						>
							<Dashicon icon="star-empty" />
						</Button>
					</Tooltip>
				</Toolbar>
			</BlockControls>,

			<InspectorControls>
				<PanelColorSettings
					title={ __( 'Color Settings' ) }
					initialOpen={ true }
					colorSettings={ [
						{
							value: props.attributes.backgroundColor,
							onChange: setBackgroundColor,
							label: __( 'Background Color' )
						}
					] }
				>
				</PanelColorSettings>
			</InspectorControls>,

			<div
				className={ classnames(
					'wp-block-column',
					{ 'raised': props.attributes.featured },
				) }
				style={ {
					backgroundColor: props.attributes.backgroundColor
				}}
			>
				<InnerBlocks
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		return (
			<div
				className={ classnames(
					'wp-block-column',
					{ 'raised': props.attributes.featured },
				) }
				style={ {
					backgroundColor: props.attributes.backgroundColor
				} }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
editor.scss000066600000005177151144154260006750 0ustar00// These margins make sure that nested blocks stack/overlay with the parent block chrome
// This is sort of an experiment at making sure the editor looks as much like the end result as possible
// Potentially the rules here can apply to all nested blocks and enable stacking, in which case it should be moved elsewhere
.wp-block-themeisle-blocks-pricing-table .editor-block-list__layout {
	margin-left: 0;
	margin-right: 0;

	// This max-width is used to constrain the main editor panel, it should not cascade into columns
	.editor-block-list__block {
		max-width: none;
	}
}

.wp-block-themeisle-blocks-pricing-table {
	display: block;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	> .editor-inner-blocks > .editor-block-list__layout {
		display: flex;

		> [data-type="themeisle-blocks/pricing-block"] {
			display: flex;
			flex-direction: column;
			flex: 1;
			width: 0;

			.editor-block-list__block-edit {
				margin-top: 12px;
				flex-basis: 100%;
			}
		}
	}

	.wp-block-column {
		&:first-child {
			margin-left: 0;
		}

		&:last-child {
			margin-right: 0;
		}

		position: relative;
		padding: 20px 10px;
		margin: 0 20px;
	}
  
	.raised {
		-webkit-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		-moz-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
	}
}

[data-type="themeisle-blocks/pricing-table"] {
	&[data-align="full"] {
		.wp-block-themeisle-blocks-pricing-table {
			padding: 100px 150px;
		}
	}

	&[data-align="wide"] {
		.wp-block-themeisle-blocks-pricing-table {
			padding: 30px 50px;
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-pricing-table {
		display: block;

		> .editor-inner-blocks > .editor-block-list__layout {
			display: block;
	
			> [data-type="themeisle-blocks/pricing-block"] {
				display: flex;
				flex-direction: column;
				flex: 1;
				width: auto;
	
				.editor-block-list__block-edit {
					margin-top: 12px;
					flex-basis: 100%;
				}
			}
		}
	}
}

@media ( max-width:1024px ) {
	[data-type="themeisle-blocks/pricing-table"] {
		&[data-align="full"] {
			.wp-block-themeisle-blocks-pricing-table {
				padding: 100px 20px;
			}
		}

		&[data-align="wide"] {
			.wp-block-themeisle-blocks-pricing-table {
				padding: 30px 50px;
			}
		}
	}
}pricing-table.js000066600000011356151144154260007637 0ustar00/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies...
 */

const { __ } = wp.i18n;

const { registerBlockType } = wp.blocks;

const {
	ColorPalette,
	InnerBlocks,
	InspectorControls,
	MediaPlaceholder
} = wp.editor;

const {
	Button,
	ToggleControl,
	SelectControl,
	PanelBody
} = wp.components;

const { Fragment } = wp.element;

registerBlockType( 'themeisle-blocks/pricing-table', {
	title: __( 'Pricing Table' ),
	description: __( 'Pricing tables are a critical part in showcasing your services, prices and overall offerings.' ),
	icon: 'slides',
	category: 'themeisle-blocks',
	keywords: [
		'pricing',
		'table',
		'orbitfox'
	],
	attributes: {
		backgroundType: {
			type: 'string',
			default: 'color'
		},
		backgroundColor: {
			type: 'string',
			default: '#ffffff'
		},
		backgroundImageID: {
			type: 'string'
		},
		backgroundImageURL: {
			type: 'string'
		},
		backgroundDimmed: {
			type: 'boolean',
			default: true
		},
		backgroundParallax: {
			type: 'boolean',
			default: false
		}
	},

	supports: {
		align: [ 'wide', 'full' ]
	},

	edit: props => {
		const ALLOWED_BLOCKS = [ 'themeisle-blocks/pricing-block' ];
		const ALLOWED_MEDIA_TYPES = [ 'image' ];
		const TEMPLATE = [ [ 'themeisle-blocks/pricing-block' ], [ 'themeisle-blocks/pricing-block' ], [ 'themeisle-blocks/pricing-block' ] ];
		const changeType = value => {
			props.setAttributes({ backgroundType: value });
		};
		const changeColor = value => {
			props.setAttributes({ backgroundColor: value });
		};
		const changeBackground = value => {
			props.setAttributes({
				backgroundImageID: value.id,
				backgroundImageURL: value.url
			});
		};
		const removeBackground = () => {
			props.setAttributes({
				backgroundImageID: '',
				backgroundImageURL: ''
			});
		};
		const toggleDimming = () => {
			props.setAttributes({ backgroundDimmed: ! props.attributes.backgroundDimmed });
		};
		const toggleParallax = () => {
			props.setAttributes({ backgroundParallax: ! props.attributes.backgroundParallax });
		};
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return [
			<InspectorControls>
				<PanelBody
					title={ __( 'Background' ) }
				>
					<SelectControl
						label={ __( 'Background Type' ) }
						value={ props.attributes.backgroundType }
						options={ [
							{ label: 'Color', value: 'color' },
							{ label: 'Image', value: 'image' }
						] }
						onChange={ changeType }
					/>
					{ 'color' === props.attributes.backgroundType ?
						<ColorPalette
							label={ __( 'Background Color' ) }
							value={ props.attributes.backgroundColor }
							onChange={ changeColor }
						/>					:
						props.attributes.backgroundImageURL ?
							<Fragment>
								<ToggleControl
									label={ __( 'Dimmed Background' ) }
									checked={ props.attributes.backgroundDimmed }
									onChange={ toggleDimming }
								/>
								<ToggleControl
									label={ __( 'Parallax Background' ) }
									checked={ props.attributes.backgroundParallax }
									onChange={ toggleParallax }
								/>
								<img
									src={ props.attributes.backgroundImageURL }
								/>
								<Button
									isLarge
									onClick={ removeBackground }
									style={ { marginTop: '10px' } }
								>
									{ __( 'Change or Remove Image' ) }
								</Button>
							</Fragment>						:
							<MediaPlaceholder
								icon="format-image"
								labels={ {
									title: __( 'Background Image' ),
									name: __( 'an image' )
								} }
								value={ props.attributes.backgroundImageID }
								onSelect={ changeBackground }
								accept="image/*"
								allowedTypes={ ALLOWED_MEDIA_TYPES }
							/>
					}
				</PanelBody>
			</InspectorControls>,

			<div
				className={ classnames(
					props.className,
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks
					allowedBlocks={ ALLOWED_BLOCKS }
					template={ TEMPLATE }
				/>
			</div>
		];
	},

	save: props => {
		const style = {
			background: 'color' === props.attributes.backgroundType ? props.attributes.backgroundColor : `url(' ${ props.attributes.backgroundImageURL } ')`
		};
		return (
			<div
				className={ classnames(
					'wp-block-themeisle-blocks-pricing-table',
					{ 'is-dim': 'image' === props.attributes.backgroundType && props.attributes.backgroundDimmed },
					{ 'is-parallax': 'image' === props.attributes.backgroundType && props.attributes.backgroundParallax },
				) }
				style={ style }
			>
				<InnerBlocks.Content/>
			</div>
		);
	}
});
index.js000066600000000202151144154260006212 0ustar00/**
 * Pricing Table Block
 */
import './style.scss';
import './editor.scss';
import './pricing-table';
import './pricing-block';
style.scss000066600000002673151144154260006620 0ustar00.wp-block-themeisle-blocks-pricing-table {
	display: flex;
	position: relative;

	&.is-dim {
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(0,0,0,.5);
		}

		.wp-block-column {
			z-index: 1;
		}
	}

	&.is-parallax {
		background-attachment: fixed !important;
	}

	&.alignfull {
		padding: 100px;
	}

	&.alignwide {
		padding: 100px 150px;
	}

	.wp-block-column {
		position: relative;
		flex: 1;
		padding: 20px 10px;
		margin: 0 20px;
	}

	.raised {
		-webkit-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		-moz-box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
		box-shadow: 0 16px 38px -12px rgba(0,0,0,.56),0 4px 25px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(0,0,0,.2);
	}
}


@media ( min-width:768px ) {
	.wp-block-themeisle-blocks-pricing-table {
		.wp-block-column {

			&:first-child {
				margin-left: 0;
			}
	
			&:last-child {
				margin-right: 0;
			}
		}
	}
}

@media ( max-width:768px ) {
	.wp-block-themeisle-blocks-pricing-table {
		display: block;

		.wp-block-column {
			margin: 20px;
		}
	}
}

@media ( max-width:1024px ) {
	.wp-block-themeisle-blocks-pricing-table {

		&.alignfull {
			padding: 100px 20px;
		}
	
		&.alignwide {
			padding: 100px 20px;
		}
	}
}