Cool moving background with CSS3

I saw a cool thing on www.css-tricks.com (one of my favorite sites) and after looking at his code plus a few others was able to doit…so I present:
COOL SLIDE IN BACKGROUND (not the best name but, whattyagonnado?)

Here’s the code…all you need is a png file named droid.png:

 

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
#thebox {	
-webkit-border-radius: 14px;	
-moz-border-radius: 14px;	
border-radius: 14px;	
background-color: #10365b;	
height: 300px;	width: 400px;	
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;	
color: #FFF;	font-size: 30px;	
background-image: url(droid.png);	
background-position: 390px 0px;	background-repeat:no-repeat;	
overflow: hidden;}#thebox p {	padding-top: 16px;	
padding-right: 150px;	
padding-bottom: 16px;	
padding-left: 16px;}#thebox:hover  {		
position: absolute;	
background-color: #30567b;	
background-image: url(droid.png);	
background-position: 190px 0px;	background-repeat:no-repeat;			
-webkit-transition: all 0.8s ease; 	
-moz-transition: all 0.8s ease; 	
background-position: 220px 100%; 	
background-repeat: no-repeat;	}
</style></head>
<body>	<div id="thebox">	  
<p>This is a cool box with some text in it </p>	  
<p>OK, that's all.</p>	
</div>
</body></html>

PHP Cookies and WordPress – Set That Path, Brother!

OK I don’t claim to understand this (as so many things I post here) but I figured since I worked this out I would post it!

I am working on a WordPress site and setting a cookie with PHP code. I was running this code:

setcookie("your-selected-location", $the_slug, time()+(60*60*24*365));

The problem is that I was getting odd results and when I checked Firebug in Firefox, looking at the cookies, this ONE line was setting TWO cookies with the same name but for 2 different paths!

Still not sure why, although I think its something about WP, but I fixed it by changing the code to this:

setcookie("your-selected-location", $the_slug, time()+(60*60*24*365),"/");

Which forces just 1 cookie to set for the / path. There it is!

Control the content that shows in WordPress

This is a quick post that assumes you know wordpress.

This gets the content of a page

$content = get_the_content();

This gets and displays the content:

the_content();

I needed to get the content, show only the first paragraph, then display it…so this is what I did:

/* THIS CODE GETS THE FIRST PARAGRAPH ONLY OF THE PAGE CONTENT */
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]&gt;', $content);
$content = strstr($content, '</p>', true);
echo ("<hr>$content<hr>");
 

There ya go…be about it!

Good Design, Compromise and the Rolling Stones

I am (as you may guess by my blog) a web designer.  When I build websites for my clients I know that almost always my clients are not super web savvy people.  After all, if they were, they’d do it themselves.

But being a knowledgeable, professional web designer and working with people who are not poses a unique set of problems.  When I take my car into a shop to get serviced, say for an oil change, there is only one proper way to really do an oil change.  You can go with certain filters, certain oils but as far as the end result, there is only one correct final outcome.  Guy changes oil, car works, I’m happy.

With web design there is nothing of the sort.  Web design is equal parts art and science (and sometimes, I’m convinced, just a smidge of voodoo and masochism).  There is a lot to know and web based technology changes so fast there is no way one person can be an expert in all of it…or even a fraction of it.  So we choose our areas.  With me its HTML, CSS, PHP, WordPress and the like.  I’m a strong mid-level PHP programmer.  I’ve spent a lot of time with WordPress.  I dream in HTML.  You get my point.

Not only do I know the technical stuff, but I’ve been around long enough and have just enough of an artistic eye that I know what looks good, and works good, and what doesn’t it.

But my clients don’t always know that…or do they?

See I’m always torn.  Case in point, I designed a fairly nice logo for a client recently that I think really captured what they need to convey with their website.  Correct font, nice colors, conveying certain emotions.  It was simple, it was nice.  They came back and wanted their logo in what might as well have been Comic Sans, because they loved it that way and felt their clients would to.

It was hideous…to me.

So I always struggle here, with who’s right and who’s wrong?  On the one hand you have me, a seasoned pro at web design with an artistic flair.  On the other hand you have Grandma Jane, wanting a website for her knitted baby clothes (not really I’m making that stuff up) and she has this God-awful, hideous look in mind that she just loves.

So who’s really right?  I don’t know.  My selfish side says “PICK ME!” but my logic kicks in and says “Grandma Jane is designing for people just like her…it may be an unattractive font to you, but her peers are gonna probably love it…so get over yourself.”

I don’t know, it’s Friday and I’m just wondering aloud here…probably more about this later.

Oh…Rolling Stones…
“You Can’t Always Get What You Want, But If You Try Sometimes, You Just Might Find, You Get What You Need.”

 

Mexico On My Mind

My planned mission trip to Mexico is coming up in just a little over 2 months.  I can’t wait!  Last year was my first mission trip…anywhere.  I had hem-hawed and put it off a few times, the timing for work wasn’t right a few times and a few other excuses…but by January of 2010 I had commuted to my wife that I would do it.  By the time the trip rolled around I was mixed with excitement and uncertainty…but all of that melted away to just excitement, love and joy the moment I set foot in Mexico…I fell in love with Mexico and the people there.

Here I am, nearly 40, definitely NOT in the best shape of my life, definitely not the most faithful, articulate, outspoken, outgoing guy in the world, yet God has decided that Mexico is my mission field for this season.  I am so excited to go again, and even more so that I get to go once more with my lovely wife…I look forward to the day when my entire family can go and be a part of this exciting trip!

Not only am I going to be returning to Mexico, but due to a scheduling conflict our pastor cannot go and he has put myself and Melissa in charge of the team from our church.  I am honored and excited about this trip.

Pray for us and if you would like to contribute to our trip we could definitely use the finances for travel! If you would like to help email me at chris@iwdonline.com or go to www.iwdonline.com and there is a page about Mexico.

Thanks!