<?php

/* include WordPress */
define( 'WP_USE_THEMES', false );
require('./../../../../../../../../wp-load.php');

global $wp_superlike;

$style = $_POST['style'];

/* live preview of builtin styles */
/* cannot allow custom skin */
$get_style = $wp_superlike->load_skin($preview_theme=$style);

	/* load font for rtl */
	$font = 'Open Sans';
	$arrow_direction = null;
	if ($wp_superlike->get_option('rtl') == 1) {
		$font = 'Tahoma';
		$arrow_direction = '-rtl';
	}

	print "<style type=\"text/css\">
	
		.ajax-live-preview .wp-superlike {
			font-family: ".$font.";
		}
	
		.ajax-live-preview .wp-superlike-button {
			color: ".$get_style['button_text_color'].";
			border: 1px solid ".$get_style['button_border_color'].";
			background-color: ".$get_style['button_bg_color'].";
			background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(".$get_style['button_bg_color']."), to(".$get_style['button_bg_color2']."));
			background-image: -webkit-linear-gradient(top, ".$get_style['button_bg_color'].", ".$get_style['button_bg_color2']."); 
			background-image: -moz-linear-gradient(top, ".$get_style['button_bg_color'].", ".$get_style['button_bg_color2'].");
			background-image: -ms-linear-gradient(top, ".$get_style['button_bg_color'].", ".$get_style['button_bg_color2'].");
			background-image: -o-linear-gradient(top, ".$get_style['button_bg_color'].", ".$get_style['button_bg_color2'].");
		}
		
		.ajax-live-preview .wp-superlike-button i {
			background-image: url(".get_template_directory_uri() . "/includes/plugins/wp-superlike/images/".$get_style['slug']."/icon.png);
		}
		
		.ajax-live-preview .wp-superlike-button:hover {
			border: 1px solid ".$get_style['button_border_color_hover'].";
			background-color: ".$get_style['button_bg_color_hover'].";
			background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(".$get_style['button_bg_color_hover']."), to(".$get_style['button_bg_color_hover2']."));
			background-image: -webkit-linear-gradient(top, ".$get_style['button_bg_color_hover'].", ".$get_style['button_bg_color_hover2']."); 
			background-image: -moz-linear-gradient(top, ".$get_style['button_bg_color_hover'].", ".$get_style['button_bg_color_hover2'].");
			background-image: -ms-linear-gradient(top, ".$get_style['button_bg_color_hover'].", ".$get_style['button_bg_color_hover2'].");
			background-image: -o-linear-gradient(top, ".$get_style['button_bg_color_hover'].", ".$get_style['button_bg_color_hover2'].");
		}
		
		.ajax-live-preview .wp-superlike-count, .ajax-live-preview .wp-superlike-count-box {
			background-color: ".$get_style['count_bg_color'].";
			color: ".$get_style['count_text_color'].";
			border: 1px solid ".$get_style['count_border_color'].";
		}
		
		.ajax-live-preview .wp-superlike-arrow {
			background: url(".get_template_directory_uri() . "/includes/plugins/wp-superlike/images/".$get_style['slug']."/arrow".$arrow_direction.".png) no-repeat center;
		}
		
		.ajax-live-preview .wp-superlike-arrow-box {
			background: url(".get_template_directory_uri() . "/includes/plugins/wp-superlike/images/".$get_style['slug']."/arrow-down.png) no-repeat center;
		}
	
	</style>";
	
echo wp_superlike();