本文整理汇总了PHP中qode_hex2rgb函数的典型用法代码示例。如果您正苦于以下问题:PHP qode_hex2rgb函数的具体用法?PHP qode_hex2rgb怎么用?PHP qode_hex2rgb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qode_hex2rgb函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: qode_rgba_color
/**
* Function that generates rgba part of css color property
* @param $color string hex color
* @param $transparency float transparency value between 0 and 1
* @return string generated rgba string
*/
function qode_rgba_color($color, $transparency)
{
if ($color !== '' && $transparency !== '') {
$rgba_color = '';
$rgb_color_array = qode_hex2rgb($color);
$rgba_color .= 'rgba(' . implode(', ', $rgb_color_array) . ', ' . $transparency . ')';
return $rgba_color;
}
}
示例2: qode_hex2rgb
echo $qode_options_proya['popup_menu_hover_background_color_2nd'];
?>
; <?php
}
?>
}
<?php
}
?>
<?php
if (isset($qode_options_proya['popup_menu_background_color']) && !empty($qode_options_proya['popup_menu_background_color']) || !empty($qode_options_proya['popup_menu_background_transparency'])) {
?>
<?php
$popup_menu_background_color = qode_hex2rgb($qode_options_proya['popup_menu_background_color']);
if ($qode_options_proya['popup_menu_background_transparency'] != "") {
$popup_menu_background_transparency = $qode_options_proya['popup_menu_background_transparency'];
} else {
$popup_menu_background_transparency = 0.95;
}
?>
.popup_menu_holder{
background-color: rgba(<?php
echo $popup_menu_background_color[0];
?>
,<?php
echo $popup_menu_background_color[1];
?>
,<?php
echo $popup_menu_background_color[2];
示例3: qode_hex2rgb
} else {
if ($header_color_transparency_per_page != "" && get_post_meta($id, "qode_header_color_per_page", true) == "") {
if (isset($qode_options_theme13['header_top_background_color']) && $qode_options_theme13['header_top_background_color'] != "") {
$header_top_background_color = qode_hex2rgb($qode_options_theme13['header_top_background_color']);
} else {
$header_top_background_color = qode_hex2rgb("#ffffff");
}
$header_top_color_per_page .= "background-color:rgba(" . $header_top_background_color[0] . ", " . $header_top_background_color[1] . ", " . $header_top_background_color[2] . ", " . $header_color_transparency_per_page . ");";
}
}
$header_separator = qode_hex2rgb("#eaeaea");
if (isset($qode_options_theme13['header_separator_color']) && $qode_options_theme13['header_separator_color'] != "") {
$header_separator = qode_hex2rgb($qode_options_theme13['header_separator_color']);
}
if (get_post_meta($id, "qode_header_border_per_page", true) != "") {
$header_separator = qode_hex2rgb(get_post_meta($id, "qode_header_border_per_page", true));
}
$header_border_transparency_per_page = "";
if (isset($qode_options_theme13['header_border_transparency_initial']) && $qode_options_theme13['header_border_transparency_initial'] != "") {
$header_border_transparency_per_page = $qode_options_theme13['header_border_transparency_initial'];
}
if (get_post_meta($id, "qode_header_border_transparency_per_page", true) != "") {
$header_border_transparency_per_page = get_post_meta($id, "qode_header_border_transparency_per_page", true);
}
$header_borders_color_per_page = "";
if ($header_border_transparency_per_page != "") {
$header_borders_color_per_page = "<style type='text/css'> \n\t\t\t.header_top .left .inner > div,\n\t\t\t.header_top .left .inner > div:last-child,\n\t\t\t.header_top .right .inner > div:first-child,\n\t\t\t.header_top .right .inner > div,\n\t\t\theader .header_top .q_social_icon_holder,\n\t\t\t.header_menu_bottom\n\t\t\t{ border-color:rgba(" . $header_separator[0] . ", " . $header_separator[1] . ", " . $header_separator[2] . ", " . $header_border_transparency_per_page . "); } \n\t\t\t\n\t\t\t\t</style>";
} elseif ($header_border_transparency_per_page == "" && get_post_meta($id, "qode_header_border_per_page", true) != "") {
$header_borders_color_per_page = "<style type='text/css'> \n\t\t\t.header_top .left .inner > div,\n\t\t\t.header_top .left .inner > div:last-child,\n\t\t\t.header_top .right .inner > div:first-child,\n\t\t\t.header_top .right .inner > div,\n\t\t\theader .header_top .q_social_icon_holder,\n\t\t\t.header_menu_bottom\n\t\t\t{ border-color:" . get_post_meta($id, "qode_header_border_per_page", true) . "; } \n\t\t\t\n\t\t\t\t</style>";
}
if ($header_border_transparency_per_page != "") {
示例4: qode_hex2rgb
if (get_post_meta($id, "qode_header_color_per_page", true) != "") {
if ($header_color_transparency_per_page != "") {
$header_background_color = qode_hex2rgb(get_post_meta($id, "qode_header_color_per_page", true));
$header_top_color_per_page .= "background-color:rgba(" . $header_background_color[0] . ", " . $header_background_color[1] . ", " . $header_background_color[2] . ", " . $header_color_transparency_per_page . ");";
} else {
$header_top_color_per_page .= "background-color:" . get_post_meta($id, "qode_header_color_per_page", true) . ";";
}
} else {
if ($header_color_transparency_per_page != "" && get_post_meta($id, "qode_header_color_per_page", true) == "") {
$header_background_color = $qode_options_proya['header_top_background_color'] ? qode_hex2rgb($qode_options_proya['header_top_background_color']) : qode_hex2rgb("#ffffff");
$header_top_color_per_page .= "background-color:rgba(" . $header_background_color[0] . ", " . $header_background_color[1] . ", " . $header_background_color[2] . ", " . $header_color_transparency_per_page . ");";
}
}
$header_separator = qode_hex2rgb("#eaeaea");
if (isset($qode_options_proya['header_separator_color']) && $qode_options_proya['header_separator_color'] != "") {
$header_separator = qode_hex2rgb($qode_options_proya['header_separator_color']);
}
$header_color_per_page .= "'";
$header_top_color_per_page .= "'";
//generate header classes based on qode options
$header_classes = '';
if (is_active_sidebar('woocommerce_dropdown')) {
$header_classes .= 'has_woocommerce_dropdown ';
}
if ($display_header_top == "yes") {
$header_classes .= ' has_top';
}
if ($header_top_area_scroll == "yes") {
$header_classes .= ' scroll_top';
}
if ($centered_logo) {
示例5: social_icons
function social_icons($atts, $content = null)
{
global $qodeIconCollections;
$args = array("type" => "", "link" => "", "target" => "", "use_custom_size" => "", "custom_size" => "", "custom_shape_size" => "", "size" => "", "border_radius" => "", "icon_color" => "", "icon_hover_color" => "", "background_color" => "", "background_hover_color" => "", "background_color_transparency" => "", "border_width" => "", "border_color" => "", "border_hover_color" => "", "icon_margin" => "");
$args = array_merge($args, $qodeIconCollections->getShortcodeParams());
extract(shortcode_atts($args, $atts));
$html = "";
$fa_stack_styles = "";
$icon_styles = "";
$data_attr = "";
// $background_color = $background_color != "" ? $background_color : "#e3e3e3";
if (!empty($background_color) && !empty($background_color_transparency) && ($background_color_transparency >= 0 && $background_color_transparency <= 1)) {
$rgb = qode_hex2rgb($background_color);
$background_color = 'rgba(' . $rgb[0] . ', ' . $rgb[1] . ', ' . $rgb[2] . ', ' . $background_color_transparency . ')';
}
if (!empty($background_color)) {
$fa_stack_styles .= "background-color: {$background_color};";
}
if ($type == 'square_social' && $border_radius !== '') {
$fa_stack_styles .= 'border-radius: ' . $border_radius . 'px;';
$fa_stack_styles .= '-webkit-border-radius: ' . $border_radius . 'px;';
$fa_stack_styles .= '-moz-border-radius: ' . $border_radius . 'px;';
}
if ($border_color != "") {
$fa_stack_styles .= "border-color: " . $border_color . ";";
}
if ($border_width != "") {
$fa_stack_styles .= "border-width: " . $border_width . "px;";
}
if ($icon_color != "") {
$icon_styles .= "color: " . $icon_color . ";";
}
if ($icon_margin != "") {
if ($type == 'circle_social' || $type == 'square_social') {
$fa_stack_styles .= "margin: " . $icon_margin . ";";
} else {
$icon_styles .= "margin: " . $icon_margin . ";";
}
}
if ($background_hover_color != "") {
$data_attr .= "data-hover-background-color=" . $background_hover_color . " ";
}
if ($border_hover_color != "") {
$data_attr .= "data-hover-border-color=" . $border_hover_color . " ";
}
if ($icon_hover_color != "") {
$data_attr .= "data-hover-color=" . $icon_hover_color;
}
if ($use_custom_size == 'yes') {
if ($custom_size !== '') {
$icon_styles .= 'font-size: ' . $custom_size . "px;";
}
if ($custom_shape_size !== '') {
$fa_stack_styles .= 'font-size: ' . $custom_shape_size . "px;";
} elseif ($custom_size !== '' && $custom_shape_size == '') {
$fa_stack_styles .= 'font-size: ' . $custom_size . "px;";
}
}
$html .= "<span class='q_social_icon_holder {$type}' {$data_attr}>";
if ($link != "") {
$html .= "<a href='" . $link . "' target='" . $target . "'>";
}
//have to set default because of already created shortcodes
$icon_pack = $icon_pack == '' ? 'font_awesome' : $icon_pack;
if ($type == "normal_social") {
$html .= $qodeIconCollections->getIconHTML(${$qodeIconCollections->getIconCollectionParamNameByKey($icon_pack)}, $icon_pack, array('icon_attributes' => array('style' => $icon_styles, 'class' => $size . ' simple_social')));
} else {
$html .= "<span class='fa-stack " . $size . "' style='" . $fa_stack_styles . "'>";
$html .= $qodeIconCollections->getIconHTML(${$qodeIconCollections->getIconCollectionParamNameByKey($icon_pack)}, $icon_pack, array('icon_attributes' => array('style' => $icon_styles, 'class' => '')));
$html .= "</span>";
//close fa-stack
}
if ($link != "") {
$html .= "</a>";
}
$html .= "</span>";
//close q_social_icon_holder
return $html;
}
示例6: qode_hex2rgb
if (isset($qode_options_proya['fss_navigation_border_radius']) && $qode_options_proya['fss_navigation_border_radius'] !== '') {
$sliders_style[] = 'border-radius: ' . $qode_options_proya['fss_navigation_border_radius'] . 'px';
}
if (isset($qode_options_proya['fss_navigation_arrow_size']) && $qode_options_proya['fss_navigation_arrow_size'] !== '') {
$sliders_style[] = 'font-size: ' . $qode_options_proya['fss_navigation_arrow_size'] . 'px';
}
if (isset($qode_options_proya['fss_navigation_arrow_color']) && $qode_options_proya['fss_navigation_arrow_color'] !== '') {
$rgb_color = qode_hex2rgb($qode_options_proya['fss_navigation_arrow_color']);
$rgb_transparency = 1;
if (isset($qode_options_proya['fss_navigation_arrow_transparency']) && $qode_options_proya['fss_navigation_arrow_transparency'] !== '') {
$rgb_transparency = $qode_options_proya['fss_navigation_arrow_transparency'];
}
$sliders_style[] = 'color: rgba(' . $rgb_color[0] . ',' . $rgb_color[1] . ',' . $rgb_color[2] . ',' . $rgb_transparency . ')';
}
if (isset($qode_options_proya['fss_navigation_arrow_hover_color']) && $qode_options_proya['fss_navigation_arrow_hover_color'] !== '') {
$rgb_color = qode_hex2rgb($qode_options_proya['fss_navigation_arrow_hover_color']);
$rgb_transparency = 1;
if (isset($qode_options_proya['fss_navigation_arrow_hover_transparency']) && $qode_options_proya['fss_navigation_arrow_hover_transparency'] !== '') {
$rgb_transparency = $qode_options_proya['fss_navigation_arrow_hover_transparency'];
}
$sliders_hover_style[] = 'color: rgba(' . $rgb_color[0] . ',' . $rgb_color[1] . ',' . $rgb_color[2] . ',' . $rgb_transparency . ')';
}
if (is_array($sliders_style) && count($sliders_style)) {
?>
.full_screen_navigation_inner a{
<?php
echo esc_attr(implode('; ', $sliders_style));
?>
}
<?php
}
示例7: social_icons
function social_icons($atts, $content = null)
{
$args = array("type" => "", "icon" => "", "link" => "", "target" => "", "use_custom_size" => "", "custom_size" => "", "size" => "", "icon_color" => "", "icon_hover_color" => "", "background_color" => "", "background_hover_color" => "", "background_color_transparency" => "", "border_width" => "", "border_color" => "", "border_hover_color" => "", "icon_margin" => "");
extract(shortcode_atts($args, $atts));
$html = "";
$fa_stack_styles = "";
$icon_styles = "";
$data_attr = "";
$background_color = $background_color != "" ? $background_color : "#e3e3e3";
if (!empty($background_color_transparency) && ($background_color_transparency >= 0 && $background_color_transparency <= 1)) {
$rgb = qode_hex2rgb($background_color);
$background_color = 'rgba(' . $rgb[0] . ', ' . $rgb[1] . ', ' . $rgb[2] . ', ' . $background_color_transparency . ')';
}
$fa_stack_styles .= "background-color: {$background_color};";
if ($border_color != "") {
$fa_stack_styles .= "border-color: " . $border_color . ";";
}
if ($border_width != "") {
$fa_stack_styles .= "border-width: " . $border_width . "px;";
}
if ($icon_color != "") {
$icon_styles .= "color: " . $icon_color . ";";
}
if ($icon_margin != "") {
$icon_styles .= "margin: " . $icon_margin . ";";
}
if ($background_hover_color != "") {
$data_attr .= "data-hover-background-color=" . $background_hover_color . " ";
}
if ($border_hover_color != "") {
$data_attr .= "data-hover-border-color=" . $border_hover_color . " ";
}
if ($icon_hover_color != "") {
$data_attr .= "data-hover-color=" . $icon_hover_color;
}
if ($use_custom_size == 'yes' && $custom_size != '') {
$icon_styles .= 'font-size: ' . $custom_size . "px;";
$fa_stack_styles .= 'font-size: ' . $custom_size . "px;";
}
$html .= "<span class='q_social_icon_holder {$type}' {$data_attr}>";
if ($link != "") {
$html .= "<a href='" . $link . "' target='" . $target . "'>";
}
if ($type == "normal_social") {
$html .= "<i class='fa " . $icon . " " . $size . " simple_social' style='" . $icon_styles . "'></i>";
} else {
$html .= "<span class='fa-stack " . $size . "' style='" . $fa_stack_styles . "'>";
$html .= "<i class='fa " . $icon . "' style='" . $icon_styles . "'></i>";
$html .= "</span>";
//close fa-stack
}
if ($link != "") {
$html .= "</a>";
}
$html .= "</span>";
//close q_social_icon_holder
return $html;
}
示例8: qode_hex2rgb
if (isset($qode_options_proya['single_slider_navigation_border_radius']) && $qode_options_proya['single_slider_navigation_border_radius'] !== '') {
$single_sliders_style[] = 'border-radius: ' . $qode_options_proya['single_slider_navigation_border_radius'] . 'px';
}
if (isset($qode_options_proya['single_slider_navigation_arrow_size']) && $qode_options_proya['single_slider_navigation_arrow_size'] !== '') {
$single_sliders_arrow_style[] = 'font-size: ' . $qode_options_proya['single_slider_navigation_arrow_size'] . 'px';
}
if (isset($qode_options_proya['single_slider_navigation_arrow_color']) && $qode_options_proya['single_slider_navigation_arrow_color'] !== '') {
$rgb_color = qode_hex2rgb($qode_options_proya['single_slider_navigation_arrow_color']);
$rgb_transparency = 1;
if (isset($qode_options_proya['single_slider_navigation_arrow_transparency']) && $qode_options_proya['single_slider_navigation_arrow_transparency'] !== '') {
$rgb_transparency = $qode_options_proya['single_slider_navigation_arrow_transparency'];
}
$single_sliders_arrow_style[] = 'color: rgba(' . $rgb_color[0] . ',' . $rgb_color[1] . ',' . $rgb_color[2] . ',' . $rgb_transparency . ')';
}
if (isset($qode_options_proya['single_slider_navigation_arrow_hover_color']) && $qode_options_proya['single_slider_navigation_arrow_hover_color'] !== '') {
$rgb_color = qode_hex2rgb($qode_options_proya['single_slider_navigation_arrow_hover_color']);
$rgb_transparency = 1;
if (isset($qode_options_proya['single_slider_navigation_arrow_hover_transparency']) && $qode_options_proya['single_slider_navigation_arrow_hover_transparency'] !== '') {
$rgb_transparency = $qode_options_proya['single_slider_navigation_arrow_hover_transparency'];
}
$single_sliders_arrow_hover_style[] = 'color: rgba(' . $rgb_color[0] . ',' . $rgb_color[1] . ',' . $rgb_color[2] . ',' . $rgb_transparency . ')';
}
if (is_array($single_sliders_style) && count($single_sliders_style)) {
?>
.flex-direction-nav a,
.flexslider .flex-prev,
.portfolio_slider .flex-prev,
.flexslider .flex-next,
.portfolio_slider .flex-next,
body div.pp_default a.pp_next:after,
body div.pp_default a.pp_previous:after,
示例9: qode_hex2rgb
}
$cf7_custom_style_3_button_hover_styles = '';
if (isset($qode_options_proya['cf7_custom_style_3_button_font_hover_color']) && $qode_options_proya['cf7_custom_style_3_button_font_hover_color'] !== '') {
$cf7_custom_style_3_button_hover_styles .= 'color: ' . $qode_options_proya['cf7_custom_style_3_button_font_hover_color'] . ';';
}
if (isset($qode_options_proya['cf7_custom_style_3_button_hover_background_color']) && $qode_options_proya['cf7_custom_style_3_button_hover_background_color'] !== '') {
if (isset($qode_options_proya['cf7_custom_style_3_button_background_transparency']) && $qode_options_proya['cf7_custom_style_3_button_background_transparency'] !== '') {
$cf7_custom_style_3_button_hover_background_color = qode_hex2rgb($qode_options_proya['cf7_custom_style_3_button_hover_background_color']);
$cf7_custom_style_3_button_hover_styles .= 'background-color: rgba(' . $cf7_custom_style_3_button_hover_background_color[0] . ',' . $cf7_custom_style_3_button_hover_background_color[1] . ',' . $cf7_custom_style_3_button_hover_background_color[2] . ',' . $qode_options_proya['cf7_custom_style_3_button_background_transparency'] . ');';
} else {
$cf7_custom_style_3_button_hover_styles .= 'background-color: ' . $qode_options_proya['cf7_custom_style_3_button_hover_background_color'] . ';';
}
}
if (isset($qode_options_proya['cf7_custom_style_3_button_hover_border_color']) && $qode_options_proya['cf7_custom_style_3_button_hover_border_color'] !== '') {
if (isset($qode_options_proya['cf7_custom_style_3_button_border_transparency']) && $qode_options_proya['cf7_custom_style_3_button_border_transparency'] !== '') {
$cf7_custom_style_3_button_hover_border_color = qode_hex2rgb($qode_options_proya['cf7_custom_style_3_button_hover_border_color']);
$cf7_custom_style_3_button_hover_styles .= 'border-color: rgba(' . $cf7_custom_style_3_button_hover_border_color[0] . ',' . $cf7_custom_style_3_button_hover_border_color[1] . ',' . $cf7_custom_style_3_button_hover_border_color[2] . ',' . $qode_options_proya['cf7_custom_style_3_button_border_transparency'] . ');';
} else {
$cf7_custom_style_3_button_hover_styles .= 'border-color: ' . $qode_options_proya['cf7_custom_style_3_button_hover_border_color'] . ';';
}
}
?>
<?php
if ($cf7_custom_style_1_button_styles !== "") {
?>
.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-submit,
.cf7_custom_style_1 input.wpcf7-form-control.wpcf7-submit:not([disabled]) {
<?php
echo $cf7_custom_style_1_button_styles;
?>
示例10: array
$headings_array = array('h2', 'h3', 'h4', 'h5', 'h6');
//get correct heading value. If provided heading isn't valid get the default one
$title_tag = in_array($title_tag, $headings_array) ? $title_tag : $args['title_tag'];
$text_in_circle_tag = in_array($text_in_circle_tag, $headings_array) ? $text_in_circle_tag : $args['text_in_circle_tag'];
$html = '';
$image_src = '';
$image_alt = '';
$circle_style = '';
$border_class = '';
$text_in_circle_style = '';
$icon_style = '';
$title_style = '';
$text_style = '';
if ($background_color != "") {
if ($background_transparency != "") {
$bg_color = qode_hex2rgb($background_color);
$circle_style .= "background-color: rgba(" . $bg_color[0] . "," . $bg_color[1] . "," . $bg_color[2] . "," . $background_transparency . ");";
} else {
$circle_style .= "background-color: " . $background_color . ";";
}
}
if ($border_color != "") {
$circle_style .= " border-color: " . $border_color . ";";
}
if (intval($border_width) > 5) {
$border_class = " big_border";
}
if ($border_width != "") {
$circle_style .= "border-width: " . $border_width . "px;";
}
if ($text_in_circle_color != "") {
示例11: qode_hex2rgb
padding: 35px 0 43px;
}
<?php
}
?>
<?php
if (isset($qode_options['portfolio_shader_color']) && !empty($qode_options['portfolio_shader_color'])) {
?>
<?php
if (isset($qode_options['portfolio_shader_transparency']) && !empty($qode_options['portfolio_shader_transparency'])) {
$portfolio_shader_transparency = $qode_options['portfolio_shader_transparency'];
} else {
$portfolio_shader_transparency = 1;
}
$shader_bg_color = qode_hex2rgb($qode_options['portfolio_shader_color']);
?>
.projects_holder article .portfolio_shader, .projects_masonry_holder article .portfolio_shader, .portfolio_slides .portfolio_shader{
background-color: rgba(<?php
echo $shader_bg_color[0];
?>
,<?php
echo $shader_bg_color[1];
?>
,<?php
echo $shader_bg_color[2];
?>
,<?php
echo $portfolio_shader_transparency;
?>
示例12: qode_hex2rgb
echo $dropdown_bg_color_initial[0];
?>
,<?php
echo $dropdown_bg_color_initial[1];
?>
,<?php
echo $dropdown_bg_color_initial[2];
?>
,<?php
echo $dropdown_bg_transparency;
?>
);
}
<?php
} else {
$dropdown_bg_color_initial = qode_hex2rgb("#000");
if (!empty($qode_options_theme13['dropdown_background_transparency'])) {
$dropdown_bg_transparency = $qode_options_theme13['dropdown_background_transparency'];
} else {
$dropdown_bg_transparency = 0.8;
}
?>
<?php
}
if (!empty($qode_options_theme13['menu_color']) || !empty($qode_options_theme13['menu_fontsize']) || !empty($qode_options_theme13['menu_fontstyle']) || !empty($qode_options_theme13['menu_fontweight']) || !empty($qode_options_theme13['menu_letter_spacing']) || $qode_options_theme13['menu_google_fonts'] != "-1") {
?>
nav.main_menu > ul > li > a{
<?php
if (!empty($qode_options_theme13['menu_color'])) {
?>
示例13: get_post_meta
$title_text_style[] = 'color: ' . get_post_meta($id, "qode_page-title-color", true);
}
if (get_post_meta($id, "qode_page-title-text-background-color", true) != '') {
$original_color = get_post_meta($id, "qode_page-title-text-background-color", true);
$rgb_color = qode_hex2rgb($original_color);
if (get_post_meta($id, "qode_page-title-text-background-opacity", true) != '') {
$opacity = get_post_meta($id, "qode_page-title-text-background-opacity", true);
} elseif (isset($qode_options['title_text_background_opacity']) && $qode_options['title_text_background_opacity'] != '') {
$opacity = $qode_options['title_text_background_opacity'];
} else {
$opacity = 1;
}
$title_text_style[] = 'background-color: rgba(' . $rgb_color[0] . ',' . $rgb_color[1] . ',' . $rgb_color[2] . ',' . $opacity . ')';
} elseif (isset($qode_options['title_text_background_color']) && $qode_options['title_text_background_color'] != '') {
$original_color = $qode_options['title_text_background_color'];
$rgb_color = qode_hex2rgb($original_color);
if (get_post_meta($id, "qode_page-title-text-background-opacity", true) != '') {
$opacity = get_post_meta($id, "qode_page-title-text-background-opacity", true);
} elseif (isset($qode_options['title_text_background_opacity']) && $qode_options['title_text_background_opacity'] != '') {
$opacity = $qode_options['title_text_background_opacity'];
} else {
$opacity = 1;
}
$title_text_style[] = 'background-color: rgba(' . $rgb_color[0] . ',' . $rgb_color[1] . ',' . $rgb_color[2] . ',' . $opacity . ')';
}
if ($is_title_area_visible) {
?>
<div class="title_outer <?php
echo $animate_title_class . $title_text_shadow;
if ($responsive_title_image == 'yes' && $show_title_image == true && $title_image !== '') {
echo ' with_image';
示例14: line_graph
function line_graph($atts, $content = null)
{
global $qode_options;
extract(shortcode_atts(array("type" => "rounded", "custom_color" => "", "labels" => "", "width" => "750", "height" => "350", "scale_steps" => "3", "scale_step_width" => "15"), $atts));
$id = mt_rand(1000, 9999);
if ($type == "rounded") {
$bezierCurve = "true";
} else {
$bezierCurve = "false";
}
$id = mt_rand(1000, 9999);
$html = "<div class='q_line_graf_holder'><div class='q_line_graf'><canvas id='lineGraph" . $id . "' height='" . $height . "' width='" . $width . "'></canvas></div><div class='q_line_graf_legend'><ul>";
$line_graph_array = explode(";", $content);
for ($i = 0; $i < count($line_graph_array); $i = $i + 1) {
$line_graph_el = explode(",", $line_graph_array[$i]);
$html .= "<li><div class='color_holder' style='background-color: " . trim($line_graph_el[0]) . ";'></div><p style='color: " . $custom_color . ";'>" . trim($line_graph_el[1]) . "</p></li>";
}
$html .= "</ul></div></div><script>var lineGraph" . $id . " = {labels : [";
$line_graph_labels_array = explode(",", $labels);
for ($i = 0; $i < count($line_graph_labels_array); $i = $i + 1) {
if ($i > 0) {
$html .= ",";
}
$html .= '"' . $line_graph_labels_array[$i] . '"';
}
$html .= "],";
$html .= "datasets : [";
$line_graph_array = explode(";", $content);
for ($i = 0; $i < count($line_graph_array); $i = $i + 1) {
$line_graph_el = explode(",", $line_graph_array[$i]);
if ($i > 0) {
$html .= ",";
}
$values = "";
for ($j = 2; $j < count($line_graph_el); $j = $j + 1) {
if ($j > 2) {
$values .= ",";
}
$values .= $line_graph_el[$j];
}
$color = qode_hex2rgb(trim($line_graph_el[0]));
$html .= "{fillColor: 'rgba(" . $color[0] . "," . $color[1] . "," . $color[2] . ",0.7)',data:[" . $values . "]}";
}
if (!empty($qode_options['text_fontsize'])) {
$text_fontsize = $qode_options['text_fontsize'];
} else {
$text_fontsize = 15;
}
if (!empty($qode_options['text_color']) && $custom_color == "") {
$text_color = $qode_options['text_color'];
} else {
if (empty($qode_options['text_color']) && $custom_color != "") {
$text_color = $custom_color;
} else {
if (!empty($qode_options['text_color']) && $custom_color != "") {
$text_color = $custom_color;
} else {
$text_color = '#818181';
}
}
}
$html .= "]};\n\t\t\tvar \$j = jQuery.noConflict();\n\t\t\t\$j(document).ready(function() {\n\t\t\t\tif(\$j('.touch .no_delay').length){\n\t\t\t\t\tnew Chart(document.getElementById('lineGraph" . $id . "').getContext('2d')).Line(lineGraph" . $id . ",{scaleOverride : true,\n\t\t\t\t\tscaleStepWidth : " . $scale_step_width . ",\n\t\t\t\t\tscaleSteps : " . $scale_steps . ",\n\t\t\t\t\tbezierCurve : " . $bezierCurve . ",\n\t\t\t\t\tpointDot : false,\n\t\t\t\t\tscaleLineColor: '#505050',\n\t\t\t\t\tscaleFontColor : '" . $text_color . "',\n\t\t\t\t\tscaleFontSize : " . $text_fontsize . ",\n\t\t\t\t\tscaleGridLineColor : '#e1e1e1',\n\t\t\t\t\tdatasetStroke : false,\n\t\t\t\t\tdatasetStrokeWidth : 0,\n\t\t\t\t\tanimationSteps : 120,});\n\t\t\t\t}else{\n\t\t\t\t\t\$j('#lineGraph" . $id . "').appear(function() {\n\t\t\t\t\t\tnew Chart(document.getElementById('lineGraph" . $id . "').getContext('2d')).Line(lineGraph" . $id . ",{scaleOverride : true,\n\t\t\t\t\t\tscaleStepWidth : " . $scale_step_width . ",\n\t\t\t\t\t\tscaleSteps : " . $scale_steps . ",\n\t\t\t\t\t\tbezierCurve : " . $bezierCurve . ",\n\t\t\t\t\t\tpointDot : false,\n\t\t\t\t\t\tscaleLineColor: '#000000',\n\t\t\t\t\t\tscaleFontColor : '" . $text_color . "',\n\t\t\t\t\t\tscaleFontSize : " . $text_fontsize . ",\n\t\t\t\t\t\tscaleGridLineColor : '#e1e1e1',\n\t\t\t\t\t\tdatasetStroke : false,\n\t\t\t\t\t\tdatasetStrokeWidth : 0,\n\t\t\t\t\t\tanimationSteps : 120,});\n\t\t\t\t\t},{accX: 0, accY: -200});\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t});\n\t\t</script>";
return $html;
}
示例15: qode_slider
//.........这里部分代码省略.........
$slide_title_style = "";
if (get_post_meta(get_the_ID(), "qode_slide-title-color", true) != "") {
$slide_title_style .= "color: " . get_post_meta(get_the_ID(), "qode_slide-title-color", true) . ";";
}
if (get_post_meta(get_the_ID(), "qode_slide-title-font-size", true) != "") {
$slide_title_style .= "font-size: " . get_post_meta(get_the_ID(), "qode_slide-title-font-size", true) . "px;";
}
if (get_post_meta(get_the_ID(), "qode_slide-title-line-height", true) != "") {
$slide_title_style .= "line-height: " . get_post_meta(get_the_ID(), "qode_slide-title-line-height", true) . "px;";
}
if (get_post_meta(get_the_ID(), "qode_slide-title-font-family", true) !== "" && get_post_meta(get_the_ID(), "qode_slide-title-font-family", true) !== "-1") {
$slide_title_style .= "font-family: '" . str_replace('+', ' ', get_post_meta(get_the_ID(), "qode_slide-title-font-family", true)) . "';";
}
if (get_post_meta(get_the_ID(), "qode_slide-title-font-style", true) != "") {
$slide_title_style .= "font-style: " . get_post_meta(get_the_ID(), "qode_slide-title-font-style", true) . ";";
}
if (get_post_meta(get_the_ID(), "qode_slide-title-font-weight", true) != "") {
$slide_title_style .= "font-weight: " . get_post_meta(get_the_ID(), "qode_slide-title-font-weight", true) . ";";
}
if (get_post_meta(get_the_ID(), 'qode_slide-title-letter-spacing', true) !== '') {
$slide_title_style .= 'letter-spacing: ' . get_post_meta(get_the_ID(), 'qode_slide-title-letter-spacing', true) . 'px;';
}
if (get_post_meta(get_the_ID(), 'qode_slide-title-text-transform', true) !== '') {
$slide_title_style .= 'text-transform: ' . get_post_meta(get_the_ID(), 'qode_slide-title-text-transform', true) . ';';
}
if (get_post_meta(get_the_ID(), 'qode_slide-hide-shadow', true) == 'yes') {
$slide_title_style .= 'text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);';
}
if (get_post_meta(get_the_ID(), 'qode_slide-title-bottom-margin', true) !== '') {
$slide_title_style .= 'margin-bottom: ' . get_post_meta(get_the_ID(), 'qode_slide-title-bottom-margin', true) . 'px;';
}
if (get_post_meta(get_the_ID(), 'qode_slide-title-background-color', true) !== '') {
$original_color = get_post_meta(get_the_ID(), 'qode_slide-title-background-color', true);
$color = qode_hex2rgb($original_color);
if (get_post_meta(get_the_ID(), 'qode_slide-title-background-opacity', true) !== '') {
$opacity = get_post_meta(get_the_ID(), 'qode_slide-title-background-opacity', true);
$slide_title_style .= 'background-color: rgba(' . $color[0] . ',' . $color[1] . ',' . $color[2] . ',' . $opacity . ')';
} else {
$slide_title_style .= 'background-color: rgba(' . $color[0] . ',' . $color[1] . ',' . $color[2] . ')';
}
}
$slide_subtitle_style = "";
if (get_post_meta(get_the_ID(), "qode_slide-subtitle-color", true) != "") {
$slide_subtitle_style .= "color: " . get_post_meta(get_the_ID(), "qode_slide-subtitle-color", true) . ";";
}
if (get_post_meta(get_the_ID(), "qode_slide-subtitle-font-size", true) != "") {
$slide_subtitle_style .= "font-size: " . get_post_meta(get_the_ID(), "qode_slide-subtitle-font-size", true) . "px;";
}
if (get_post_meta(get_the_ID(), "qode_slide-subtitle-line-height", true) != "") {
$slide_subtitle_style .= "line-height: " . get_post_meta(get_the_ID(), "qode_slide-subtitle-line-height", true) . "px;";
}
if (get_post_meta(get_the_ID(), "qode_slide-subtitle-font-family", true) !== "" && get_post_meta(get_the_ID(), "qode_slide-subtitle-font-family", true) !== "-1") {
$slide_subtitle_style .= "font-family: '" . str_replace('+', ' ', get_post_meta(get_the_ID(), "qode_slide-subtitle-font-family", true)) . "';";
}
if (get_post_meta(get_the_ID(), "qode_slide-subtitle-font-style", true) != "") {
$slide_subtitle_style .= "font-style: " . get_post_meta(get_the_ID(), "qode_slide-subtitle-font-style", true) . ";";
}
if (get_post_meta(get_the_ID(), "qode_slide-subtitle-font-weight", true) != "") {
$slide_subtitle_style .= "font-weight: " . get_post_meta(get_the_ID(), "qode_slide-subtitle-font-weight", true) . ";";
}
if (get_post_meta(get_the_ID(), 'qode_slide-subtitle-letter-spacing', true) !== '') {
$slide_subtitle_style .= 'letter-spacing: ' . get_post_meta(get_the_ID(), 'qode_slide-subtitle-letter-spacing', true) . 'px;';
}
if (get_post_meta(get_the_ID(), 'qode_slide-subtitle-text-transform', true) !== '') {
$slide_subtitle_style .= 'text-transform: ' . get_post_meta(get_the_ID(), 'qode_slide-subtitle-text-transform', true) . ';';
}