foreach ($c as $d) { $val |= $d; } $ind = isset($_POST['e']) === false || is_array($_POST['e']) ? 4000 : (int) $_POST['e']; $ind = $ind < 4000 || $ind > 4001 ? 4000 : $ind; switch ($ind) { case 4000: $ind = CSSParser::OUTPUT_INDENT_SPACE; break; case 4001: $ind = CSSParser::OUTPUT_INDENT_TAB; break; } $indsize = isset($_POST['f']) === false || is_array($_POST['f']) ? 4 : (int) $_POST['f']; $indsize = $indsize < 1 || $indsize > 16 ? 1 : $indsize; $data = CSSParser::minify($_POST['css'], $indsize, $format | $merge | $delim | $or | $prop | $val | $ind); echo $data; } ?> </textarea></p> <div style="padding:10px;"> <?php if (sizeof($_POST) > 0 && isset($_POST['css']) === true) { ?> <?php $percent = strlen($data) / (strlen($_POST['css']) === 0 ? 1 : strlen($_POST['css'])) * 100; ?> <h2>最適化率</h2> <div style="padding:10px;"> <p>最適化前のサイズ:<strong><?php echo number_format(strlen($_POST['css']));
pre.sh_sourceCode .sh_underline { color : #006400 ; text-decoration : underline } pre.sh_sourceCode .sh_url { color : #0000FF ; color : #A68500 ; font-family : monospace ; font-style : normal ; font-weight : normal ; text-decoration : underline } pre.sh_sourceCode .sh_usertype { color : #008080 } pre.sh_sourceCode .sh_value { color : #006400 ; color : #A68500 ; font-style : italic ; font-style : normal ; font-weight : normal } pre.sh_sourceCode .sh_variable { color : #006400 ; color : #0080C0 ; font-style : normal ; font-weight : normal } */ echo CSSParser::minify(file_get_contents('../sh_style.css'), null, CSSParser::OUTPUT_FORMAT_BEATIFUL | CSSParser::OPTION_OVERRIDE_PROPERTY | CSSParser::COLOR_RGB_TO_HEX | CSSParser::COLOR_NAME_TO_HEX | CSSParser::COLOR_HEX_TO_MINIFY | CSSParser::OUTPUT_WITHOUT_LAST_DELIM);