| 1 |
<?php |
| 2 |
namespace MBSocial; |
| 3 |
defined('ABSPATH') or die('No direct access permitted'); |
| 4 |
|
| 5 |
class horizontalStyle extends style |
| 6 |
{ |
| 7 |
public $class = 'stretch'; |
| 8 |
public $name = 'stretch'; |
| 9 |
public $description = " Stretch Style "; |
| 10 |
|
| 11 |
public $has_label = true; |
| 12 |
|
| 13 |
public $display = array('normal' => 'icon,count', |
| 14 |
'hover' => 'icon,count,label', |
| 15 |
); |
| 16 |
|
| 17 |
public function __construct() |
| 18 |
{ |
| 19 |
parent::__construct(); |
| 20 |
|
| 21 |
|
| 22 |
// $this->css['maxsocial']['flex'] = '1.2'; |
| 23 |
$this->addCSS('display', 'flex', 'maxsocial'); |
| 24 |
|
| 25 |
$this->addCSS('flex', '1.2', 'mb-item', 'hover'); |
| 26 |
|
| 27 |
$itemcss = array('flex' => 1, |
| 28 |
'float' => 'left', |
| 29 |
'height' => '100%', |
| 30 |
'-webkit-transition' => 'all .1s linear', |
| 31 |
'transition' => 'all .1s linear', |
| 32 |
); |
| 33 |
$this->addCSS($itemcss, '','mb-item'); |
| 34 |
|
| 35 |
$this->addCSS ( array ( |
| 36 |
'display' => 'block', |
| 37 |
'display' => '-webkit-box', |
| 38 |
'display' => '-webkit-flex', |
| 39 |
'display' => '-moz-box', |
| 40 |
'display' => '-ms-flexbox', |
| 41 |
'display' => 'flex', |
| 42 |
'text-transform' => 'none', |
| 43 |
'-webkit-flex-flow' => 'row wrap', |
| 44 |
'-ms-flex-flow' => 'row wrap', |
| 45 |
'flex-flow' => 'row wrap', |
| 46 |
'width' => '100%', |
| 47 |
), |
| 48 |
'', |
| 49 |
'mb-social'); |
| 50 |
|
| 51 |
$this->addCSS('flex', '1.2', 'maxbutton-social', 'hover'); |
| 52 |
|
| 53 |
// the label |
| 54 |
$this->addCSS ( array ( |
| 55 |
'text-align' => 'center', |
| 56 |
'flex-grow' => 3, |
| 57 |
'margin' => 'auto', |
| 58 |
'display' => 'none', |
| 59 |
'opacity' => 0, |
| 60 |
'-webkit-transition' => 'all .4s linear', |
| 61 |
'transition' => 'all .4s linear', |
| 62 |
), |
| 63 |
'', |
| 64 |
'mb-label' |
| 65 |
); |
| 66 |
|
| 67 |
// label hover |
| 68 |
$this->addCSS( array( |
| 69 |
'display' => 'inline-block', |
| 70 |
'opacity' => '1', |
| 71 |
|
| 72 |
), |
| 73 |
'', |
| 74 |
'mb-label', |
| 75 |
'hover' |
| 76 |
|
| 77 |
); |
| 78 |
|
| 79 |
$this->addCSS ( array ( |
| 80 |
'text-align' => 'center', |
| 81 |
'flex-grow' => 2, |
| 82 |
'margin' => 'auto', |
| 83 |
), |
| 84 |
'', |
| 85 |
'mb-icon-wrapper' |
| 86 |
); |
| 87 |
|
| 88 |
$this->addCSS ( array ( |
| 89 |
'font-size' => '16px', |
| 90 |
'margin' => 'auto 0', |
| 91 |
//'flex-grow' => '1', |
| 92 |
'display' => 'inline-block', |
| 93 |
'transform' => 'translateX(-10px)', |
| 94 |
), |
| 95 |
'', |
| 96 |
'mb-share-count' |
| 97 |
); |
| 98 |
|
| 99 |
$this->addCSS('flex-grow', '1', 'mb-share-count', 'hover'); |
| 100 |
|
| 101 |
} |
| 102 |
|
| 103 |
public function mainCSS() |
| 104 |
{ |
| 105 |
|
| 106 |
parent::mainCSS(); |
| 107 |
//$this->addFlex('maxcollection'); |
| 108 |
|
| 109 |
// flex collection |
| 110 |
/* $this->addCSS ( array ( |
| 111 |
'flex' => '1.2' |
| 112 |
), |
| 113 |
'', |
| 114 |
'collection-item', |
| 115 |
'hover' |
| 116 |
); |
| 117 |
*/ |
| 118 |
|
| 119 |
// flex item |
| 120 |
/*$this->addCSS ( array ( |
| 121 |
'flex' => 1, |
| 122 |
'float' => 'left', |
| 123 |
'height' => '100%', |
| 124 |
'-webkit-transition' => 'all .1s linear', |
| 125 |
'transition' => 'all .1s linear', |
| 126 |
), |
| 127 |
'', |
| 128 |
'collection-item' |
| 129 |
); |
| 130 |
*/ |
| 131 |
|
| 132 |
|
| 133 |
// $this->addCSS('transform','translateX(-10px)','mb-share-count', 'hover'); |
| 134 |
|
| 135 |
|
| 136 |
} // construct |
| 137 |
|
| 138 |
public function prepareCSS($args) |
| 139 |
{ |
| 140 |
parent::prepareCSS($args); |
| 141 |
|
| 142 |
$default_args = array( |
| 143 |
'orientation' => 'horizontal', |
| 144 |
'is_static' => false, |
| 145 |
); |
| 146 |
|
| 147 |
$args = wp_parse_args($args, $default_args); |
| 148 |
|
| 149 |
if ($args['is_static'] == 1) |
| 150 |
{ |
| 151 |
$this->addCSS(array( |
| 152 |
'width' => '95%', // not 100% due to margins |
| 153 |
'height' => 'auto', |
| 154 |
|
| 155 |
), |
| 156 |
'', |
| 157 |
'mb-social' |
| 158 |
); |
| 159 |
|
| 160 |
|
| 161 |
} |
| 162 |
|
| 163 |
} |
| 164 |
|
| 165 |
public function preParse($css) |
| 166 |
{ |
| 167 |
$css = parent::preParse($css); |
| 168 |
|
| 169 |
$css['mb-social']['normal']['width'] = '100%'; |
| 170 |
|
| 171 |
|
| 172 |
return $css; |
| 173 |
} |
| 174 |
|
| 175 |
} // class |
| 176 |
|
| 177 |
horizontalStyle::registerStyle('stretch'); |
| 178 |
|