From 6b26bca2593f258cadbca656924b4e6b5c40a7c7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 25 Sep 2011 00:05:54 -0700 Subject: meh do stuff --- .gitignore | 12 +++++ Makefile | 37 +++++++++++++ css_shadow.php | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++++ header.php | 95 --------------------------------- header.php.patch | 52 ++++++++++++++++++ logo-style.scss.php | 49 +++++++++++++++++ style.css | 68 ----------------------- style.scss | 94 ++++++++++++++++++++++++++++++++ 8 files changed, 395 insertions(+), 163 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 css_shadow.php delete mode 100644 header.php create mode 100644 header.php.patch create mode 100644 logo-style.scss.php delete mode 100644 style.css create mode 100644 style.scss diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4537eb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +# DO NOT EDIT, this file is automatically made by `Makefile' +# +# ignore everyting +* +# but these: +!img/swoosh.png +!style.scss +!header.php.patch +!Makefile +!logo-style.scss.php +!license.txt +!css_shadow.php diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..62429bb --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +RM = rm -f +CP = cp +PATCH = patch +SASS = sass +PHP = php5 + +srcfiles = \ + img/swoosh.png \ + style.scss \ + header.php.patch \ + Makefile \ + logo-style.scss.php \ + license.txt \ + css_shadow.php + +all: header.php style.css .gitignore + +style.css: logo-style.scss + +%: %.patch ../twentyeleven/% + $(RM) $@ + $(CP) ../twentyeleven/$@ $@ + $(PATCH) $@ < $@.patch + +%.css: %.scss + $(SASS) $< $@ + +%: %.php + $(PHP) -f $< > $@ + +.gitignore: Makefile + echo "# DO NOT EDIT, this file is automatically made by \`Makefile'" >$@ + echo '# ' >> '$@' + echo '# ignore everyting' >> '$@' + echo '*' >> '$@' + echo '# but these:' >> '$@' + for file in $(srcfiles); do echo !"$$file" >> '$@'; done diff --git a/css_shadow.php b/css_shadow.php new file mode 100644 index 0000000..bdd4adb --- /dev/null +++ b/css_shadow.php @@ -0,0 +1,151 @@ +$x, 'y'=>$y); + } + + /** Draw a "line" of shadows between two points */ + public static function draw_line($p1, $p2, $steps, $color) { + $x1 = $p1['x']; + $y1 = $p1['y']; + $x2 = $p2['x']; + $y2 = $p2['y']; + + $xstep = ($x2-$x1)/($steps-1); + $ystep = ($y2-$y1)/($steps-1); + + $x = $x1; + $y = $y1; + $str = ''; + for ($i=0; $i<$steps; $i++) { + $str.= sprintf ("\t%fem %fem %s,\n", $x, $y, $color); + $x+=$xstep; + $y+=$ystep; + } + return $str; + } + + /** Connect the dots */ + public static function draw_multiline($points, $steps, $color) { + $str = ''; + foreach ($points as $point) { + if (isset($prev_point)) { + $str.= self::draw_line($prev_point, $point, $steps, $color); + } + $prev_point = $point; + } + return $str; + } + + public static function points_border($args) { + $left = $right = $top = $bottom = $xoffset = $yoffset = 0; + if (isset($args['width'])) { + $left = $right = $top = $bottom = $args['width']; + } + if (isset($args['x'])) { + $left = $right = $args['x']; + } + if (isset($args['y'])) { + $top = $bottom = $args['y']; + } + if (isset($args['left'])) { + $left = $args['left']; + } + if (isset($args['right'])) { + $right = $args['right']; + } + if (isset($args['top'])) { + $top = $args['top']; + } + if (isset($args['bottom'])) { + $bottom = $args['bottom']; + } + if (isset($args['xoffset'])) { + $xoffset = $args['xoffset']; + } + if (isset($args['yoffset'])) { + $yoffset = $args['yoffset']; + } + $p = array('tl'=>self::xy($xoffset-$left , $yoffset-$top ), + 'tr'=>self::xy($xoffset+$right, $yoffset-$top ), + 'bl'=>self::xy($xoffset-$left , $yoffset+$bottom), + 'br'=>self::xy($xoffset+$right, $yoffset+$bottom)); + return $p; + } + public static function points_border_drop($args) { + $xoffset = $yoffset = $xdrop = $ydrop = 0; + if (isset($args['xoffset'])) { + $xoffset = $args['xoffset']; + } + if (isset($args['yoffset'])) { + $yoffset = $args['yoffset']; + } + if (isset($args['drop'])) { + $xdrop = $ydrop = $args['drop']; + } + if (isset($args['xdrop'])) { + $xdrop = $args['xdrop']; + } + if (isset($args['ydrop'])) { + $ydrop = $args['ydrop']; + } + + $base = self::points_border($args); + if ($xdrop==$ydrop && $xdrop==0) { return $base; } + $args['xoffset'] = $xoffset+$xdrop; + $args['yoffset'] = $yoffset+$ydrop; + $drop = self::points_border($args); + + $right = ($xdrop > 0); + $bottom = ($ydrop > 0); + + /* 0|1 + * -+- + * 2|3 + */ + $q = 0; + if ($right) $q+=1; + if ($bottom) $q+=2; + + switch ($q) { + case 0: // top-left (or bottom-right) + // clockwise, start in top-left + $ret = array($drop['tl'], + $drop['tr'], + $base['tr'], + $base['br'], + $base['bl'], + $drop['bl'], + $drop['tl']); + return $ret; + case 1: // top-right (or bottom-left) + // clockwise, start in top-right + $ret = array($drop['tr'], + $drop['br'], + $base['br'], + $base['bl'], + $base['tl'], + $drop['tl'], + $drop['tr']); + return $ret; + case 2: /* TODO */ break; + case 3: // top-left (or bottom-right) + // clockwise, start in top-left + $ret = array($base['tl'], + $base['tr'], + $drop['tr'], + $drop['br'], + $drop['bl'], + $base['bl'], + $base['tl']); + return $ret; + } + } + public static function draw_border($args) { + $steps = 0; $color = '#000000'; + if (isset($args['steps'])) { $steps = $args['steps']; } + if (isset($args['color'])) { $color = $args['color']; } + return self::draw_multiline(self::points_border_drop($args), $steps, $color); + } +} diff --git a/header.php b/header.php deleted file mode 100644 index 192b59f..0000000 --- a/header.php +++ /dev/null @@ -1,95 +0,0 @@ - section and everything up till
- * - * @package WordPress - * @subpackage Twenty_Eleven - * @since Twenty Eleven 1.0 - */ -?> - - - - -> - - - - -<?php - /* - * Print the <title> tag based on what is being viewed. - */ - global $page, $paged; - - wp_title( '|', true, 'right' ); - - // Add the blog name. - bloginfo( 'name' ); - - // Add the blog description for the home/front page. - $site_description = get_bloginfo( 'description', 'display' ); - if ( $site_description && ( is_home() || is_front_page() ) ) - echo " | $site_description"; - - // Add a page number if necessary: - if ( $paged >= 2 || $page >= 2 ) - echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ); - - ?> - - - - - - * tag of your theme, or you will break many plugins, which - * generally use this hook to add elements to such - * as styles, scripts, and meta tags. - */ - wp_head(); -?> - - -> -
- - - -
\ No newline at end of file diff --git a/header.php.patch b/header.php.patch new file mode 100644 index 0000000..9fba494 --- /dev/null +++ b/header.php.patch @@ -0,0 +1,52 @@ +--- ../twentyeleven/header.php 2011-06-23 16:03:46.000000000 -0700 ++++ header.php 2011-08-18 21:17:57.000000000 -0700 +@@ -71,43 +71,15 @@ +
+