当前位置: 首页>>代码示例>>PHP>>正文


PHP Magee_Core::colourBrightness方法代码示例

本文整理汇总了PHP中Magee_Core::colourBrightness方法的典型用法代码示例。如果您正苦于以下问题:PHP Magee_Core::colourBrightness方法的具体用法?PHP Magee_Core::colourBrightness怎么用?PHP Magee_Core::colourBrightness使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magee_Core的用法示例。


在下文中一共展示了Magee_Core::colourBrightness方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

    /**
     * Render the shortcode
     * @param  array $args     Shortcode paramters
     * @param  string $content Content between shortcode
     * @return string          HTML output
     */
    function render($args, $content = '')
    {
        $defaults = Magee_Core::set_shortcode_defaults(array('id' => '', 'class' => '', 'style' => 'normal', 'link' => '#', 'size' => 'middle', 'shape' => '', 'shadow' => 'no', 'block' => 'no', 'target' => '_blank', 'gradient' => 'no', 'color' => '', 'text_color' => '', 'icon' => '', 'icon_animation_type' => '', 'border_width' => 2), $args);
        extract($defaults);
        self::$args = $defaults;
        $class .= ' magee-btn-normal';
        $css_style = ' .magee-btn-normal,.magee-btn-normal:hover{text-decoration:none !important;}';
        $add_class = uniqid('button-');
        $class .= ' ' . $add_class;
        if ($shape != '') {
            $class .= ' btn-' . $shape;
        }
        $border_width = str_replace('px', '', $border_width);
        if ($shadow == 'yes') {
            $class .= ' btn-text-shadow';
        }
        if ($block == 'yes') {
            $class .= ' btn-block';
        }
        if ($gradient == 'yes') {
            $class .= ' btn-gradient';
        }
        switch ($size) {
            case "small":
                $class .= ' btn-sm';
                break;
            case "medium":
                $class .= ' btn-md';
                break;
            case "large":
                $class .= ' btn-lg';
                break;
            case "xlarge":
                $class .= ' btn-xl';
                break;
        }
        switch ($style) {
            case "dark":
                $class .= ' btn-dark';
                break;
            case "light":
                $class .= ' btn-light';
                break;
            case "2d":
                $class .= ' btn-2d';
                break;
            case "3d":
                $class .= ' btn-3d';
                break;
            case "line":
                $class .= ' btn-line';
                if (is_numeric($border_width)) {
                    $css_style .= 'a.' . $add_class . ' {border-width:' . $border_width . 'px !important;}';
                }
                break;
            case "line_dark":
                $class .= ' btn-line btn-dark';
                $css_style .= 'a.' . $add_class . ' {border-width:' . $border_width . 'px !important;}';
                break;
            case "line_light":
                $class .= ' btn-line btn-light';
                $css_style .= 'a.' . $add_class . ' {border-width:' . $border_width . 'px !important;}';
                break;
        }
        if ($icon != '') {
            $animated = '';
            if ($icon_animation_type != '') {
                $animated = 'animated infinite ' . $icon_animation_type;
            }
            $content = '<i class="fa ' . $icon . ' ' . $animated . '"></i>  ' . $content;
        }
        if ($text_color != '') {
            $css_style .= 'a.' . $add_class . ',a.' . $add_class . ':hover{color:' . $text_color . ';}';
            $css_style .= 'a.' . $add_class . ' {color: ' . $text_color . ' !important;border-color: ' . $text_color . ' !important;}';
        }
        if ($color != '') {
            switch ($style) {
                case "normal":
                case "2d":
                    $css_style .= 'a.' . $add_class . ' {background-color:' . $color . ' !important;}';
                    $css_style .= 'a.' . $add_class . ':active,
			a.' . $add_class . ':hover,
			a.' . $add_class . ':focus
			{background-color:' . Magee_Core::colourBrightness($color, -0.9) . ' !important;}';
                    break;
                case "3d":
                    $css_style .= 'a.' . $add_class . ' {background-color:' . $color . ';box-shadow: 0 3px 0 0 ' . Magee_Core::colourBrightness($color, -0.6) . ' !important;}';
                    $css_style .= 'a.' . $add_class . ':active,
			a.' . $add_class . ':hover,
			a.' . $add_class . ':focus
			{background-color:' . Magee_Core::colourBrightness($color, -0.9) . ' !important;}';
                    break;
                case "dark":
                case "light":
//.........这里部分代码省略.........
开发者ID:sourabh-mehra,项目名称:ASVYS-Charity-Foundation,代码行数:101,代码来源:class-button.php


注:本文中的Magee_Core::colourBrightness方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。