|
| 1 | +<?php |
| 2 | + header('Origin: *'); |
| 3 | + header('Access-Control-Allow-Origin: *'); |
| 4 | + header("Content-type: text/css"); |
| 5 | + ?>/** |
| 6 | + * Variables for $_GET if specified |
| 7 | + * |
| 8 | + * $_GET['weights'] = "000||111||010" ~ Minimum on Range||Maximum on Range||Has to mt_rant() Greater than for CSS Update |
| 9 | + * $_GET['nodes'] = "html||h1, h2, h3, h4, h5||input||textarea||select" ~ Css Object, ID and HTML Tag classes to define individual shadows |
| 10 | + * $_GET['elements'] = "box||text" ~ Shadow types only box or text or both |
| 11 | + * $_GET['reds'] = "21||198" ~ Range for mt_rand() of Minimal Red in RGB and Maximum |
| 12 | + * $_GET['greens'] = "31||168" ~ Range for mt_rand() of Minimal Green in RGB and Maximum |
| 13 | + * $_GET['blues'] = "42||238" ~ Range for mt_rand() of Minimal Blues in RGB and Maximum |
| 14 | + * $_GET['ranges'] = "0||3" ~ Range for mt_rand() of Minimal Shadow Depth in pixels and Maximum --- Across the board not 1st, 2nd etc. Setting |
| 15 | + * $_GET['firsts'] = "0||3" ~ Range for mt_rand() of Minimal Shadow First Basis Measuring Depth in pixels and Maximum |
| 16 | + * $_GET['seconds'] = "0||3" ~ Range for mt_rand() of Minimal Shadow Seconds Basis Measuring Depth in pixels and Maximum |
| 17 | + * $_GET['thirds'] = "0||3" ~ Range for mt_rand() of Minimal Shadow Third Basis Measuring Depth in pixels and Maximum |
| 18 | + * $_GET['forths'] = "0||3" ~ Range for mt_rand() of Minimal Shadow Forth Basis Measuring Depth in pixels and Maximum |
| 19 | + * $_GET['opacities'] = "41||99||72||91" ~ Range for mt_rand() / mt_rand() of Transparency of Shadowing in percentage |
| 20 | + */ |
| 21 | + |
| 22 | +<?php |
| 23 | + |
| 24 | + error_reporting(0); |
| 25 | + ini_set('display_errors', false); |
| 26 | + ini_set('log_errors', false); |
| 27 | + |
| 28 | + $url = 'http://localhost'.$_SERVER['REQUEST_URI']; |
| 29 | + parse_str(parse_url($url, PHP_URL_QUERY), $_GET); |
| 30 | + |
| 31 | + if (isset($_GET['sessionid']) && !empty($_GET['sessionid'])) |
| 32 | + $sesshid = sha1($_GET['sessionid']); |
| 33 | + else |
| 34 | + $sesshid = sha1(serialize($_SERVER).json_encode($_GET)); |
| 35 | + $weights = (!isset($_GET['weights']) && !strpos($_GET['weights'], '||') ? array(-80, 35, -11) : explode('||', $_GET['weights'])); |
| 36 | + $nodes = (!isset($_GET['nodes']) && !strpos($_GET['nodes'], '||') ? array('html', 'h1', 'input', 'button', 'iframe, embed', 'textarea', 'select', 'checkbox', 'radio') : explode('||', $_GET['nodes'])); |
| 37 | + $elements = (!isset($_GET['elements']) && (!strpos($_GET['elements'], 'box') || !strpos($_GET['elements'], 'text')) ? array('text', 'box') : explode('||', $_GET['elements'])); |
| 38 | + $reds = (!isset($_GET['reds']) && !strpos($_GET['reds'], '||') ? array('21', '198') : explode('||', $_GET['reds'])); |
| 39 | + $greens = (!isset($_GET['greens']) && !strpos($_GET['greens'], '||') ? array('31', '168') : explode('||', $_GET['greens'])); |
| 40 | + $blues = (!isset($_GET['blues']) && !strpos($_GET['blues'], '||') ? array('42', '238') : explode('||', $_GET['blues'])); |
| 41 | + $firsts = $seconds = $thirds = $forths = (!isset($_GET['ranges']) && !strpos($_GET['ranges'], '||') ? array('0', '3') : explode('||', $_GET['ranges'])); |
| 42 | + $firsts = (!isset($_GET['firsts']) && !strpos($_GET['firsts'], '||') ? $firsts : explode('||', $_GET['firsts'])); |
| 43 | + $seconds = (!isset($_GET['seconds']) && !strpos($_GET['seconds'], '||') ? $seconds : explode('||', $_GET['seconds'])); |
| 44 | + $thirds = (!isset($_GET['thirds']) && !strpos($_GET['thirds'], '||') ? $thirds : explode('||', $_GET['ranges'])); |
| 45 | + $forths = (!isset($_GET['forths']) && !strpos($_GET['forths'], '||') ? $forths : explode('||', $_GET['forths'])); |
| 46 | + $opacities = (!isset($_GET['opacities']) && !strpos($_GET['opacities'], '||') ? array('41', '99', '72', '91') : explode('||', $_GET['opacities'])); |
| 47 | + $token = sha1($_SERVER['HTTP_REFERER'] . md5($_SERVER['HTTP_USER_AGENT']) . sha1($_SERVER['REMOTE_ADDR']) . sha1($_SERVER['REQUEST_URI']) . $_SERVER['REMOTE_HOST'] . $_REQUEST['token']); |
| 48 | + |
| 49 | + if (!isset($_SESSION[basename(dirname(__FILE__))]['timers'][$token])) |
| 50 | + $_SESSION[basename(dirname(__FILE__))]['timers'][$token] = microtime(true) + mt_rand(360, 8500); |
| 51 | + elseif ($_SESSION[basename(dirname(__FILE__))]['timers'][$token] < microtime(true)) |
| 52 | + { |
| 53 | + unset($_SESSION[basename(dirname(__FILE__))][$token]); |
| 54 | + $_SESSION[basename(dirname(__FILE__))]['timers'][$token] = microtime(true) + mt_rand(360, 8500); |
| 55 | + } |
| 56 | + if (isset($_SESSION[basename(dirname(__FILE__))][$token]) && count($_SESSION[basename(dirname(__FILE__))][$token])==0) |
| 57 | + unset($_SESSION[basename(dirname(__FILE__))][$token]); |
| 58 | + if (!isset($_SESSION[basename(dirname(__FILE__))][$token]) || !is_array($_SESSION[basename(dirname(__FILE__))][$token]) || isset($_REQUEST['reset']) || is_string($_SESSION[basename(dirname(__FILE__))][$token]) || !isset($_SESSION[basename(dirname(__FILE__))][$token]) || mt_rand($weights[0], $weights[1]) >= $weights[2]) { |
| 59 | + $_SESSION[basename(dirname(__FILE__))][$token] = array(); |
| 60 | + foreach($elements as $key) |
| 61 | + { |
| 62 | + mt_srand(mt_rand(-microtime(true), microtime(true))); |
| 63 | + mt_srand(mt_rand(-microtime(true), microtime(true))); |
| 64 | + mt_srand(mt_rand(-microtime(true), microtime(true))); |
| 65 | + $decimals = explode('', str_replace(array(' ', '.'), '', microtime(false))); |
| 66 | + shuffle($decimals); |
| 67 | + $decalpha = implode("", $decimals); |
| 68 | + shuffle($decimals); |
| 69 | + $decomega = implode("", $decimals); |
| 70 | + $points = $colour = array(); |
| 71 | + foreach($nodes as $node) { |
| 72 | + $colour[$key]['red'] = (float)mt_rand((float)$reds[0].(!strpos($reds[0], '.')?".$decomega":""), (float)$reds[1].(!strpos($reds[1], '.')?".$decalpha":"")); |
| 73 | + $colour[$key]['green'] = (float)mt_rand((float)$greens[0].(!strpos($greens[0], '.')?".$decomega":""), (float)$greens[1].(!strpos($greens[1], '.')?".$decalpha":"")); |
| 74 | + $colour[$key]['blue'] = (float)mt_rand((float)$blues[0].(!strpos($blues[0], '.')?".$decomega":""), (float)$blues[1].(!strpos($blues[1], '.')?".$decalpha":"")); |
| 75 | + $points[$key]['1st'] = (float)mt_rand((float)$firsts[0].(!strpos($firsts[0], '.')?".$decomega":""), (float)$firsts[1].(!strpos($firsts[1], '.')?".$decalpha":"")); |
| 76 | + $points[$key]['2nd'] = (float)mt_rand((float)$seconds[0].(!strpos($seconds[0], '.')?".$decomega":""), (float)$seconds[1].(!strpos($seconds[1], '.')?".$decalpha":"")); |
| 77 | + $points[$key]['3rd'] = (float)mt_rand((float)$thirds[0].(!strpos($thirds[0], '.')?".$decomega":""), (float)$thirds[1].(!strpos($thirds[1], '.')?".$decalpha":"")); |
| 78 | + $points[$key]['4th'] = (float)mt_rand((float)$forths[0].(!strpos($forths[0], '.')?".$decomega":""), (float)$forths[1].(!strpos($forths[1], '.')?".$decalpha":"")); |
| 79 | + $colour[$key]['opacity'] = (float)round(mt_rand((float)$opacities[0].(!strpos($opacities[0], '.')?".$decomega":""), (float)$opacities[1].(!strpos($opacities[1], '.')?".$decalpha":"")) / mt_rand((float)$opacities[2].(!strpos($opacities[2], '.')?".$decomega":""), (float)$opacities[3].(!strpos($opacities[3], '.')?".$decalpha":"")), 11); |
| 80 | + |
| 81 | + switch ($key){ |
| 82 | + case 'box': |
| 83 | + if (strpos($node, '%s')>0 || in_array(substr($node, 0, 1), array('.', '#'))) |
| 84 | + { |
| 85 | + $_SESSION[basename(dirname(__FILE__))][$token][$key][$node] = sprintf($node, $key) . ' { |
| 86 | + -webkit-box-shadow: ' . $points['box']['1st'] . 'px ' . $points['box']['2nd'] . 'px ' . $points['box']['3rd'] . 'px ' . $points['box']['4th'] . 'px rgba(' . $colour['box']['red'] . ', ' . $colour['box']['green'] . ', ' . $colour['box']['blue'] . ', ' . $colour['box']['opacity'] . '); |
| 87 | + -moz-box-shadow: ' . $points['box']['1st'] . 'px ' . $points['box']['2nd'] . 'px ' . $points['box']['3rd'] . 'px ' . $points['box']['4th'] . 'px rgba(' . $colour['box']['red'] . ', ' . $colour['box']['green'] . ', ' . $colour['box']['blue'] . ', ' . $colour['box']['opacity'] . '); |
| 88 | + box-shadow: ' . $points['box']['1st'] . 'px ' . $points['box']['2nd'] . 'px ' . $points['box']['3rd'] . 'px ' . $points['box']['4th'] . 'px rgba(' . $colour['box']['red'] . ', ' . $colour['box']['green'] . ', ' . $colour['box']['blue'] . ', ' . $colour['box']['opacity'] . '); |
| 89 | +} |
| 90 | +
|
| 91 | +'; |
| 92 | + } else { |
| 93 | + $_SESSION[basename(dirname(__FILE__))][$token][$key][$node] = $node . ' { |
| 94 | + -webkit-box-shadow: ' . $points['box']['1st'] . 'px ' . $points['box']['2nd'] . 'px ' . $points['box']['3rd'] . 'px ' . $points['box']['4th'] . 'px rgba(' . $colour['box']['red'] . ', ' . $colour['box']['green'] . ', ' . $colour['box']['blue'] . ', ' . $colour['box']['opacity'] . '); |
| 95 | + -moz-box-shadow: ' . $points['box']['1st'] . 'px ' . $points['box']['2nd'] . 'px ' . $points['box']['3rd'] . 'px ' . $points['box']['4th'] . 'px rgba(' . $colour['box']['red'] . ', ' . $colour['box']['green'] . ', ' . $colour['box']['blue'] . ', ' . $colour['box']['opacity'] . '); |
| 96 | + box-shadow: ' . $points['box']['1st'] . 'px ' . $points['box']['2nd'] . 'px ' . $points['box']['3rd'] . 'px ' . $points['box']['4th'] . 'px rgba(' . $colour['box']['red'] . ', ' . $colour['box']['green'] . ', ' . $colour['box']['blue'] . ', ' . $colour['box']['opacity'] . '); |
| 97 | +} |
| 98 | +
|
| 99 | +'; |
| 100 | + } |
| 101 | + break; |
| 102 | + case 'text': |
| 103 | + if (strpos($node, '%s')>0 || in_array(substr($node, 0, 1), array('.', '#'))) |
| 104 | + { |
| 105 | + $_SESSION[basename(dirname(__FILE__))][$token][$key][$node] = sprintf($node, $key) . ' { |
| 106 | + text-shadow: ' . $points['text']['1st'] . 'px ' . $points['text']['2nd'] . 'px ' . $points['text']['3rd'] . 'px rgba(' . $colour['text']['red'] . ', ' . $colour['text']['green'] . ', ' . $colour['text']['blue'] . ', ' . $colour['text']['opacity'] . '); |
| 107 | +} |
| 108 | +
|
| 109 | +'; |
| 110 | + } else { |
| 111 | + $_SESSION[basename(dirname(__FILE__))][$token][$key][$node] = $node . ' { |
| 112 | + text-shadow: ' . $points['text']['1st'] . 'px ' . $points['text']['2nd'] . 'px ' . $points['text']['3rd'] . 'px rgba(' . $colour['text']['red'] . ', ' . $colour['text']['green'] . ', ' . $colour['text']['blue'] . ', ' . $colour['text']['opacity'] . '); |
| 113 | +} |
| 114 | +
|
| 115 | +'; |
| 116 | + } |
| 117 | + break; |
| 118 | + } |
| 119 | + } |
| 120 | + } |
| 121 | + } |
| 122 | + foreach(array_keys($_SESSION[basename(dirname(__FILE__))][$token]) as $key) |
| 123 | + echo implode("", $_SESSION[basename(dirname(__FILE__))][$token][$key]); |
| 124 | + exit(0); |
| 125 | +?> |
0 commit comments