Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/module/field
File: Transform.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class ET_Builder_Module_Field_Transform extends ET_Builder_Module_Field_Base {
[2] Fix | Delete
[3] Fix | Delete
private $processing_props = array();
[4] Fix | Delete
[5] Fix | Delete
public $defaults = array(
[6] Fix | Delete
'scale' => '100%',
[7] Fix | Delete
'translate' => '0px',
[8] Fix | Delete
'rotate' => '0deg',
[9] Fix | Delete
'skew' => '0deg',
[10] Fix | Delete
'origin' => '50%',
[11] Fix | Delete
);
[12] Fix | Delete
[13] Fix | Delete
public $allTransforms = array(
[14] Fix | Delete
'scaleX',
[15] Fix | Delete
'scaleY',
[16] Fix | Delete
'translateX',
[17] Fix | Delete
'translateY',
[18] Fix | Delete
'rotateX',
[19] Fix | Delete
'rotateY',
[20] Fix | Delete
'rotateZ',
[21] Fix | Delete
'skewX',
[22] Fix | Delete
'skewY',
[23] Fix | Delete
'originX',
[24] Fix | Delete
'originY',
[25] Fix | Delete
);
[26] Fix | Delete
[27] Fix | Delete
public function get_fields( array $args = array() ) {
[28] Fix | Delete
static $i18n;
[29] Fix | Delete
[30] Fix | Delete
if ( ! isset( $i18n ) ) {
[31] Fix | Delete
// phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
[32] Fix | Delete
$i18n = array(
[33] Fix | Delete
'scale' => array(
[34] Fix | Delete
'label' => esc_html__( 'Transform Scale', 'et_builder' ),
[35] Fix | Delete
),
[36] Fix | Delete
'translate' => array(
[37] Fix | Delete
'label' => esc_html__( 'Transform Translate', 'et_builder' ),
[38] Fix | Delete
),
[39] Fix | Delete
'rotate' => array(
[40] Fix | Delete
'label' => esc_html__( 'Transform Rotate', 'et_builder' ),
[41] Fix | Delete
),
[42] Fix | Delete
'skew' => array(
[43] Fix | Delete
'label' => esc_html__( 'Transform Skew', 'et_builder' ),
[44] Fix | Delete
),
[45] Fix | Delete
'origin' => array(
[46] Fix | Delete
'label' => esc_html__( 'Transform Origin', 'et_builder' ),
[47] Fix | Delete
),
[48] Fix | Delete
'styles' => array(
[49] Fix | Delete
'label' => esc_html__( 'Transform', 'et_builder' ),
[50] Fix | Delete
'description' => esc_html__( 'Using the transform controls, you can performance visual adjustments to any element using a combination of Scale, Translation, Rotation and Skew settings. This allows you to create advanced design effects without the need of a separate graphic design program.', 'et_builder' ),
[51] Fix | Delete
),
[52] Fix | Delete
);
[53] Fix | Delete
// phpcs:enable
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
$settings = wp_parse_args( array(
[57] Fix | Delete
'option_category' => 'layout',
[58] Fix | Delete
'tab_slug' => 'advanced',
[59] Fix | Delete
'toggle_slug' => 'transform',
[60] Fix | Delete
'depends_on' => null,
[61] Fix | Delete
'depends_show_if' => null,
[62] Fix | Delete
'defaults' => $this->defaults,
[63] Fix | Delete
), $args );
[64] Fix | Delete
[65] Fix | Delete
$additional_options = array();
[66] Fix | Delete
$defaults = $settings['defaults'];
[67] Fix | Delete
[68] Fix | Delete
$tabs = array(
[69] Fix | Delete
'scale' => array(
[70] Fix | Delete
'icon' => 'resize',
[71] Fix | Delete
'controls' => array(
[72] Fix | Delete
'transform_scale' => array(
[73] Fix | Delete
'type' => 'transform',
[74] Fix | Delete
'label' => $i18n['scale']['label'],
[75] Fix | Delete
'default' => "${defaults['scale']}|${defaults['scale']}",
[76] Fix | Delete
'default_unit' => '%',
[77] Fix | Delete
'range_settings' => array(
[78] Fix | Delete
'min' => -100,
[79] Fix | Delete
'max' => 300,
[80] Fix | Delete
'step' => 1,
[81] Fix | Delete
),
[82] Fix | Delete
'context' => 'transform_styles',
[83] Fix | Delete
'mobile_options' => true,
[84] Fix | Delete
),
[85] Fix | Delete
),
[86] Fix | Delete
),
[87] Fix | Delete
'translate' => array(
[88] Fix | Delete
'icon' => 'move',
[89] Fix | Delete
'controls' => array(
[90] Fix | Delete
'transform_translate' => array(
[91] Fix | Delete
'type' => 'transform',
[92] Fix | Delete
'label' => $i18n['translate']['label'],
[93] Fix | Delete
'default' => "${defaults['translate']}|${defaults['translate']}",
[94] Fix | Delete
'default_unit' => 'px',
[95] Fix | Delete
'range_settings' => array(
[96] Fix | Delete
'min' => -300,
[97] Fix | Delete
'max' => 300,
[98] Fix | Delete
'step' => 1,
[99] Fix | Delete
),
[100] Fix | Delete
'context' => 'transform_styles',
[101] Fix | Delete
'mobile_options' => true,
[102] Fix | Delete
),
[103] Fix | Delete
),
[104] Fix | Delete
),
[105] Fix | Delete
'rotate' => array(
[106] Fix | Delete
'icon' => 'rotate',
[107] Fix | Delete
'controls' => array(
[108] Fix | Delete
'transform_rotate' => array(
[109] Fix | Delete
'type' => 'transform',
[110] Fix | Delete
'label' => $i18n['rotate']['label'],
[111] Fix | Delete
'default' => "${defaults['rotate']}|${defaults['rotate']}|${defaults['rotate']}",
[112] Fix | Delete
'default_unit' => 'deg',
[113] Fix | Delete
'range_settings' => array(
[114] Fix | Delete
'min' => 0,
[115] Fix | Delete
'max' => 360,
[116] Fix | Delete
'step' => 1,
[117] Fix | Delete
),
[118] Fix | Delete
'context' => 'transform_styles',
[119] Fix | Delete
'mobile_options' => true,
[120] Fix | Delete
),
[121] Fix | Delete
),
[122] Fix | Delete
),
[123] Fix | Delete
'skew' => array(
[124] Fix | Delete
'icon' => 'skew',
[125] Fix | Delete
'controls' => array(
[126] Fix | Delete
'transform_skew' => array(
[127] Fix | Delete
'type' => 'transform',
[128] Fix | Delete
'label' => $i18n['skew']['label'],
[129] Fix | Delete
'default' => "${defaults['skew']}|${defaults['skew']}",
[130] Fix | Delete
'default_unit' => 'deg',
[131] Fix | Delete
'range_settings' => array(
[132] Fix | Delete
'min' => -180,
[133] Fix | Delete
'max' => 180,
[134] Fix | Delete
'min_limit' => -180,
[135] Fix | Delete
'max_limit' => 180,
[136] Fix | Delete
'step' => 1,
[137] Fix | Delete
),
[138] Fix | Delete
'context' => 'transform_styles',
[139] Fix | Delete
'mobile_options' => true,
[140] Fix | Delete
),
[141] Fix | Delete
),
[142] Fix | Delete
),
[143] Fix | Delete
'origin' => array(
[144] Fix | Delete
'icon' => 'transform-origin',
[145] Fix | Delete
'controls' => array(
[146] Fix | Delete
'transform_origin' => array(
[147] Fix | Delete
'type' => 'transform',
[148] Fix | Delete
'label' => $i18n['origin']['label'],
[149] Fix | Delete
'default' => "${defaults['origin']}|${defaults['origin']}",
[150] Fix | Delete
'default_unit' => '%',
[151] Fix | Delete
'range_settings' => array(
[152] Fix | Delete
'min' => -50,
[153] Fix | Delete
'max' => 150,
[154] Fix | Delete
'step' => 1,
[155] Fix | Delete
),
[156] Fix | Delete
'context' => 'transform_styles',
[157] Fix | Delete
'mobile_options' => true,
[158] Fix | Delete
),
[159] Fix | Delete
),
[160] Fix | Delete
),
[161] Fix | Delete
);
[162] Fix | Delete
[163] Fix | Delete
$additional_options['transform_styles'] = array(
[164] Fix | Delete
'label' => $i18n['styles']['label'],
[165] Fix | Delete
'tab_slug' => $settings['tab_slug'],
[166] Fix | Delete
'toggle_slug' => $settings['toggle_slug'],
[167] Fix | Delete
'type' => 'composite',
[168] Fix | Delete
'attr_suffix' => '',
[169] Fix | Delete
'composite_type' => 'transforms',
[170] Fix | Delete
'hover' => 'tabs',
[171] Fix | Delete
'mobile_options' => true,
[172] Fix | Delete
'responsive' => true,
[173] Fix | Delete
'bb_support' => false,
[174] Fix | Delete
'description' => $i18n['styles']['description'],
[175] Fix | Delete
'composite_structure' => $tabs,
[176] Fix | Delete
);
[177] Fix | Delete
[178] Fix | Delete
//Register responsive options
[179] Fix | Delete
$skip = array(
[180] Fix | Delete
'type' => 'skip',
[181] Fix | Delete
'tab_slug' => $settings['tab_slug'],
[182] Fix | Delete
'toggle_slug' => $settings['toggle_slug'],
[183] Fix | Delete
);
[184] Fix | Delete
$linkedSkip = $skip + array( 'default' => 'on' );
[185] Fix | Delete
[186] Fix | Delete
foreach ( $additional_options['transform_styles']['composite_structure'] as $tab_name => $tab ) {
[187] Fix | Delete
foreach ( $tab['controls'] as $field_name => $field_options ) {
[188] Fix | Delete
$controls = $additional_options['transform_styles']['composite_structure'][ $tab_name ]['controls'];
[189] Fix | Delete
$controls["${field_name}_tablet"] = $skip;
[190] Fix | Delete
$controls["${field_name}_phone"] = $skip;
[191] Fix | Delete
$controls["${field_name}_last_edited"] = $skip;
[192] Fix | Delete
if ( in_array( $field_name, array( 'transform_scale', 'transform_translate', 'transform_skew' ) ) ) {
[193] Fix | Delete
$controls["${field_name}_linked"] = $linkedSkip;
[194] Fix | Delete
$controls["${field_name}_linked_tablet"] = $linkedSkip;
[195] Fix | Delete
$controls["${field_name}_linked_phone"] = $linkedSkip;
[196] Fix | Delete
$controls["${field_name}_linked__hover"] = $linkedSkip;
[197] Fix | Delete
}
[198] Fix | Delete
$additional_options['transform_styles']['composite_structure'][ $tab_name ]['controls'] = $controls;
[199] Fix | Delete
}
[200] Fix | Delete
}
[201] Fix | Delete
$additional_options['transform_styles_last_edited'] = $skip;
[202] Fix | Delete
[203] Fix | Delete
return $additional_options;
[204] Fix | Delete
}
[205] Fix | Delete
[206] Fix | Delete
//Processing functions
[207] Fix | Delete
[208] Fix | Delete
public function percent_to_unit( $percent = 0 ) {
[209] Fix | Delete
if ( strpos( $percent, '%' ) === false ) {
[210] Fix | Delete
return $percent;
[211] Fix | Delete
}
[212] Fix | Delete
$value = (float) trim( str_replace( '%', '', $percent ) );
[213] Fix | Delete
[214] Fix | Delete
return $value / 100;
[215] Fix | Delete
}
[216] Fix | Delete
[217] Fix | Delete
public function set_props( $props ) {
[218] Fix | Delete
$this->processing_props = $props;
[219] Fix | Delete
}
[220] Fix | Delete
[221] Fix | Delete
public function get_setting( $value, $default ) {
[222] Fix | Delete
if ( ! empty( $this->processing_props[ $value ] ) ) {
[223] Fix | Delete
return $this->processing_props[ $value ];
[224] Fix | Delete
} else {
[225] Fix | Delete
return $default;
[226] Fix | Delete
}
[227] Fix | Delete
}
[228] Fix | Delete
[229] Fix | Delete
public function get_option( $typeAxis, $type = 'desktop' ) {
[230] Fix | Delete
$setting = "transform_$typeAxis[0]";
[231] Fix | Delete
$interpreter = array( 'X' => 0, 'Y' => 1, 'Z' => 2 );
[232] Fix | Delete
$index = $interpreter[ $typeAxis[1] ];
[233] Fix | Delete
[234] Fix | Delete
$defaultValue = false;
[235] Fix | Delete
$optionValue = $this->get_setting( $setting, false );
[236] Fix | Delete
[237] Fix | Delete
if ( 'hover' === $type ) {
[238] Fix | Delete
$defaultValue = $this->get_setting( $setting, false );
[239] Fix | Delete
$optionValue = $this->get_setting( $setting . '__hover', false );
[240] Fix | Delete
} elseif ( 'tablet' === $type ) {
[241] Fix | Delete
$defaultValue = $this->get_setting( $setting, false );
[242] Fix | Delete
$optionValue = $this->get_setting( $setting . '_tablet', false );
[243] Fix | Delete
} elseif ( 'phone' === $type ) {
[244] Fix | Delete
$defaultValue = $this->get_setting( $setting . '_tablet', false );
[245] Fix | Delete
$optionValue = $this->get_setting( $setting . '_phone', false );
[246] Fix | Delete
if ( $defaultValue == false ) {
[247] Fix | Delete
$defaultValue = $this->get_setting( $setting, false );
[248] Fix | Delete
}
[249] Fix | Delete
}
[250] Fix | Delete
[251] Fix | Delete
if ( false === $optionValue ) {
[252] Fix | Delete
if ( false !== $defaultValue ) {
[253] Fix | Delete
$optionValue = $defaultValue;
[254] Fix | Delete
}
[255] Fix | Delete
}
[256] Fix | Delete
[257] Fix | Delete
if ( false === $optionValue ) {
[258] Fix | Delete
return '';
[259] Fix | Delete
}
[260] Fix | Delete
[261] Fix | Delete
$valueArray = explode( '|', $optionValue );
[262] Fix | Delete
$value = $valueArray[ $index ];
[263] Fix | Delete
[264] Fix | Delete
if ( 'scale' === $typeAxis[0] ) {
[265] Fix | Delete
return $this->percent_to_unit( $value );
[266] Fix | Delete
}
[267] Fix | Delete
[268] Fix | Delete
return $value;
[269] Fix | Delete
[270] Fix | Delete
}
[271] Fix | Delete
[272] Fix | Delete
public function get_elements( $type ) {
[273] Fix | Delete
if ( empty( $this->processing_props ) ) {
[274] Fix | Delete
wp_die( new WP_Error( '666', 'Run set_props first' ) );
[275] Fix | Delete
}
[276] Fix | Delete
[277] Fix | Delete
$transformElements = array();
[278] Fix | Delete
$originArray = array();
[279] Fix | Delete
foreach ( $this->allTransforms as $option ) {
[280] Fix | Delete
$typeAxis = array();
[281] Fix | Delete
$typeAxis[0] = substr( $option, 0, -1 );
[282] Fix | Delete
$typeAxis[1] = substr( $option, -1 );
[283] Fix | Delete
$value = esc_attr( $this->get_option( $typeAxis, $type ) );
[284] Fix | Delete
if ( ! empty( $value ) ) {
[285] Fix | Delete
if ( 'origin' === $typeAxis[0] ) {
[286] Fix | Delete
if ( 'originY' === $option && empty( $originArray ) ) {
[287] Fix | Delete
//default value of originX
[288] Fix | Delete
array_push( $originArray, '50%' );
[289] Fix | Delete
}
[290] Fix | Delete
array_push( $originArray, $value );
[291] Fix | Delete
} else {
[292] Fix | Delete
$transformElements[ $option ] = $value;
[293] Fix | Delete
}
[294] Fix | Delete
}
[295] Fix | Delete
}
[296] Fix | Delete
[297] Fix | Delete
return array(
[298] Fix | Delete
'transform' => $transformElements,
[299] Fix | Delete
'origin' => $originArray,
[300] Fix | Delete
);
[301] Fix | Delete
}
[302] Fix | Delete
[303] Fix | Delete
public function getTransformDeclaration( $transformElements, $view = 'desktop' ) {
[304] Fix | Delete
$declaration = array();
[305] Fix | Delete
unset( $transformElements['originX'], $transformElements['originY'] );
[306] Fix | Delete
// Perspective is included on when combining with some animations
[307] Fix | Delete
if ( ! empty( $transformElements['perspective'] ) ) {
[308] Fix | Delete
array_push( $declaration, sprintf( 'perspective(%s)', $transformElements['perspective'] ) );
[309] Fix | Delete
}
[310] Fix | Delete
// Transforms must maintain this order to blend correctly with animation rules
[311] Fix | Delete
foreach ( $this->allTransforms as $option ) {
[312] Fix | Delete
if ( ! empty( $transformElements[ $option ] ) ) {
[313] Fix | Delete
array_push( $declaration, sprintf( '%s(%s)', $option, $transformElements[ $option ] ) );
[314] Fix | Delete
}
[315] Fix | Delete
}
[316] Fix | Delete
if ( ! empty( $declaration ) ) {
[317] Fix | Delete
[318] Fix | Delete
if ( $this->processing_props['transforms_important'] || 'hover' === $view ) {
[319] Fix | Delete
array_push( $declaration, '!important' );
[320] Fix | Delete
}
[321] Fix | Delete
[322] Fix | Delete
return sprintf( "transform: %s;", implode( ' ', $declaration ) );
[323] Fix | Delete
}
[324] Fix | Delete
[325] Fix | Delete
return '';
[326] Fix | Delete
}
[327] Fix | Delete
[328] Fix | Delete
/**
[329] Fix | Delete
* @param $animationType
[330] Fix | Delete
* @param $elements
[331] Fix | Delete
* @param $function_name
[332] Fix | Delete
* @param $device
[333] Fix | Delete
*
[334] Fix | Delete
* @return array
[335] Fix | Delete
*/
[336] Fix | Delete
public function transformedAnimation( $animationType, $elements, $function_name, $device ) {
[337] Fix | Delete
if ( 'hover' === $device ) {
[338] Fix | Delete
return array();
[339] Fix | Delete
}
[340] Fix | Delete
$utils = ET_Core_Data_Utils::instance();
[341] Fix | Delete
$startElements = $elements['transform'];
[342] Fix | Delete
$responsive = ET_Builder_Module_Helper_ResponsiveOptions::instance();
[343] Fix | Delete
$direction = $responsive->get_any_value( $this->processing_props, 'animation_direction', 'center', true, $device );
[344] Fix | Delete
$animation_intensity = $utils->array_get( $this->processing_props, "animation_intensity_$animationType", 50 );
[345] Fix | Delete
$module_class = ET_Builder_Element::get_module_order_class( $function_name );
[346] Fix | Delete
$animationName = "et_pb_${animationType}_${direction}_$module_class";
[347] Fix | Delete
$newKeyframe = "@keyframes $animationName";
[348] Fix | Delete
$newAnimationSelector = ".$module_class.et_animated.transformAnim";
[349] Fix | Delete
$newAnimationRules = "animation-name: $animationName;";
[350] Fix | Delete
$newKeyframeRules = '';
[351] Fix | Delete
$transformDeclaration = $this->getTransformDeclaration( $elements['transform'] );
[352] Fix | Delete
$originDeclaration = sprintf( 'transform-origin:%s;', implode( ' ', $elements['origin'] ) );
[353] Fix | Delete
[354] Fix | Delete
$intensity = ! is_numeric( str_replace( '%', '', $animation_intensity ) )
[355] Fix | Delete
? 50
[356] Fix | Delete
: (int) str_replace( '%', '', $animation_intensity );
[357] Fix | Delete
[358] Fix | Delete
// slide animation direction center is the same animation as zoom center
[359] Fix | Delete
if ( 'slide' === $animationType && 'center' === $direction ) {
[360] Fix | Delete
$animationType = 'zoom';
[361] Fix | Delete
}
[362] Fix | Delete
[363] Fix | Delete
// animation transform gets combined with transform settings as described on et-builder-custom-output.jsx processTransform method
[364] Fix | Delete
switch ( $animationType ) {
[365] Fix | Delete
case 'zoom':
[366] Fix | Delete
$scale = ( 100 - $intensity ) * 0.01;
[367] Fix | Delete
$startElements['scaleX'] = $scale * $utils->array_get( $elements['transform'], 'scaleX', 1 );
[368] Fix | Delete
$startElements['scaleY'] = $scale * $utils->array_get( $elements['transform'], 'scaleY', 1 );
[369] Fix | Delete
$startDeclaration = $this->getTransformDeclaration( $startElements );
[370] Fix | Delete
// replace origin declaration to preserve animation direction setting only if transform origin is not set
[371] Fix | Delete
if ( empty( $elements['origin'] ) ) {
[372] Fix | Delete
$originDeclaration = "transform-origin: $direction;";
[373] Fix | Delete
} else {
[374] Fix | Delete
$originDeclaration = sprintf( 'transform-origin: %s;', implode( ' ', $elements['origin'] ) );
[375] Fix | Delete
}
[376] Fix | Delete
$newKeyframeRules = "0%{ $startDeclaration }";
[377] Fix | Delete
$newKeyframeRules .= "100%{opacity:1;$transformDeclaration}";
[378] Fix | Delete
$newAnimationRules .= $originDeclaration;
[379] Fix | Delete
break;
[380] Fix | Delete
case 'slide':
[381] Fix | Delete
$translateY = $utils->array_get( $elements['transform'], 'translateY', '0%' );
[382] Fix | Delete
$translateX = $utils->array_get( $elements['transform'], 'translateX', '0%' );
[383] Fix | Delete
switch ( $direction ) {
[384] Fix | Delete
case 'top':
[385] Fix | Delete
$startElements['translateY'] = sprintf( 'calc(%s%% + %s)', $intensity * -2, $translateY );
[386] Fix | Delete
$startElements['translateX'] = $translateX;
[387] Fix | Delete
break;
[388] Fix | Delete
case 'bottom':
[389] Fix | Delete
$startElements['translateY'] = sprintf( 'calc(%s%% + %s)', $intensity * 2, $translateY );
[390] Fix | Delete
$startElements['translateX'] = $translateX;
[391] Fix | Delete
break;
[392] Fix | Delete
case 'left':
[393] Fix | Delete
$startElements['translateX'] = sprintf( 'calc(%s%% + %s)', $intensity * -2, $translateX );
[394] Fix | Delete
$startElements['translateY'] = $translateY;
[395] Fix | Delete
break;
[396] Fix | Delete
case 'right':
[397] Fix | Delete
$startElements['translateX'] = sprintf( 'calc(%s%% + %s)', $intensity * 2, $translateX );
[398] Fix | Delete
$startElements['translateY'] = $translateY;
[399] Fix | Delete
break;
[400] Fix | Delete
}
[401] Fix | Delete
$startDeclaration = $this->getTransformDeclaration( $startElements );
[402] Fix | Delete
$newKeyframeRules = "0%{ $startDeclaration }";
[403] Fix | Delete
$newKeyframeRules .= "100%{opacity:1;$transformDeclaration}";
[404] Fix | Delete
break;
[405] Fix | Delete
case 'bounce':
[406] Fix | Delete
$translateX = $utils->array_get( $elements['transform'], 'translateX', '0px' );
[407] Fix | Delete
$translateY = $utils->array_get( $elements['transform'], 'translateY', '0px' );
[408] Fix | Delete
switch ( $direction ) {
[409] Fix | Delete
case 'center':
[410] Fix | Delete
$scaleX = (float) $utils->array_get( $elements['transform'], 'scaleX', 1 );
[411] Fix | Delete
$scaleY = (float) $utils->array_get( $elements['transform'], 'scaleY', 1 );
[412] Fix | Delete
[413] Fix | Delete
$newKeyframeRules = 'from, 20%, 40%, 60%, 80%, to {animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);}';
[414] Fix | Delete
[415] Fix | Delete
$startElements['scaleX'] = 0.3 * $scaleX;
[416] Fix | Delete
$startElements['scaleY'] = 0.3 * $scaleY;
[417] Fix | Delete
$newKeyframeRules .= sprintf( '0%%{%s}', $this->getTransformDeclaration( $startElements ) );
[418] Fix | Delete
$startElements['scaleX'] = 1.1 * $scaleX;
[419] Fix | Delete
$startElements['scaleY'] = 1.1 * $scaleY;
[420] Fix | Delete
$newKeyframeRules .= sprintf( '20%%{%s}', $this->getTransformDeclaration( $startElements ) );
[421] Fix | Delete
$startElements['scaleX'] = 0.9 * $scaleX;
[422] Fix | Delete
$startElements['scaleY'] = 0.9 * $scaleY;
[423] Fix | Delete
$newKeyframeRules .= sprintf( '40%%{%s}', $this->getTransformDeclaration( $startElements ) );
[424] Fix | Delete
$startElements['scaleX'] = 1.03 * $scaleX;
[425] Fix | Delete
$startElements['scaleY'] = 1.03 * $scaleY;
[426] Fix | Delete
$newKeyframeRules .= sprintf( '60%%{%s}', $this->getTransformDeclaration( $startElements ) );
[427] Fix | Delete
$startElements['scaleX'] = 0.97 * $scaleX;
[428] Fix | Delete
$startElements['scaleY'] = 0.97 * $scaleY;
[429] Fix | Delete
$newKeyframeRules .= sprintf( '80%%{%s}', $this->getTransformDeclaration( $startElements ) );
[430] Fix | Delete
$newKeyframeRules .= "100%{opacity: 1;$transformDeclaration}";
[431] Fix | Delete
break;
[432] Fix | Delete
case 'top':
[433] Fix | Delete
$newKeyframeRules = 'from, 60%, 75%, 90%, to {animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);}';
[434] Fix | Delete
[435] Fix | Delete
$startElements['translateY'] = "calc(-200px + $translateY)";
[436] Fix | Delete
$newKeyframeRules .= sprintf( '0%%{%s}', $this->getTransformDeclaration( $startElements ) );
[437] Fix | Delete
$startElements['translateY'] = "calc(25px + $translateY)";
[438] Fix | Delete
$newKeyframeRules .= sprintf( '60%%{%s}', $this->getTransformDeclaration( $startElements ) );
[439] Fix | Delete
$startElements['translateY'] = "calc(-10px + $translateY)";
[440] Fix | Delete
$newKeyframeRules .= sprintf( '75%%{%s}', $this->getTransformDeclaration( $startElements ) );
[441] Fix | Delete
$startElements['translateY'] = "calc(5px + $translateY)";
[442] Fix | Delete
$newKeyframeRules .= sprintf( '90%%{%s}', $this->getTransformDeclaration( $startElements ) );
[443] Fix | Delete
$newKeyframeRules .= "100%{opacity: 1;$transformDeclaration}";
[444] Fix | Delete
break;
[445] Fix | Delete
case 'bottom':
[446] Fix | Delete
$newKeyframeRules = 'from, 60%, 75%, 90%, to {animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);}';
[447] Fix | Delete
[448] Fix | Delete
$startElements['translateY'] = "calc(200px + $translateY)";
[449] Fix | Delete
$newKeyframeRules .= sprintf( '0%%{%s}', $this->getTransformDeclaration( $startElements ) );
[450] Fix | Delete
$startElements['translateY'] = "calc(-25px + $translateY)";
[451] Fix | Delete
$newKeyframeRules .= sprintf( '60%%{%s}', $this->getTransformDeclaration( $startElements ) );
[452] Fix | Delete
$startElements['translateY'] = "calc(10px + $translateY)";
[453] Fix | Delete
$newKeyframeRules .= sprintf( '75%%{%s}', $this->getTransformDeclaration( $startElements ) );
[454] Fix | Delete
$startElements['translateY'] = "calc(-5px + $translateY)";
[455] Fix | Delete
$newKeyframeRules .= sprintf( '90%%{%s}', $this->getTransformDeclaration( $startElements ) );
[456] Fix | Delete
$newKeyframeRules .= "100%{opacity: 1;$transformDeclaration}";
[457] Fix | Delete
break;
[458] Fix | Delete
case 'left':
[459] Fix | Delete
$newKeyframeRules = 'from, 60%, 75%, 90%, to {animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);}';
[460] Fix | Delete
[461] Fix | Delete
$startElements['translateX'] = "calc(-200px + $translateX)";
[462] Fix | Delete
$newKeyframeRules .= sprintf( '0%%{%s}', $this->getTransformDeclaration( $startElements ) );
[463] Fix | Delete
$startElements['translateX'] = "calc(25px + $translateX)";
[464] Fix | Delete
$newKeyframeRules .= sprintf( '60%%{%s}', $this->getTransformDeclaration( $startElements ) );
[465] Fix | Delete
$startElements['translateX'] = "calc(-10px + $translateX)";
[466] Fix | Delete
$newKeyframeRules .= sprintf( '75%%{%s}', $this->getTransformDeclaration( $startElements ) );
[467] Fix | Delete
$startElements['translateX'] = "calc(5px + $translateX)";
[468] Fix | Delete
$newKeyframeRules .= sprintf( '90%%{%s}', $this->getTransformDeclaration( $startElements ) );
[469] Fix | Delete
$newKeyframeRules .= "100%{opacity: 1;$transformDeclaration}";
[470] Fix | Delete
break;
[471] Fix | Delete
case 'right':
[472] Fix | Delete
$newKeyframeRules = 'from, 60%, 75%, 90%, to {animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);}';
[473] Fix | Delete
[474] Fix | Delete
$startElements['translateX'] = "calc(200px + $translateX)";
[475] Fix | Delete
$newKeyframeRules .= sprintf( '0%%{%s}', $this->getTransformDeclaration( $startElements ) );
[476] Fix | Delete
$startElements['translateX'] = "calc(-25px + $translateX)";
[477] Fix | Delete
$newKeyframeRules .= sprintf( '60%%{%s}', $this->getTransformDeclaration( $startElements ) );
[478] Fix | Delete
$startElements['translateX'] = "calc(10px + $translateX)";
[479] Fix | Delete
$newKeyframeRules .= sprintf( '75%%{%s}', $this->getTransformDeclaration( $startElements ) );
[480] Fix | Delete
$startElements['translateX'] = "calc(-5px + $translateX)";
[481] Fix | Delete
$newKeyframeRules .= sprintf( '90%%{%s}', $this->getTransformDeclaration( $startElements ) );
[482] Fix | Delete
$newKeyframeRules .= "100%{opacity: 1;$transformDeclaration}";
[483] Fix | Delete
break;
[484] Fix | Delete
}
[485] Fix | Delete
break;
[486] Fix | Delete
case 'flip':
[487] Fix | Delete
$intensityAngle = ceil( ( 90 / 100 ) * $intensity );
[488] Fix | Delete
$startElements['perspective'] = '2000px';
[489] Fix | Delete
[490] Fix | Delete
$rotateX = (float) str_replace( 'deg', '', $utils->array_get( $elements['transform'], 'rotateX', '0' ) );
[491] Fix | Delete
$rotateY = (float) str_replace( 'deg', '', $utils->array_get( $elements['transform'], 'rotateY', '0' ) );
[492] Fix | Delete
switch ( $direction ) {
[493] Fix | Delete
default :
[494] Fix | Delete
case 'top' :
[495] Fix | Delete
$intensityAngle += $rotateX;
[496] Fix | Delete
$startElement['rotateX'] = "{$intensityAngle}deg";
[497] Fix | Delete
break;
[498] Fix | Delete
case 'bottom' :
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function