コード例 #1
0
ファイル: shortcode.php プロジェクト: jhener79/vlakc
 public static function progress_bar($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('style' => '1', 'percent' => 75, 'show_percent' => 'yes', 'text' => '', 'bar_color' => '', 'fill_color' => '', 'text_color' => '', 'animation' => 'easeInOutExpo', 'duration' => 1.5, 'delay' => 0.3, 'scroll_reveal' => '', 'class' => ''), $atts, 'progress_bar');
     $id = uniqid('suc');
     $css = array();
     $classes = array('su-progress-bar', 'su-progress-bar-style-' . $atts['style'], su_ecssc($atts));
     if ($atts['bar_color']) {
         $css[] = '#' . $id . '.su-progress-bar { background-color:' . $atts['bar_color'] . '; border-color:' . su_color::darken($atts['bar_color'], '10%') . ';' . '}';
     }
     if ($atts['fill_color'] or $atts['text_color']) {
         $fill_color = $atts['fill_color'] ? 'background-color:' . $atts['fill_color'] . ';' : '';
         $text_color = $atts['text_color'] ? 'color:' . $atts['text_color'] . ';' : '';
         $css[] = '#' . $id . '.su-progress-bar > span {' . $fill_color . $text_color . '}';
     }
     $text = $atts['text'] ? '<span class="su-pb-text">' . $atts['text'] . '</span>' : '';
     $show_percent = $atts['show_percent'] !== 'no' ? '<span class="su-pb-percent">' . $atts['percent'] . '%</span>' : '';
     // Add CSS and JS in head
     suAsset::addFile('css', 'progress-bar.css', __FUNCTION__);
     suAsset::addFile('js', 'jquery.easing.js');
     suAsset::addFile('js', 'jquery.appear.js');
     suAsset::addFile('js', 'progress-bar.js', __FUNCTION__);
     suAsset::addString('css', implode("\n", $css));
     $return = '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '"><span class="su-pb-fill" data-percent="' . $atts['percent'] . '" data-animation="' . $atts['animation'] . '" data-duration="' . $atts['duration'] . '" data-delay="' . $atts['delay'] . '">' . $text . $show_percent . '</span></div>';
     return $return;
 }
コード例 #2
0
ファイル: shortcode.php プロジェクト: jhener79/vlakc
 public static function user_content($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('message' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_USER_CONTENT_DEFAULT_MESSAGE'), 'color' => '#ffcc00', 'login_text' => JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_LOGIN'), 'login_url' => JRoute::_('index.php?option=com_users&view=login'), 'scroll_reveal' => '', 'class' => ''), $atts, 'user_content');
     $user = JFactory::getUser();
     if ($user->guest) {
         suAsset::addFile('css', 'user_content.css', __FUNCTION__);
         $login = '******' . esc_attr($atts['login_url']) . '">' . $atts['login_text'] . '</a>';
         return '<div' . su_scroll_reveal($atts) . ' class="su-user_content' . su_ecssc($atts) . '" style="background-color:' . su_color::lighten($atts['color']) . ';border-color:' . su_color::darken($atts['color'], '10%') . ';color:' . su_color::darken($atts['color'], '40%') . '">' . str_replace('%login%', $login, su_scattr($atts['message'])) . '</div>';
     } else {
         return su_do_shortcode($content);
     }
 }
コード例 #3
0
ファイル: shortcode.php プロジェクト: jhener79/vlakc
 public static function heading($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('style' => 'default', 'size' => '', 'align' => 'center', 'style_color' => '', 'margin' => '', 'width' => '', 'heading' => 'h3', 'color' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'heading');
     $id = uniqid('suhead');
     $css = array();
     $width = $atts['width'] ? 'width: ' . intVal($atts['width']) . '%;' : '';
     $margin = $atts['margin'] ? 'margin-bottom: ' . intVal($atts['margin']) . 'px;' : '';
     $size = $atts['size'] ? 'font-size: ' . intVal($atts['size']) . 'px;line-height: ' . $atts['size'] . 'px;' : '';
     $color = $atts['color'] ? ' color: ' . $atts['color'] . ';' : '';
     if ($atts['width'] or $atts['margin']) {
         $css[] = '#' . $id . '.su-heading {' . $width . $margin . '}';
     }
     if ($atts['size'] or $atts['color']) {
         $css[] = '#' . $id . '.su-heading .su-heading-inner {' . $size . $color . '}';
     }
     if ($atts['style_color']) {
         if ($atts['style'] == 1 or $atts['style'] == 2 or $atts['style'] == 3) {
             $css[] = '#' . $id . ' .su-heading-inner:before {background: ' . $atts['style_color'] . '}';
         }
         if ($atts['style'] == 4) {
             $css[] = '#' . $id . ' .su-heading-inner {border-bottom-color: ' . $atts['style_color'] . '}';
         }
         if ($atts['style'] == 5) {
             $css[] = '#' . $id . ' .su-heading-inner:before, #' . $id . ' .su-heading-inner:after { background-image: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'5\' height=\'10\' viewBox=\'0 0 5 10\'><line x1=\'-2\' y1=\'1\' x2=\'7\' y2=\'10\' stroke=\'' . $atts['style_color'] . '\' stroke-width=\'1\'/><line x1=\'-2\' y1=\'6\' x2=\'7\' y2=\'15\' stroke=\'' . $atts['style_color'] . '\' stroke-width=\'1\'/><line x1=\'-2\' y1=\'-4\' x2=\'7\' y2=\'5\' stroke=\'' . $atts['style_color'] . '\' stroke-width=\'1\'/></svg>");}';
         }
         if ($atts['style'] == 6) {
             $css[] = '#' . $id . ' .su-heading-inner:before { background-image: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'11\' height=\'8\' viewBox=\'0 0 100 100\' xml:space=\'preserve\'><rect x=\'14.614\' y=\'14.824\' transform=\'matrix(0.7071 -0.7071 0.7071 0.7071 -20.8159 49.9564)\' fill=\'' . $atts['style_color'] . '\' width=\'70\' height=\'70\'/></svg>");}';
         }
         if ($atts['style'] == 7) {
             $css[] = '#' . $id . ' .su-heading-inner:before { background-image: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'9\' height=\'6\' viewBox=\'0 0 100 100\' xml:space=\'preserve\'><circle fill=\'' . $atts['style_color'] . '\' cx=\'50\' cy=\'50\' r=\'50\'/></svg>");}';
         }
         if ($atts['style'] == 8) {
             $css[] = '#' . $id . ' .su-heading-inner:before { background-image: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'122px\' height=\'12px\' viewBox=\'0 0 122 12\' enable-background=\'new 0 0 122 12\' xml:space=\'preserve\'><circle fill=\'transparent\' stroke=\'' . su_color::darken($atts['style_color'], '10%') . '\' stroke-width=\'2\' cx=\'61\' cy=\'6\' r=\'5\'/><rect y=\'5\' width=\'50\' height=\'1\' fill=\'' . $atts['style_color'] . '\' /><rect x=\'72\' y=\'5\' width=\'50\' height=\'1\' fill=\'' . $atts['style_color'] . '\'/></svg>");}';
         }
         if ($atts['style'] == 9) {
             $css[] = '#' . $id . ' .su-heading-inner:before { background-image: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' x=\'0px\' y=\'0px\' viewBox=\'-244 391 122 12\' style=\'enable-background:new -244 391 122 12;\' xml:space=\'preserve\'><polygon points=\'-172.6,391 -173.8,391 -175.6,392.8 -183,400.2 -190.4,392.8 -192.2,391 -193.4,391 -244,391 -244,392.8 -192.9,392.8 -183,402.7 -173.1,392.8 -122,392.8 -122,391 \' fill=\'' . $atts['style_color'] . '\'/></svg>");}';
         }
     }
     // Add CSS in head
     suAsset::addFile('css', 'heading.css', __FUNCTION__);
     suAsset::addString('css', implode("\n", $css));
     return '<div id="' . $id . '"' . su_scroll_reveal($atts) . ' class="su-heading su-heading-style-' . $atts['style'] . ' su-heading-align-' . $atts['align'] . su_ecssc($atts) . '"><' . $atts['heading'] . ' class="su-heading-inner">' . su_do_shortcode($content) . '</' . $atts['heading'] . '></div>';
 }
コード例 #4
0
ファイル: shortcode.php プロジェクト: jhener79/vlakc
 public static function button($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('style' => 'default', 'url' => '#', 'target' => 'self', 'color' => '#FFFFFF', 'background' => '#2D89EF', 'background_hover' => '', 'size' => 3, 'wide' => 'no', 'center' => 'no', 'radius' => '3px', 'icon' => false, 'icon_color' => '#FFFFFF', 'desc' => '', 'onclick' => '', 'rel' => '', 'title' => '', 'padding' => '', 'margin' => '', 'scroll_reveal' => '', 'class' => ''), $atts, 'button');
     // Initioal Variables
     $id = uniqid('subtn_');
     $css = array();
     $js = array();
     $borderBtn = '';
     $borderBtnHover = '';
     // Prepare vars
     $before = $after = '';
     // Common styles for button
     $btn_size = round(($atts['size'] + 7) * 1.25);
     // Background hover check
     if ($atts['background_hover']) {
         $bg_hover = $atts['background_hover'];
     } elseif ($atts['background'] != 'transparent') {
         $bg_hover = su_color::lighten($atts['background']);
     } else {
         $bg_hover = '';
     }
     $lineheight = $atts['icon'] ? 'line-height:' . round($btn_size * 1.5) . 'px;' : 'line-height:' . round($btn_size * 2) . 'px;';
     if ($atts['padding']) {
         $padding = 'padding: ' . $atts['padding'] . ';';
     } else {
         $padding = $atts['icon'] ? 'padding: ' . round($atts['size'] / 2 + 4) . 'px ' . round($atts['size'] * 2 + 10) . 'px;' : 'padding: ' . '4px ' . round($atts['size'] * 2 + 10) . 'px;';
     }
     $radius = $atts['radius'] ? '-webkit-border-radius: ' . $atts['radius'] . '; border-radius: ' . $atts['radius'] . ';' : '';
     $margin = $atts['margin'] ? 'margin: ' . $atts['margin'] . ';' : '';
     if ($atts['style'] === 'border') {
         $borderBtn = 'border-color: ' . $atts['color'] . ';';
         $borderBtnHover = 'border-color: ' . su_color::lighten($atts['color']) . ';';
     }
     // CSS rules for <a> tag
     $css[] = 'a#' . $id . ' { color: ' . $atts['color'] . '; background-color: ' . $atts['background'] . ';' . $radius . $borderBtn . $margin . '}';
     $css[] = 'a#' . $id . ' span { font-size: ' . $btn_size . 'px;' . $radius . $lineheight . $padding . '}';
     if ($bg_hover) {
         $css[] = 'a#' . $id . ':hover { background-color: ' . $bg_hover . ';}';
     } elseif ($atts['style'] === 'border') {
         $css[] = 'a#' . $id . ':hover {' . $borderBtnHover . '}';
     }
     if ($atts['desc']) {
         $css[] = 'a#' . $id . ' small {padding-bottom:' . round($atts['size'] / 2 + 4) . 'px;color: ' . $atts['color'] . ';}';
     }
     if ($atts['style'] === '3d') {
         $css[] = 'a#' . $id . '.su-button-style-3d { box-shadow: 0 ' . round($atts['size']) . 'px 0 ' . su_color::darken($atts['background'], '6%') . '; }';
         $css[] = 'a#' . $id . '.su-button-style-3d:active { box-shadow: 0 1px 0 ' . su_color::darken($atts['background'], '8%') . '; top: ' . round($atts['size'] - 1) . 'px }';
     }
     // Prepare button classes
     $classes = array('su-button', 'su-button-style-' . $atts['style']);
     // Additional classes
     if ($atts['class']) {
         $classes[] = $atts['class'];
     }
     // Wide class
     if ($atts['wide'] === 'yes') {
         $classes[] = 'su-button-wide';
     }
     // Prepare icon
     if ($atts['icon']) {
         if (strpos($atts['icon'], 'licon:') !== false) {
             suAsset::addFile('css', 'linea.css');
             $icon = '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>';
             $css[] = 'a#' . $id . ' i {font-size:' . $btn_size . 'px; color:' . $atts['icon_color'] . '}';
         } elseif (strpos($atts['icon'], 'icon:') !== false) {
             $icon = '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>';
             $css[] = 'a#' . $id . ' i {font-size:' . $btn_size . 'px; color:' . $atts['icon_color'] . '}';
         } else {
             $icon = '<img src="' . image_media($atts['icon']) . '" alt="' . esc_attr($content) . '"/>';
             $css[] = 'a#' . $id . ' img {width:' . round($btn_size * 1.5) . 'px; height:' . round($btn_size * 1.5) . 'px;}';
         }
     } else {
         $icon = '';
     }
     // Prepare <small> with description
     $desc = $atts['desc'] ? '<small>' . su_scattr($atts['desc']) . '</small>' : '';
     // Wrap with div if button centered
     if ($atts['center'] === 'yes') {
         $before .= '<div class="su-button-center">';
         $after .= '</div>';
     }
     // Replace icon marker in content,
     // add float-icon class to rearrange margins
     if (strpos($content, '%icon%') !== false) {
         $content = str_replace('%icon%', $icon, $content);
         $classes[] = 'su-button-float-icon';
     } else {
         $content = $icon . ' ' . $content;
     }
     // Prepare onclick action
     $atts['onclick'] = $atts['onclick'] ? ' onClick="' . $atts['onclick'] . '"' : '';
     // Prepare rel attribute
     $atts['rel'] = $atts['rel'] ? ' rel="' . $atts['rel'] . '"' : '';
     // Prepare title attribute
     $atts['title'] = $atts['title'] ? ' title="' . $atts['title'] . '"' : '';
     // put css in head
     suAsset::addFile('css', 'button.css', __FUNCTION__);
     suAsset::addString('css', implode("\n", $css));
     return $before . '<a id="' . $id . '" href="' . su_scattr($atts['url']) . '"' . su_scroll_reveal($atts) . ' class="' . su_acssc($classes) . '" target="_' . $atts['target'] . '"' . $atts['onclick'] . $atts['rel'] . $atts['title'] . '><span>' . su_do_shortcode(stripcslashes($content)) . $desc . '</span></a>' . $after;
 }
コード例 #5
0
ファイル: shortcode.php プロジェクト: jhener79/vlakc
 public static function _plan($atts = null, $content = null)
 {
     $atts = su_shortcode_atts(array('name' => 'Standard', 'price' => '19.99', 'before' => '$', 'after' => '', 'period' => 'per month', 'featured' => 'no', 'icon' => '', 'icon_color' => '#666666', 'btn_url' => '#', 'btn_target' => 'self', 'btn_text' => 'Sign up Now', 'btn_color' => '#ffffff', 'btn_background' => '#4FC1E9', 'btn_background_hover' => '#1AA0D1', 'badge' => '', 'badge_background' => '#999999', 'background' => '#FFFFFF', 'color' => '#444444', 'class' => ''), $atts, 'plan');
     $id = uniqid('plan_');
     $css = array();
     $icon = '';
     $badge = '';
     if ($atts['icon']) {
         $icon .= '<div class="su-plan-icon">';
         if (strpos($atts['icon'], '/') !== false) {
             $icon .= '<img src="' . image_media($atts['icon']) . '" alt="" width="' . $atts['size'] . '" height="' . $atts['size'] . '" />';
         } elseif (strpos($atts['icon'], 'licon:') !== false) {
             suAsset::addFile('css', 'linea.css');
             $icon .= '<i class="li li-' . trim(str_replace('licon:', '', $atts['icon'])) . '"></i>';
             $css[] = '#' . $id . ' .su-plan-icon i { color:' . $atts['icon_color'] . '}';
         } elseif (strpos($atts['icon'], 'icon:') !== false) {
             $icon .= '<i class="fa fa-' . trim(str_replace('icon:', '', $atts['icon'])) . '"></i>';
             $css[] = '#' . $id . ' .su-plan-icon i { color:' . $atts['icon_color'] . '}';
         }
         $icon .= '</div>';
     }
     if ($atts['before']) {
         $atts['before'] = '<span class="su-plan-price-before">' . $atts['before'] . '</span>';
     }
     if ($atts['after']) {
         $atts['after'] = '<span class="su-plan-price-after">' . $atts['after'] . '</span>';
     }
     if ($atts['period']) {
         $atts['period'] = '<div class="su-plan-period">' . $atts['period'] . '</div>';
     }
     if ($atts['featured'] === 'yes') {
         $atts['class'] .= ' su-plan-featured';
     }
     if ($atts['badge']) {
         $badge = '<div class="su-plan-badge">' . $atts['badge'] . '</div>';
     }
     $content = trim(strip_tags(su_do_shortcode($content), '<br><ul><li><a><b><strong><i><em><span>'));
     $button = $atts['btn_text'] && $atts['btn_url'] ? '<a href="' . $atts['btn_url'] . '" class="su-plan-button" target="_' . $atts['btn_target'] . '">' . $atts['btn_text'] . '</a>' : '';
     $footer = $button ? '<div class="su-plan-footer">' . $button . '</div>' : '';
     $head_style = $atts['background'] ? 'background-color:' . su_color::darken($atts['background'], '10%') : '';
     $css[] = '#' . $id . ' { background-color:' . $atts['background'] . ';}';
     $css[] = '#' . $id . ' .su-plan-head { border-bottom-color: ' . su_color::lighten($atts['color'], '10%') . ';color:' . $atts['color'] . ';}';
     $css[] = '#' . $id . ' .su-plan-badge { border-color: ' . su_color::darken($atts['badge_background'], '10%') . ';background-color: ' . $atts['badge_background'] . ' }';
     $css[] = '#' . $id . ' .su-plan-name { color: ' . $atts['color'] . ';}';
     $css[] = '#' . $id . ' .su-plan-button { background-color: ' . $atts['btn_background'] . '; color:' . $atts['btn_color'] . ';}';
     $css[] = '#' . $id . ' .su-plan-button:hover { background-color: ' . $atts['btn_background_hover'] . ';}';
     $css[] = '#' . $id . ' .su-plan-footer { border-top-color: ' . su_color::lighten($atts['background'], '10%') . ';background-color:' . $atts['background'] . '; color:' . $atts['btn_background'] . ';}';
     $css[] = '.su-pricing-table.su-pricing-style-4 #' . $id . ' { box-shadow: 0px -5px 0px ' . $atts['btn_background'] . ';}';
     suAsset::addString('css', implode("\n", $css));
     suAsset::addFile('css', 'pricing-table.css', 'plan');
     $return = '<div id="' . $id . '" class="su-plan' . su_ecssc($atts) . '">';
     $return .= '<div class="su-plan-head">';
     $return .= $badge;
     $return .= '<div class="su-plan-name">' . $atts['name'] . '</div>';
     $return .= '<div class="su-plan-price">' . $atts['before'];
     $return .= '<span class="su-plan-price-value">' . $atts['price'] . '</span>' . $atts['after'];
     $return .= '</div>';
     $return .= $atts['period'] . $icon;
     $return .= '</div>';
     $return .= '<div class="su-plan-options">' . $content . '</div>';
     $return .= $footer;
     $return .= '</div>';
     return $return;
 }