<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>MightyMeta</title>
	
	<link>http://www.mightymeta.co.uk</link>
	<description>Web, Mobile and Graphic Creativity</description>
	<lastBuildDate>Fri, 13 Jan 2012 12:54:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/mightymeta" /><feedburner:info uri="mightymeta" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license><feedburner:emailServiceId>mightymeta</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Embedding YouTube Within iPhone Apps</title>
		<link>http://feedproxy.google.com/~r/mightymeta/~3/0UFiKdiItDE/</link>
		<comments>http://www.mightymeta.co.uk/1509/embedding-youtube-within-iphone-apps/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 23:21:54 +0000</pubDate>
		<dc:creator>James Brocklehurst</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone simulator]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Xcode]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://www.mightymeta.co.uk/?p=1509</guid>
		<description><![CDATA[Here is a method I recently devised for getting YouTube videos to work in a useable and clean way within iPhone Apps. It assumes a basic familiarity with Xcode 4 and Objective-C. Sample Video &#8220;Cycles&#8221; by Cyriak Harris Download Source (.zip &#8230; <a href="http://www.mightymeta.co.uk/1509/embedding-youtube-within-iphone-apps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here is a method I recently devised for getting YouTube videos to work in a useable and clean way within iPhone Apps. It assumes a basic familiarity with Xcode 4 and Objective-C.<br />
<span id="more-1509"></span></p>
<p><img class="alignnone size-full wp-image-1547 colorbox-1509" title="Embed YouTube in iPhone App" src="http://www.mightymeta.co.uk/wp-content/uploads/opening-image.jpg" alt="Embed YouTube in iPhone App" width="600" height="321" /></p>
<p><cite>Sample Video <a href="http://www.youtube.com/watch?v=-0Xa4bHcJu8">&#8220;Cycles&#8221; by Cyriak Harris</a></cite></p>
<p><a class="download" href="http://dl.dropbox.com/u/1208404/VideoLauncher.zip">Download Source (.zip package, 33KB)</a></p>
<h2>What This Method Does</h2>
<p>There are several offerings out there for embedding YouTube into your app, most of which are variations on <a href="http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html">the code provided by YouTube</a> themselves, and this is no different. What is new about this approach is that it positions the thumbnail centrally in all device orientations using some tweaked CSS, places the thumbnail against a black background (which is trickier to work out than it sounds), and enables you to pass a video URL dynamically to the embed code.</p>
<p>The example I give launches the video in a modal view, which is useful if you are working with a Tab Bar application or Navigation Controller stack with a portrait-only orientation, but still want to have videos displayed landscape. Using a modal gets around the issue of all views in a Tab Bar application needing to adhere to the same orientation <a href="http://www.cimgf.com/2008/11/13/landscape-tab-bar-application-for-the-iphone/">as outlined by Matt Long</a>, or any other orientation problems. You could, of course, adapt the code to remove the use of a modal if you so wished.</p>
<h2>The Launcher View</h2>
<p>In this example I am using two view controller classes, one that manages a XIB with some &#8216;view video&#8217; buttons, and then one for the display of the actual video.</p>
<p>First, create a UIViewController subclass with an associated XIB called &#8220;VideoLauncherViewController&#8221;. In the interface file, add the following:</p>
<pre>#import &lt;UIKit/UIKit.h&gt;
#import "VideoViewController.h"

@interface VideoLauncherViewController : UIViewController {

    NSString *videoURL;

}

@property (nonatomic, retain) NSString *videoURL;

- (IBAction) launchVideo;

@end</pre>
<p>Nothing too complex here, just a property to hold the URL for the video and a method declaration. Once the property has been synthesized and released, this is how the method should be implemented in VideoLauncherViewController.m:</p>
<pre>- (IBAction) launchVideo {

self.videoURL = @"http://youtube.com/embed/-0Xa4bHcJu8";

VideoViewController *videoViewController = [[[VideoViewController alloc] initWithNibName:nil bundle:nil] retain];

videoViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
videoViewController.videoURL = self.videoURL;

[self presentModalViewController:videoViewController animated:YES];

[videoViewController release];
}</pre>
<p>You&#8217;ll get an error about videoViewController not having a videoURL property, but this will get sorted out once it is added in the next step.</p>
<p>The last section of the URL string, found directly after <code>youtube.com/embed/</code>, can be substituted for that of any YouTube video. Just use the &#8216;share&#8217; button on the YouTube page to get the relevant code:</p>
<p><img class="alignnone size-full wp-image-1555 colorbox-1509" title="Getting a Video URL" src="http://www.mightymeta.co.uk/wp-content/uploads/embed-code.jpg" alt="Getting a Video URL" width="440" height="168" /></p>
<p>Passing this URL value to the next view in the way shown above means you could extend the class to make the choice of video user selected, or altered programatically, for instance.</p>
<p>In the XIB, make a button, and bind it to the method, as shown below (click to enlarge):</p>
<p><a href="http://www.mightymeta.co.uk/wp-content/uploads/launch-screen-xib.png"><img class="alignnone size-full wp-image-1548 colorbox-1509" title="Launch Screen XIB" src="http://www.mightymeta.co.uk/wp-content/uploads/launch-screen-xib-e1318027321964.png" alt="Launch Screen XIB" width="600" height="494" /></a></p>
<h2>The Video View</h2>
<p>Now create a second UIViewController subclass and XIB called &#8220;VideoViewController&#8221;. Here&#8217;s the interface:</p>
<pre>#import &lt;UIKit/UIKit.h&gt;

@interface VideoViewController : UIViewController {

    IBOutlet UIWebView *videoView;
    NSString *videoURL;
    NSString *videoHTML;

}

@property(nonatomic, retain) IBOutlet UIWebView *videoView;
@property(nonatomic, retain) NSString *videoURL;
@property(nonatomic, retain) NSString *videoHTML;

- (void) embedYouTube;
- (IBAction) closeModal;

@end</pre>
<p>Again, synthesize and release the properties in the implementation, then add these methods:</p>
<pre>- (void)embedYouTube {

videoHTML = [NSString stringWithFormat:@"\
&lt;html&gt;\
&lt;head&gt;\
&lt;style type=\"text/css\"&gt;\
iframe {position:absolute; top:50%%; margin-top:-130px;}\
body {background-color:#000; margin:0;}\
&lt;/style&gt;\
&lt;/head&gt;\
&lt;body&gt;\
&lt;iframe width=\"100%%\" height=\"240px\" src=\"%@\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;\
&lt;/body&gt;\
&lt;/html&gt;", videoURL];

[videoView loadHTMLString:videoHTML baseURL:nil];
}

- (IBAction) closeModal {
[self dismissModalViewControllerAnimated:YES];
}</pre>
<p>Lets go through some of that.</p>
<p>First of all we assign a string of HTML code to the videoHTML property, which will be used to embed the video within a UIWebView. The HTML contains some inline CSS for centering the video correctly on the screen. Note that some characters in the string need to be escaped, notably double quotation marks with a backslash &#8216;\&#8217; and the percent sign with an extra &#8216;%&#8217;. New lines also need to be preceded with a backslash.</p>
<p>Because this is a <code>stringWithFormat</code>, we can also insert dynamic values, so the %@ symbols found within the src=&#8221;" attribute are replaced by whatever value is held by the videoURL property, as sent through from the Launcher view, and identified there at the end of the message.</p>
<p>The next step is to add the following to the <code>- (void)viewDidLoad</code> method:</p>
<pre>videoView.backgroundColor = [UIColor blackColor];
videoView.opaque = NO;

[self embedYouTube];</pre>
<p>This code sorts out the black background mentioned earlier (trying to achieve this is Interface Builder doesn&#8217;t work), plus there is a message to run the embed method.</p>
<p>Finally you need to alter <code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation</code> so it is simply returning <code>YES</code> to allow for all orientations:</p>
<pre>    // Return YES for supported orientations
    return YES;</pre>
<h2></h2>
<h2>VideoView XIB</h2>
<p>Open the VideoViewController.xib, and drag a UIWebView instance from the library onto the canvas. It should scale to fill the full width and height of the canvas.</p>
<p>Next, download and unzip <a href="http://dl.dropbox.com/u/1208404/button-dark.zip">this button graphic</a>, and add both sizes of the &#8216;close-dark.png&#8217; image to your project.</p>
<p>Drag a Round Rect Button from the library and place it roughly in the top left corner of your main view.</p>
<p>In the Attributes Inspector, set the Type to &#8216;Custom&#8217;, and the background image for the button as &#8216;close-dark.png&#8217;. Also change the Title to &#8216;Close&#8217;, the text colour to white and the font size to 14.0.</p>
<p>In the Size Inspector, set the X position to 36, the Y position to 24, the width to 60 and the height to 30.</p>
<p>Select File&#8217;s Owner and bind the videoView outlet to the UIWebView instance and the closeModal action to the &#8216;Close&#8217; button.</p>
<p>When you are done, it should look like the example below (click to enlarge):</p>
<p><a href="http://www.mightymeta.co.uk/wp-content/uploads/Screen-shot-2011-10-26-at-13.49.39.png"><img class="alignnone size-full wp-image-1571 colorbox-1509" title="Edited XIB in Interface Builder" src="http://www.mightymeta.co.uk/wp-content/uploads/Screen-shot-2011-10-26-at-13.49.39-e1319633807813.png" alt="Edited XIB in Interface Builder" width="600" height="379" /></a></p>
<h2>The Result</h2>
<p>This should work both in the simulator and an actual device.</p>
<p>When you build and run and tap the button on the launch screen, the modal view is presented with the static video thumbnail.</p>
<p><a href="http://www.mightymeta.co.uk/wp-content/uploads/Screenshot_19.png"><img class="alignnone size-full wp-image-1572 colorbox-1509" title="YouTube Thumbnail" src="http://www.mightymeta.co.uk/wp-content/uploads/Screenshot_19-e1319634172314.png" alt="YouTube Thumbnail" width="308" height="600" /></a></p>
<p>Tapping the thumbnail will play the video fullscreen, which can be viewed in either landscape or portrait orientations. Pressing the blue &#8216;Done&#8217; button will return the user to the thumbnail screen. Pressing the &#8216;Close&#8217; button on the thumbnail screen will dismiss this modal view.</p>
<p><a href="http://www.mightymeta.co.uk/wp-content/uploads/Screenshot_20.png"><img class="alignnone size-full wp-image-1573 colorbox-1509" title="YouTube Player Portrait" src="http://www.mightymeta.co.uk/wp-content/uploads/Screenshot_20-e1319634204956.png" alt="YouTube Player Portrait" width="308" height="600" /></a></p>
<p><img class="alignnone size-full wp-image-1574 colorbox-1509" title="YouTube Landscape" src="http://www.mightymeta.co.uk/wp-content/uploads/Screenshot_21-e1319634102141.png" alt="YouTube Landscape" width="600" height="308" /></p>
<h2>Conclusion</h2>
<p>This method provides a clean and extensible way of embedding YouTube videos in your apps, which should work in most situations.</p>
<p>The source code is released under the <a href="http://www.opensource.org/licenses/BSD-3-Clause">BSD 3-Clause License.</a></p>
<p>If you have any problems with the code, or have improved it in some way, feel free to leave a comment below.</p>
<img src="http://feeds.feedburner.com/~r/mightymeta/~4/0UFiKdiItDE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mightymeta.co.uk/1509/embedding-youtube-within-iphone-apps/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.mightymeta.co.uk/1509/embedding-youtube-within-iphone-apps/</feedburner:origLink></item>
		<item>
		<title>SuperSlicr: Ditch the Slice Tool!</title>
		<link>http://feedproxy.google.com/~r/mightymeta/~3/xECyTyLiJTk/</link>
		<comments>http://www.mightymeta.co.uk/1357/superslicr-ditch-the-slice-tool/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 11:11:55 +0000</pubDate>
		<dc:creator>James Brocklehurst</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[freebie]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[interface elements]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[PNG]]></category>
		<category><![CDATA[save for web]]></category>
		<category><![CDATA[transparency]]></category>
		<category><![CDATA[vectors]]></category>

		<guid isPermaLink="false">http://www.mightymeta.co.uk/?p=1357</guid>
		<description><![CDATA[This is an update to the Photoshop action that I created in May 2010 to speed up my Photoshop to Web/Mobile workflow. It allows you to select any combination of layers (which may contain layer styles, vector shapes, text layers &#8230; <a href="http://www.mightymeta.co.uk/1357/superslicr-ditch-the-slice-tool/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is an update to the Photoshop action that I created in May 2010 to speed up my Photoshop to Web/Mobile workflow. It allows you to select any combination of layers (which may contain layer styles, vector shapes, text layers or smart objects), and automatically crops, merges and then passes them to the the Save for Web and Devices dialogue.</p>
<p><span id="more-1357"></span></p>
<p>Since using it quite heavily on a recent iOS project, I have made a few tweaks to how it works (detailed below) and now can&#8217;t live without it! Go on, give it a whirl!</p>
<p><a class="download" href="http://dl.dropbox.com/u/1208404/superslicr.zip">Download ‘SuperSlicr’ Action (Photoshop CS2 +)</a></p>
<h2>Installation</h2>
<p>Unzip the package and double-click on the &#8216;superslicr.atn&#8217; file. It should launch Photoshop and add itself to your Actions palette automatically. If this doesn’t work, install it manually by choosing ‘LOAD ACTIONS’ from the Actions palette&#8217;s contextual menu:</p>
<p><img class="alignnone size-full wp-image-373 colorbox-1357" title="'Load Action' in Actions Palette Contextual Menu" src="http://www.mightymeta.co.uk/wp-content/uploads/load-action-e1314107550135.jpg" alt="'Load Action' in Actions Palette Contextual Menu" width="251" height="405" /></p>
<p>Then browse for and select the file.</p>
<h2>Instructions</h2>
<p>1. Select the layers that you want to export as a single graphic. Note that they do not need to be adjacent to each other in the layers palette and can even exist in different groups.</p>
<p><img class="alignnone size-full wp-image-1360 colorbox-1357" title="Select Layers" src="http://www.mightymeta.co.uk/wp-content/uploads/select-layers.png" alt="Select Layers" width="252" height="452" /></p>
<p>2. Select which export format you require (JPEG, PNG-24 Standard or PNG-24 iOS Scaling) in the Actions palette.</p>
<p><img class="alignnone size-full wp-image-1566 colorbox-1357" title="Select Your Setting" src="http://www.mightymeta.co.uk/wp-content/uploads/Screen-shot-2011-10-24-at-12.58.02.png" alt="Select Your Setting" width="214" height="124" /></p>
<p>3. Press the play button in the Actions palette or CMD-SHIFT-F8 for JPEG (High) / SHIFT-F8 for PNG-24 / F8 for iOS Scaling.</p>
<p><img class="alignnone colorbox-1357" title="Play Action" src="http://www.mightymeta.co.uk/wp-content/uploads/play-action.jpg" alt="Play Action" width="260" height="44" /></p>
<p>4. Your selected layers now appear merged, cropped and ready to export in the save for web dialogue window!</p>
<p><img class="alignnone size-full wp-image-1362 colorbox-1357" title="Save for Web and Devices" src="http://www.mightymeta.co.uk/wp-content/uploads/save-for-web2.png" alt="Save for Web and Devices" width="550" height="351" /></p>
<p>When you return to your document after saving, a new document containing your cropped and merged image will be active. Your original document will also be there, inactive, and in its original state.</p>
<h2>Features</h2>
<ul>
<li>Crops selected layers to pixel bounds &#8211; no slice tool required!</li>
<li>Can select any combination of layers (don&#8217;t need to be adjacent in layers palette).</li>
<li>Works with any layer type, including layer groups, text layers, vector shape layers and smart objects.</li>
<li>Non-destructive. Creates new document from selected layers and leaves original layers untouched.</li>
<li>New document remains open at end of process so can be saved as additional format.</li>
<li>iOS Scaling, PNG-24 (Alpha Transparency) and JPEG (60% compression) flavours.</li>
<li>Can be activated using F8 function key (this can be altered if needed).</li>
</ul>
<h2>1.0 Release</h2>
<p><del datetime="2011-10-24T11:59:33+00:00">I haven&#8217;t fully tested this on different platforms, Photoshop versions, etc, and although it seems to work without a hitch for me, you may find it it does something strange when used in your particular setup.</del></p>
<p><em>UPDATE 24th Oct. 2011: After using SuperSlicr a bit more extensively I have ironed out a couple of bugs that existed and have also added an &#8216;iOS Scaling&#8217; setting that produces both a Retina Display and Standard version of your selection.</em></p>
<p><em>Use the download link at the top of the article to get the latest version, and look at the readme file to see exactly what has changed.</em></p>
<p>If you experience any bugs, let me know in the comments, explaining what the bug was, what you were doing when it happened, and what OS and Photoshop version you used, so I can have a go at fixing it.</p>
<h2>Licence</h2>
<p><a href="http://www.opensource.org/licenses/BSD-3-Clause">BSD 3-Clause Licence</a></p>
<p>Essentially you can do whatever you want with this, but can&#8217;t redistribute the code without including the original licence (i.e. you can&#8217;t sell it or pretend it&#8217;s yours).</p>
<img src="http://feeds.feedburner.com/~r/mightymeta/~4/xECyTyLiJTk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mightymeta.co.uk/1357/superslicr-ditch-the-slice-tool/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.mightymeta.co.uk/1357/superslicr-ditch-the-slice-tool/</feedburner:origLink></item>
		<item>
		<title>CSS Noise</title>
		<link>http://feedproxy.google.com/~r/mightymeta/~3/9pIpUlRAJIc/</link>
		<comments>http://www.mightymeta.co.uk/1269/css-noise/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 14:40:03 +0000</pubDate>
		<dc:creator>James Brocklehurst</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[data URIs]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[generated content]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[interface elements]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[PNG]]></category>
		<category><![CDATA[save for web]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[transparency]]></category>

		<guid isPermaLink="false">http://www.mightymeta.co.uk/?p=1269</guid>
		<description><![CDATA[This post looks at a way to add a subtle noise effect to HTML elements using CSS. Using this technique is of interest because it doesn&#8217;t require use of an image editor, weighs in at just a little over 2K &#8230; <a href="http://www.mightymeta.co.uk/1269/css-noise/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This post looks at a way to add a subtle noise effect to HTML elements using CSS. Using this technique is of interest because it doesn&#8217;t require use of an image editor, weighs in at just a little over 2K and doesn&#8217;t generate any extra HTTP requests.</p>
<p><span id="more-1269"></span><br />
<a class="download" href="http://www.mightymeta.co.uk/demos/css-noise/">Demo</a><br />
<a class="download" href="http://www.mightymeta.co.uk/resources/css-noise.css">Download (CSS code snippet, 2.2K)</a></p>
<h2>How To Use It</h2>
<p>The simplest implementation is to paste the code into your existing CSS, then give any HTML elements that you want to apply noise to a <code>class="noise"</code> attribute. Yes, I know that&#8217;s an unsemantic use of markup, but there is a workaround that I will detail later.</p>
<p>If you want to apply noise to the body element, use <code>class="body-noise"</code> instead.</p>
<h2>How It Works</h2>
<p>A quick look at the source will reveal that the trick here is a simple one, namely a <a href="http://en.wikipedia.org/wiki/Data_URI_scheme">data uri</a>. This has been generated from a 50 x 50 pixel repeating tile PNG image of monochromatic noise that I made using Photoshop.</p>
<p>It is layered over elements using the <code>:before</code> pseudo selector using the <a href="http://nicolasgallagher.com/multiple-backgrounds-and-borders-with-css2/">technique outlined by Nicolas Gallagher</a> and the <code>opacity</code> property. This means that no additional elements are required, and the noise is placed over the top of any existing background colour or image that the element might possess, but sits behind the element&#8217;s nested content.</p>
<p>Because the properties used are CSS 2.1 and not 3 then there is pretty good browser support too (breakdown below). Yet because this added <a href="http://en.wikipedia.org/wiki/Progressive_enhancement">progressively</a>, browsers that aren&#8217;t supported won&#8217;t break, they just don&#8217;t get any noise.</p>
<h2>Why ???</h2>
<p>Adding a subtle amount of noise to aspects of an interface design is becoming <a href="http://spyrestudios.com/32-texture-web-designs/">more common</a>, since it gives the designer the ability to create a more natural and less &#8216;digital&#8217; looking aesthetic for interface elements that can be apparent when working with flat colours and gradients alone. Using noise also allows for an enhanced contrast in texture between figure/ground and between distinct areas of a layout.</p>
<p>This of course is already possible using sliced image files, but requires use of an image editor and some experience to create a tile in-keeping with the design in question, and generates an additional HTTP request for each linked image used.</p>
<p>There is <a href="http://snipplr.com/view/44066/generate-image-noise-with-canvas/">a JavaScript based alternative</a>, but this needs to create an additional <code>&lt;canvas&gt;</code> element for it to work, and is quite processor-intensive if used a lot, so although interesting, isn&#8217;t that practical.</p>
<p>Adding noise using CSS could be seen as an extension to the popular practice of dynamically adding drop shadows, rounded corners and gradients, etc, using the new CSS3 properties.</p>
<p>Using noise may be just a current &#8216;trend&#8217;, but is generic and understated enough (unlike, say, &#8216;brushed metal&#8217; or &#8216;grunge corners&#8217;) for me to believe it will here for a while and warrants some sort of CSS solution.</p>
<p>As a side-note, I first tried to see if this was possible using CSS3 gradients, as inspired by <a href="http://leaverou.me/css3patterns/">Lea Verou&#8217;s CSS Pattern Gallery</a>. I thought perhaps that it could be done using a combination of gradients and Alex Walker&#8217;s <a href="http://designfestival.com/the-cicada-principle-and-why-it-matters-to-web-designers/">Cicada Principle</a>. As you can see below, things didn&#8217;t quite work out as a ridiculous amount of code is required for something that looks less than satisfactory:</p>
<p><iframe style="width: 100%; height: 430px;" src="http://jsfiddle.net/mightymeta/B2EFG/embedded/result,css,html/" width="320" height="240"></iframe></p>
<h2>Better Semantics</h2>
<p>As mentioned above, including a &#8220;noise&#8221; class to your HTML elements is convenient, but no better than adding <code>color="red"</code> or <code>font="bold"</code> attributes, in terms of semantics and the separation of content and presentation.</p>
<p>If you want to avoid this, then group the selectors of the elements that you want to add noise to, like so:</p>
<pre>#myFirstElement, #mySecondElement, #myThirdElement {

position: relative;
z-index: 1;

}

#myFirstElement:before, #mySecondElement:before, #myThirdElement:before body:before {

//noise code here...

}</pre>
<p>Grouping selectors avoids you having to declare the noise code more than once. This approach is slightly harder to set up since you need to work out the selectors for each element, but still isn&#8217;t that onerous.</p>
<p>If you want to add the <code>body</code> selector to the list, only include it in the second <code>:before</code> declaration, as demonstrated, because giving <code>body</code> a relative position and z-index messes things up.</p>
<p>The code shouldn&#8217;t interfere with or break any other declarations being called on the selected elements, unless you are heavily using generated content already. You could theoretically put this anywhere in your stylesheet, but because it&#8217;s so big and ugly it makes sense to put it at the bottom for ease of maintainability and bug-testing.</p>
<p><em>Don&#8217;t</em> be tempted to separate out the code into it&#8217;s own stylesheet though, or you&#8217;ll be generating another HTTP request and defeating the point of the whole exercise.</p>
<h2>Make Your Own</h2>
<p>The downside of using a Data URI is that it is fairly inflexible; you can&#8217;t edit the visual characteristics of the noise on-the-fly. For the sake of compatibility, you can&#8217;t even play around with it&#8217;s <code>opacity</code> either, because  IE8 won&#8217;t apply it&#8217;s proprietary <code>alpha()</code> filter to generated content (I&#8217;m guessing MS filters only work on DOM elements?).</p>
<p>So, if you want a slightly different looking noise, you need to create a new Data URI. As a reference, here&#8217;s how to replicate the one I created:</p>
<p>1. In the bitmap-editor of your choice, create a new 50&#215;50 px document (Through experimenting I discovered that anything larger than this tends to make the resulting URI too large to make it beneficial over using a linked image. Making it any smaller tends to create a noticeable repeat in the tiled pattern, so 50&#215;50 seems the optimum size).</p>
<p><img class="alignnone size-full wp-image-1289 colorbox-1269" title="Create New 50x50 px Document" src="http://www.mightymeta.co.uk/wp-content/uploads/create-new.png" alt="Create New 50x50 px Document" width="588" height="332" /></p>
<p>2. Create a new layer and fill it with 50% grey. In Photoshop this is achieved by selecting EDIT &gt; FILL. from the main menu.</p>
<p><img class="alignnone size-full wp-image-1290 colorbox-1269" title="Fill 50% Grey" src="http://www.mightymeta.co.uk/wp-content/uploads/fill-grey.png" alt="Fill 50% Grey" width="362" height="246" /></p>
<p>3. Apply a noise filter. In Photoshop this is found by selecting FILTER &gt; NOISE &gt; ADD NOISE from the menu. I found that uniform, monochromatic noise of about 5 &#8211; 6% works best.</p>
<p><img class="alignnone size-full wp-image-1291 colorbox-1269" title="Add Noise" src="http://www.mightymeta.co.uk/wp-content/uploads/add-noise.png" alt="Add Noise" width="332" height="426" /></p>
<p>4. Increase the contrast of the noise slightly. I did this in Photoshop by adding an Adjustment Layer and increasing the contrast by &#8217;50&#8242; with &#8216;Use Legacy&#8217; selected.</p>
<p><img class="alignnone size-full wp-image-1292 colorbox-1269" title="Increase Contrast" src="http://www.mightymeta.co.uk/wp-content/uploads/brightness-contrast.png" alt="Increase Contrast" width="225" height="378" /></p>
<p>5. Because noise is randomly generated, you will find there are some overly dark or light &#8216;clumps&#8217; in the pattern. When the tile is repeated, these will become noticeable, so they need to be smoothed out as much as possible. I did this by using the Clone Stamp to copy over the offending areas with other bits of noise that were more uniform.</p>
<p><img class="alignnone size-full wp-image-1293 colorbox-1269" title="Clumps!" src="http://www.mightymeta.co.uk/wp-content/uploads/clumps.png" alt="Clumps!" width="300" height="300" /></p>
<p>6. Reduce the opacity of the noise and delete any unwanted background layers so that the image is translucent. I did this by grouping the adjustment layer and the noise layer together and changing the opacity of the group to 25%.</p>
<p><img class="alignnone size-full wp-image-1316 colorbox-1269" title="Reduce Opacity" src="http://www.mightymeta.co.uk/wp-content/uploads/add-opacity.png" alt="Reduce Opacity" width="226" height="208" /></p>
<p>7. Save for Web. You must use the PNG-24 format to retain the translucency and because it&#8217;s compression is lossless. In Photoshop, make sure that the &#8216;Transparency&#8217; tick box is checked.</p>
<p><img class="alignnone size-full wp-image-1317 colorbox-1269" title="Save As PNG-24" src="http://www.mightymeta.co.uk/wp-content/uploads/save-for-web1.png" alt="Save As PNG-24" width="312" height="111" /></p>
<p>8. The resulting PNG can be compressed further by running it through <a href="http://optipng.sourceforge.net/">Opti-PNG</a>. On a Mac you can use the excellent <a href="http://imageoptim.pornel.net/">ImageOptim</a> which I <a href="http://www.mightymeta.co.uk/photoshop-pngs-some-quick-fixes/">first wrote about back in April 2010</a> and provides a nice drag-and-drop GUI for Opti-PNG and some other PNG compressors. It should reduce the file size by about half. It also tells you the size of the resulting image file, which is useful for step (10).</p>
<p><img class="alignnone size-full wp-image-1318 colorbox-1269" title="ImageOptim" src="http://www.mightymeta.co.uk/wp-content/uploads/imageoptim.png" alt="ImageOptim" width="527" height="191" /></p>
<p>9. Turn the image into a Data URI using one of the many online tools available. I used the one found on <a href="http://www.dopiaza.org/tools/datauri/">dopiaza.org</a> but there are plenty others out there.</p>
<p><img class="alignnone size-full wp-image-1296 colorbox-1269" title="Data URI Generation" src="http://www.mightymeta.co.uk/wp-content/uploads/data-uri.png" alt="Data URI Generation" width="536" height="404" /></p>
<p>10. Data URIs will contain more data than the binary of the original image. Check the size of the resulting URI using <a href="http://bytesizematters.com/">bytesizematters.com</a>. You should be trying to aim for a size as close to the original image as possible, otherwise the benefits of saving an extra HTTP request or two will be cancelled out.</p>
<p><img class="alignnone size-full wp-image-1298 colorbox-1269" title="Bytesizematters.com" src="http://www.mightymeta.co.uk/wp-content/uploads/bytesizematters.png" alt="Bytesizematters.com" width="600" height="194" /></p>
<h2>Browser Support</h2>
<p>A good range of browsers support this, specifically:</p>
<p>Internet Explorer 8+, FireFox 3.5+, Chrome 1+, Safari  4+, Opera 9+</p>
<h2>Final Notes</h2>
<p>This project is a bit rough around the edges and could definitely do with some further tweaking, so if anyone has any improvements to contribute, please let me know.</p>
<p>The concept could be applied to other frequently-used textures too, such as paper, stone or cloth. I&#8217;m certainly going to have a go at some of these and if anyone has some examples of their own, leave a link in the comments.</p>
<img src="http://feeds.feedburner.com/~r/mightymeta/~4/9pIpUlRAJIc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mightymeta.co.uk/1269/css-noise/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		<feedburner:origLink>http://www.mightymeta.co.uk/1269/css-noise/</feedburner:origLink></item>
		<item>
		<title>Using Photoshop Vector Tools to Create Interface Elements: Part 1</title>
		<link>http://feedproxy.google.com/~r/mightymeta/~3/bo1VSp_ODZo/</link>
		<comments>http://www.mightymeta.co.uk/1216/using-photoshop-vector-tools-to-create-interface-elements-part-1/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 16:19:28 +0000</pubDate>
		<dc:creator>James Brocklehurst</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[interface elements]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[vectors]]></category>

		<guid isPermaLink="false">http://www.mightymeta.co.uk/?p=1216</guid>
		<description><![CDATA[Both Fireworks and Illustrator have a superior feature set but I find myself using Photoshop&#8217;s vector tools for almost all interface design tasks. The main reason for this is personal familiarity (I&#8217;ve been using PS since version 2.5), but I &#8230; <a href="http://www.mightymeta.co.uk/1216/using-photoshop-vector-tools-to-create-interface-elements-part-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Both Fireworks and Illustrator have a superior feature set but I find myself using Photoshop&#8217;s vector tools for almost all interface design tasks. The main reason for this is personal familiarity (I&#8217;ve been using PS since version 2.5), but I also find there are workflow benefits from having less applications running at once.</p>
<p><span id="more-1216"></span></p>
<p>There are some things that you simply can&#8217;t do with Photoshop&#8217;s vector tools, but there is a surprising amount that you can, with a few caveats. This post gives an overview of some useful techniques and workarounds.</p>
<h2>Vectors in Photoshop</h2>
<p>For those who don&#8217;t know, vector graphics are ideal for creating interface elements since they are resolution independent and so can be scaled and manipulated without loss of quality, unlike their raster graphic counterparts.</p>
<p>Vector objects in Photoshop differ from their implementation in FireWorks and Illustrator however, since they are made from a solid colour layer that is masked by a vector path, rather than being a discrete object in it&#8217;s own right. The layer and the vector mask can be manipulated separately in the layer palette, plus the path can be selected independently using the Path or Direct Selection tools:</p>
<p><img class="alignnone size-full wp-image-1217 colorbox-1216" title="Photoshop Vector Confusion!" src="http://www.mightymeta.co.uk/wp-content/uploads/ps-vector-confusion.png" alt="Photoshop Vector Confusion!" width="456" height="294" /></p>
<p>This can consequently lead to confusion in terms of knowing quite what to select when editing &#8211; the layer? the path? the vector mask???</p>
<p>This has remained the same since vector shapes were introduced in version 6.0. Maybe it will be improved in a future release, but for now we have to grapple with these different elements when working with vectors in Photoshop.</p>
<h2>Resizing Rounded Corners</h2>
<p>Most designers will be familiar with Photoshop&#8217;s Rounded Rectangle Tool, which creates (unsurprisingly) a rectangle with rounded corners, and possibly a core component in the creation of modern interface elements. The Options bar allows you to specify a corner radius value in pixels before you begin, but unfortunately this can&#8217;t be edited on-the-fly once the rectangle has been created. Worse though, is the fact that when you transform your rectangles, the corners are transformed as well. If you are, for instance, adjusting the height of a rounded rectangle, the corners become distorted:</p>
<p><img class="alignnone size-full wp-image-1219 colorbox-1216" title="Rounded Corner Stretched" src="http://www.mightymeta.co.uk/wp-content/uploads/rounded-corner-stretched.png" alt="Rounded Corner Stretched" width="444" height="500" /></p>
<p>Fireworks gets around this problem by offering a &#8216;nine-slice&#8217; option that allows you divide the shape into a 3&#215;3 grid and keep corners intact whilst other areas are transformable. This is similar to an approach used by the Flash authoring application and also the new CSS3 border-image property.</p>
<p>No such feature is offered in PS, but there is a fix, which I will explain below:</p>
<p>1. Create a shape with the rounded rectangle tool.</p>
<p>2. Choose the Direct Selection Tool and drag a selection area over the bottom two corners of the rectangle, as shown below:</p>
<p><img class="alignnone size-full wp-image-1220 colorbox-1216" title="Direct Selection of Corners" src="http://www.mightymeta.co.uk/wp-content/uploads/rounded-corners-direct-select.png" alt="Direct Selection of Corners" width="263" height="272" /></p>
<p>3. With the Direct Selection Tool still active, drag the selected corners down to increase the height of the rectangle:</p>
<p><img class="alignnone size-full wp-image-1222 colorbox-1216" title="Rounded Corners - Move Selection" src="http://www.mightymeta.co.uk/wp-content/uploads/rounded-corners-move-selection.png" alt="Rounded Corners - Move Selection" width="234" height="341" /></p>
<p>4. The rectangle has now been transformed, whilst keeping the shape and size of the rounded corners intact:</p>
<p><img class="alignnone size-full wp-image-1223 colorbox-1216" title="Rounded Corners Not Stretched!" src="http://www.mightymeta.co.uk/wp-content/uploads/rounded-corner-not-stretched.png" alt="Rounded Corners Not Stretched!" width="435" height="500" /></p>
<h2>Quick Triangles</h2>
<p>The provided shape primitives do not seem at first to include triangles, one of the more useful shapes, if you wish to break out of &#8216;block monotony&#8217; in your interface design&#8230;</p>
<p>To create an equilateral triangle you must select the Polygon Tool and type &#8217;3&#8242; in the &#8216;sides&#8217; field in the Options Bar:</p>
<p><img class="alignnone size-full wp-image-1225 colorbox-1216" title="Making an Equilateral Triangle with the Polygon Tool" src="http://www.mightymeta.co.uk/wp-content/uploads/triangle-equilateral.png" alt="Making an Equilateral Triangle with the Polygon Tool" width="431" height="333" /></p>
<p>Holding SHIFT on the keyboard whilst drawing the triangle keeps it nicely aligned to the horizontal or vertical axis. Once created, you can use the Direct Selection Tool to manipulate the triangle&#8217;s anchor points and define different triangle types:</p>
<p><img class="alignnone size-full wp-image-1226 colorbox-1216" title="Triangles!" src="http://www.mightymeta.co.uk/wp-content/uploads/triangles-various.png" alt="Triangles!" width="500" height="300" /></p>
<h2>Combining Shapes</h2>
<p>PS provides some primitive shapes that when combined can create more advanced and useful objects. The act of fusing the paths of two shapes together is far from intuitive however.</p>
<p>The two paths that you want to combine must be present on the same vector mask in the Layers palette. This can be achieved by holding SHIFT when creating vector shapes, but if they already exist on different layers, they can be moved onto the same mask.</p>
<p>Here is how to create a tabbed content area by combining two shapes:</p>
<p>1. Create two vector shapes, a large rectangle to form the main body of the content area, and a smaller rounded rectangle to form the tab as shown below:</p>
<p><img class="alignnone size-full wp-image-1227 colorbox-1216" title="Tabbed Content - Separate Shapes" src="http://www.mightymeta.co.uk/wp-content/uploads/tabbed-content-shapes.png" alt="Tabbed Content - Separate Shapes" width="598" height="491" /></p>
<p>2. Use the Path Selection Tool to select <em>the path belonging to the rounded rectangle</em>:</p>
<p><img class="alignnone size-full wp-image-1228 colorbox-1216" title="Tabbed Content - Select Rounded Path" src="http://www.mightymeta.co.uk/wp-content/uploads/tabbed-content-select-rounded-path.png" alt="Tabbed Content - Select Rounded Path" width="597" height="491" /></p>
<p>3. CUT the path ( EDIT &gt; CUT from the menu, CTRL-X on Windows, CMD-X on Mac.</p>
<p>A dialogue box will appear, select &#8216;delete layer&#8217;, and click OK.</p>
<p><img class="alignnone size-full wp-image-1229 colorbox-1216" title="Tabbed Content - Delete Dialogue" src="http://www.mightymeta.co.uk/wp-content/uploads/tabbed-content-delete-layer.png" alt="Tabbed Content - Delete Dialogue" width="493" height="156" /></p>
<p>4. In the Layers Palette, single-click on the thumbnail of the vector mask you wish to move the path to:</p>
<p><img class="alignnone size-full wp-image-1230 colorbox-1216" title="Tabbed Content - Select Vector Mask" src="http://www.mightymeta.co.uk/wp-content/uploads/tabbed-content-select-vector-mask.png" alt="Tabbed Content - Select Vector Mask" width="218" height="174" /></p>
<p>5. PASTE the path into the selected layer mask (EDIT&gt;PASTE, CTRL-V (Win), CMD-V (Mac):</p>
<p><img class="alignnone size-full wp-image-1232 colorbox-1216" title="Tabbed Content - Paste Path" src="http://www.mightymeta.co.uk/wp-content/uploads/tabbed-content-paste-path.png" alt="Tabbed Content - Paste Path" width="760" height="461" /></p>
<p>Now this kind of looks okay, but each path is still a separate object and will behave strangely if we try to apply transforms or layer styles. To make these behave as expected, we need to combine them to create a new, single path.</p>
<p>6. To combine paths, both paths must be selected. With the Path Selection Tool active, hold SHIFT on the keyboard and click on the paths <em>until both are selected</em>. You can tell if you have both shapes selected by looking to see if all their anchor points are visible:</p>
<p><img class="alignnone size-full wp-image-1233 colorbox-1216" title="Tabbed Content - Select Both Shapes" src="http://www.mightymeta.co.uk/wp-content/uploads/tabbed-content-select-both-shapes.png" alt="Tabbed Content - Select Both Shapes" width="531" height="452" /></p>
<p>7. Now click on the COMBINE button found in the Options Bar:</p>
<p><img class="alignnone size-full wp-image-1234 colorbox-1216" title="Tabbed Content - Combine Paths" src="http://www.mightymeta.co.uk/wp-content/uploads/tabbed-content-combine-paths.png" alt="Tabbed Content - Combine Paths" width="511" height="52" /></p>
<p>We now have a single shape!</p>
<p><img class="alignnone size-full wp-image-1235 colorbox-1216" title="Tabbed Content - Combined Shapes!" src="http://www.mightymeta.co.uk/wp-content/uploads/tabbed-content-combined-shapes.png" alt="Tabbed Content - Combined Shapes!" width="756" height="460" /></p>
<p>You may have noticed that to the left of the COMBINE button were different operators for combining paths; &#8216;add&#8217;, &#8216;subtract&#8217;,'intersect&#8217; and &#8216;exclude&#8217;:</p>
<p><img class="alignnone size-full wp-image-1236 colorbox-1216" title="Combine Shape Operators" src="http://www.mightymeta.co.uk/wp-content/uploads/tabbed-content-combine-operators.png" alt="Combine Shape Operators" width="266" height="93" /></p>
<p>These are not unlike those found in the Pathfinder palette in Illustrator and most other vector drawing applications. Using the technique above with these functions allows us to create a range of complex vector objects without ever having to leave Photoshop or launch additional applications. Here are some basic examples of what is possible:</p>
<p><img class="alignnone size-full wp-image-1237 colorbox-1216" title="Example Vector Elements" src="http://www.mightymeta.co.uk/wp-content/uploads/vector-elements.png" alt="Example Vector Elements" width="350" height="239" /></p>
<p>Since these are single objects rather than a collection of separate vector paths, they can be transformed easily and layer styles will behave in the way you would expect.</p>
<h2>Ensuring Additional Anchor Points Are Linear</h2>
<p>Another method for creating more complex shapes is to append additional anchor points to a primitive shape. Again, this should be straightforward, but Photoshop tries to catch us out by making any new anchor points produce bezier curves by default. Quite often, you will want your path points to be linear, not curved. Here&#8217;s how to make that happen using a breadcrumb navigation design as an example:</p>
<p>1. Create a shape with the Rectangle Tool and then select it with the Path Selection Tool.</p>
<p>2. Switch to the Pen Tool (P on keyboard)</p>
<p>3. Move the cursor over the centre of the rectangle&#8217;s left-edge until a small &#8216;+&#8217; appears next to the cursor icon (as shown below):</p>
<p><img class="alignnone size-full wp-image-1239 colorbox-1216" title="Breadcrumb - Add Anchor Point" src="http://www.mightymeta.co.uk/wp-content/uploads/breadcrumb-add-anchor.png" alt="Breadcrumb - Add Anchor Point" width="164" height="196" /></p>
<p>4. Clicking here will add a new anchor point to the path, albeit a bezier curved one. To convert the point to a linear one, ensure the Pen Tool is still selected, <em>then hold ALT on the keyboard and click the point again</em>.</p>
<p>5. With the Direct Selection Tool, select the new linear anchor point and move it to the right, creating the following shape (using Snap To Grid helps with positioning):</p>
<p><img class="alignnone size-full wp-image-1240 colorbox-1216" title="Breadcrumb - Repositioned Anchor Point" src="http://www.mightymeta.co.uk/wp-content/uploads/breadcrumb-move-anchor.png" alt="Breadcrumb - Repositioned Anchor Point" width="362" height="356" /></p>
<p>6. By performing a similar action on the right edge of the rectangle a &#8216;chevron&#8217; shape can be created.</p>
<p>7. Duplicating the shape several times enables you to create this breadcrumb-style design:</p>
<p><img class="alignnone size-full wp-image-1241 colorbox-1216" title="Breadcrumb!" src="http://www.mightymeta.co.uk/wp-content/uploads/breadcrumb.png" alt="Breadcrumb!" width="401" height="140" /></p>
<h2>Conclusion</h2>
<p>In this post we have looked at some techniques that can be employed to create basic interface elements using the vector tools found in Photoshop. Although fiddly at times, it is possible to achieve a wide range of results, with the right know-how.</p>
<p>In Part 2, coming soon, we will look at some more advanced techniques and apply them to real-world examples.</p>
<p>Feel free to ask questions or give your opinion on using Photoshop over Fireworks or Illustrator for these kind of tasks in the comments.</p>
<img src="http://feeds.feedburner.com/~r/mightymeta/~4/bo1VSp_ODZo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mightymeta.co.uk/1216/using-photoshop-vector-tools-to-create-interface-elements-part-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.mightymeta.co.uk/1216/using-photoshop-vector-tools-to-create-interface-elements-part-1/</feedburner:origLink></item>
		<item>
		<title>WordPress 3.1 to a Client Friendly CMS in 7 Easy Steps</title>
		<link>http://feedproxy.google.com/~r/mightymeta/~3/rp1IJV0K3_I/</link>
		<comments>http://www.mightymeta.co.uk/1180/wordpress-to-client-friendly-cms/#comments</comments>
		<pubDate>Wed, 18 May 2011 14:29:50 +0000</pubDate>
		<dc:creator>James Brocklehurst</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[clients]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plug-ins]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.mightymeta.co.uk/?p=1180</guid>
		<description><![CDATA[In July of 2010 I looked at a quick way to turn a vanilla install of WordPress 3.0 into a easy to use CMS. This post revisits that original article and updates it to make it compatible with changes included &#8230; <a href="http://www.mightymeta.co.uk/1180/wordpress-to-client-friendly-cms/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In July of 2010 I looked at a quick way to turn a vanilla install of WordPress 3.0 into a easy to use CMS. This post revisits that original article and updates it to make it compatible with changes included in the 3.1 release.</p>
<p><span id="more-1180"></span></p>
<p>Although WordPress is very much geared towards blogging &#8216;out of the box&#8217;, it can easily be converted for use as a basic CMS website, with all the SEO goodness of a dynamic &#8216;latest news&#8217; area, and a back end interface that is arguably more approachable for non-technical users than other open-source CMS offerings.</p>
<p>This tutorial assumes a familiarity with the WordPress admin interface, installing plug-ins, and messing around with PHP files on the server. You will need a clean install of WP 3.1 with the default Twenty Ten theme, then for good measure should set up a duplicate or child theme from this and use this as the basis of your changes. If you are not sure how to create a child theme <a href="http://codex.wordpress.org/Child_Themes">here are some clear instructions.</a></p>
<p>Let&#8217;s get started!</p>
<h2>1. Create Some Pages</h2>
<p>The first thing to do is create some pages.</p>
<p>As you probably know, WP gives the author the option of creating either dynamic blog &#8216;posts&#8217; that can work in several contexts and taxonomies, or &#8216;pages&#8217;, which behave much more like standard, fixed, web pages. Since we are interested in setting up a CMS, we will focus mostly on page creation.</p>
<p>For this tutorial we are going to use page titles of &#8216;Home&#8217;, &#8216;About&#8217;, &#8216;Staff&#8217;, &#8216;News&#8217; and &#8216;Contact&#8217;:</p>
<p><img class="alignnone colorbox-1180" title="Creating Pages" src="http://www.mightymeta.co.uk/wp-content/uploads/creating-pages.jpg" alt="Creating Pages" width="475" height="477" /></p>
<p>Add some preliminary content to &#8216;Home&#8217;, &#8216;About&#8217;, &#8216;Staff&#8217; and &#8216;Contact&#8217;, but leave &#8216;News&#8217; blank, and disable comments on all of these pages.</p>
<h2>2. Change The Permalink Structure</h2>
<p>By default, WP creates silly URLs for pages such as &#8216;?page_id=3&#8242;. If we want the URLs of our pages to reflect their titles, which is much better for SEO and client understanding, we need to go to SETTINGS &gt; PERMALINKS and insert:</p>
<pre>/%postname%/</pre>
<p>into the &#8216;Custom Structure&#8217; field:</p>
<p><img class="alignnone colorbox-1180" title="Permalinks" src="http://www.mightymeta.co.uk/wp-content/uploads/permalinks.jpg" alt="Permalinks" width="537" height="586" /></p>
<p>By doing this, the &#8216;About&#8217; page will now have a URL of http://www.mysite/<strong>about</strong>, &#8216;News&#8217; will have http://www.mysite/<strong>news</strong>, and so on.</p>
<p><em>NOTE: This is no longer considered a good idea and may affect the performance of your site. To find out why and what it is suggested you do instead, please check out this post by Chris Coyier :</em> <a href="http://digwp.com/2011/06/dont-use-postname/">http://digwp.com/2011/06/dont-use-postname/</a></p>
<h2>3. Make the Home Page Static</h2>
<p>By default, the &#8216;Home&#8217; landing page will contain the main WordPress blog, with a reverse-chronological list of posts. To make the site less blog-like and more like a standard website, we will need to move the blog to the internal &#8216;News&#8217; page, and make the landing page static.</p>
<p>To do this go to SETTINGS &gt; READING and under the &#8216;Front Page Displays&#8217; section, change the settings  to how they appear below:</p>
<p><img class="alignnone colorbox-1180" title="Static Page Settings" src="http://www.mightymeta.co.uk/wp-content/uploads/static-page-settings.jpg" alt="Static Page Settings" width="592" height="446" /></p>
<h2>4. Create a Custom Menu</h2>
<p>This feature is new to WP 3.0+. Similar functionality is available for older versions of WordPress using the <a href="http://wordpress.org/extend/plugins/my-page-order/">My Page Order</a> plug-in, but this gives us a few more options.</p>
<p>Go to APPEARANCE &gt; MENUS</p>
<p>Type &#8216;Main Nav&#8217; in the menu name field, then click on the blue &#8216;Create Menu&#8217; button:</p>
<p><img class="alignnone colorbox-1180" title="Creating a Custom Menu" src="http://www.mightymeta.co.uk/wp-content/uploads/custom-menu-creating.jpg" alt="Creating a Custom Menu" width="565" height="123" /></p>
<p>You can now add your pages to it:</p>
<p><img class="alignnone colorbox-1180" title="Custom Menu - Adding Pages" src="http://www.mightymeta.co.uk/wp-content/uploads/custom-menu-adding-pages.jpg" alt="Custom Menu - Adding Pages" width="296" height="237" /></p>
<p>and can arrange their order by dragging and dropping them into place:</p>
<p><img class="alignnone colorbox-1180" title="Custom Menu Reordering" src="http://www.mightymeta.co.uk/wp-content/uploads/custom-menu-reordering.jpg" alt="Custom Menu Reordering" width="431" height="245" /></p>
<p>A particularly good feature of this is the ability to nest pages within pages, which automatically generates a drop-down on the menu:</p>
<p><img class="alignnone colorbox-1180" title="Custom Menu - Nested Pages" src="http://www.mightymeta.co.uk/wp-content/uploads/custom-menu-nested.jpg" alt="Custom Menu - Nested Pages" width="460" height="251" /></p>
<p><img class="alignnone colorbox-1180" title="Custom Menu - Dropdown Example" src="http://www.mightymeta.co.uk/wp-content/uploads/custom-menu-drop-down.jpg" alt="Custom Menu - Dropdown Example" width="281" height="98" /></p>
<p>Infact, if we take a quick look at what we have got so far, we already have a fully-fledged standards compliant, SEO-friendly CMS site up and running, with editable fields for the content on our four main pages, a fully-functioning &#8216;latest news&#8217; section,  and a dynamically generated menu:</p>
<p><img class="alignnone colorbox-1180" title="Site Preview - Half Way There!" src="http://www.mightymeta.co.uk/wp-content/uploads/site-preview-half-way.jpg" alt="Site Preview - Half Way There!" width="664" height="545" /></p>
<p>Yes, that sidebar needs removing but we&#8217;ll come to that a bit later.</p>
<h2>5. Tweak the Admin Interface</h2>
<p>The order of the items in the main admin toolbar don&#8217;t make a lot of sense to clients if they aren&#8217;t using WP as a blog. The focus is clearly on blogging, and the &#8216;Pages&#8217; section, which is most relevant for our purposes, appears fourth on the list:</p>
<p><img class="alignnone colorbox-1180" title="Toolbar - Default" src="http://www.mightymeta.co.uk/wp-content/uploads/toolbar-before.jpg" alt="Toolbar - Default" width="164" height="384" /></p>
<p>There is a nifty plug-in called <a href="http://wordpress.org/extend/plugins/admin-menu-editor/">Admin Menu Editor</a> by <a href="http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/">W-Shadow</a> which can quickly resolve this. I tried once to manually edit the PHP files for the toolbar, it was very time-consuming, and was problematic when it came to upgrading. This method is much less of a headache, in my opinion.</p>
<p>Install the plug-in, go to its settings and move the &#8216;Pages&#8217; tab to the top of the toolbar, above &#8216;Posts&#8217; but below the &#8216;Dashboard&#8217; tab and its divider :</p>
<p><img class="alignnone colorbox-1180" title="Admin Menu Editor" src="http://www.mightymeta.co.uk/wp-content/uploads/admin-menu-editor1.jpg" alt="Admin Menu Editor" width="377" height="316" /></p>
<p>This makes much more sense when using WP a CMS, and will confuse clients less, I believe.</p>
<p>Additionally, by creating a user account with an &#8216;Editor&#8217; role for the client, access to many of the other tabs is removed and you get a much more intuitive and easier to use interface for less confident clients.</p>
<p>the resulting toolbar looks like this:</p>
<p><img class="alignnone colorbox-1180" title="Toolbar - Client View" src="http://www.mightymeta.co.uk/wp-content/uploads/toolbar-after-clientview.jpg" alt="Toolbar - Client View" width="159" height="305" /></p>
<p>That&#8217;s much better. Of course, admin users will still get full access to appearance, plug-ins, settings, etc.</p>
<p>Another admin tweak you may or may not want to consider is disabling the new admin bar (added in 3.1) that is by default presented over the top of your site when viewed by a logged in user. I personally don&#8217;t like the admin bar and feel that it may confuse clients, who could think that their visitors will see it too.</p>
<p>To remove it, go to USERS &gt; (USER NAME) and uncheck the <em>&#8216;when viewing site&#8217;</em> tickbox under <em>&#8216;show admin bar&#8217;</em>.</p>
<p><img class="alignnone size-full wp-image-1185 colorbox-1180" title="Disable Admin Bar" src="http://www.mightymeta.co.uk/wp-content/uploads/disable-admin-bar.jpg" alt="Disable Admin Bar" width="542" height="598" /></p>
<p>You will have to do this individually for each user you have created.</p>
<h2>6. Create Additional Editable Content Blocks</h2>
<p>One standard feature of most CMS&#8217;s that WP lacks out of the box is the ability to set up more than one editable region for a page. More complex layouts might require different blocks or columns that you need to make independently editable for the client. We also have that sidebar with all the blog-related widgets appearing on every page at the moment, and this should only appear in the &#8216;News&#8217; section. How do we do these things in WP???</p>
<p>First we need to install the <a href="http://wordpress.org/extend/plugins/secondary-html-content/">Secondary HTML Content</a> plug-in by <a href="http://www.cmurrayconsulting.com/software/wordpress-secondary-html-content/">Jake Goldman</a>. This allows us to add up to four additional editable content blocks to each page. On it&#8217;s settings page, you simply choose how many extra blocks you want to add (for this tutorial we&#8217;ll just add one), and check the &#8216;add media buttons&#8217; tickbox*.</p>
<p><img class="alignnone colorbox-1180" title="Secondary HTML Settings" src="http://www.mightymeta.co.uk/wp-content/uploads/secondary-html-settings.jpg" alt="Secondary HTML Settings" width="509" height="440" /></p>
<p><em>* &#8216;Add Media Buttons&#8217; allows clients to add images via buttons added to the MCE editor (by default they can only create and format text). This feature doesn&#8217;t currently seem to work in WP 3.0+, but presumably will be fixed by the author of the plug-in soon.</em></p>
<p>We now need to edit a theme file on the server to include the secondary content code. This sounds like it might be fiddly, but is actually very straightforward.</p>
<p>The file we need to edit is called <strong>loop-page.php</strong> which can be found in your theme&#8217;s directory (if you are using a child theme, place a copy of this file in your child directory &#8211; it will override the original).</p>
<p>Open it in the editor of your choice and paste in the following code:</p>
<pre>&lt;div id="content2"&gt;
    &lt;?php the_content_2(); ?&gt;
&lt;/div&gt;</pre>
<p>Put it after <code>&lt;!-- #post-## --&gt;</code> (the end of the first editable region), but before <code>comments_template();</code> like this:</p>
<p><img class="alignnone size-full wp-image-1189 colorbox-1180" title="Paste Secondary Content Code" src="http://www.mightymeta.co.uk/wp-content/uploads/add-secondary-content.png" alt="Paste Secondary Content Code" width="519" height="246" /></p>
<p>We could just insert the PHP function, but wrapping it in a div allows us to give it an <code>id</code> (or <code>class</code>) attribute and therefore style and position the block using CSS.</p>
<p>Save <strong>loop-page.php</strong> then go back to the WP admin area. Refresh your browser, then start editing one of your pages.</p>
<p>You will now notice that you now have two WYSIWYG editors to play with:</p>
<p><img class="alignnone size-full wp-image-1198 colorbox-1180" title="Secondary Editor" src="http://www.mightymeta.co.uk/wp-content/uploads/secondary-content-editor1.jpg" alt="Secondary Editor" width="706" height="482" /></p>
<p>Content entered into the second editor will be published onto the page, in a discrete block wrapped by a <code>div</code> with an id of <code>content2</code>.</p>
<p>By default, the second content block is stacked underneath the first, but with a bit of CSS magic, these two areas can be positioned anywhere that you want on the page.</p>
<h2>7. Removing the Sidebar</h2>
<p>To remove the blog sidebar from your static pages, select <em>&#8216;one-column, no sidebar&#8217;</em> from the template input in the <em>&#8216;page attributes&#8217;</em> box when editing a page:</p>
<p><img class="alignnone size-full wp-image-1191 colorbox-1180" title="Change Template" src="http://www.mightymeta.co.uk/wp-content/uploads/change-template.jpg" alt="Change Template" width="295" height="248" /></p>
<p>Update the page for the new template to take effect.</p>
<h2>That&#8217;s It!</h2>
<p>Finished Home Page, with two editable content areas and no sidebar:</p>
<p><img class="alignnone colorbox-1180" title="Finished - Home" src="http://www.mightymeta.co.uk/wp-content/uploads/finished-home.jpg" alt="Finished - Home" width="640" height="421" /></p>
<p>Finished &#8216;News&#8217; section, using regular blog layout with sidebar intact:</p>
<p><img class="alignnone colorbox-1180" title="Finished - News" src="http://www.mightymeta.co.uk/wp-content/uploads/finished-news.jpg" alt="Finished - News" width="662" height="642" /></p>
<p>With these quick steps, which shouldn&#8217;t take you more than fifteen minutes, we can change a brand new WordPress install into a fully functioning CMS website that contains multiple editable regions, a dynamically generated drop-down menu, a dynamic &#8216;news&#8217; section, and a streamlined admin interface. The Twenty Ten theme is plain enough to form the basis of a unique design that can now be styled by simply editing the main CSS document.</p>
<p>Happy <del>blogging</del> CMS-ing!</p>
<img src="http://feeds.feedburner.com/~r/mightymeta/~4/rp1IJV0K3_I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mightymeta.co.uk/1180/wordpress-to-client-friendly-cms/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<feedburner:origLink>http://www.mightymeta.co.uk/1180/wordpress-to-client-friendly-cms/</feedburner:origLink></item>
		<item>
		<title>No More Need For Some CSS3 Vendor Prefixes</title>
		<link>http://feedproxy.google.com/~r/mightymeta/~3/XndUi6RNVc4/</link>
		<comments>http://www.mightymeta.co.uk/1103/no-more-need-for-some-css3-vendor-prefixes/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 16:24:43 +0000</pubDate>
		<dc:creator>James Brocklehurst</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[prefixes]]></category>

		<guid isPermaLink="false">http://www.mightymeta.co.uk/?p=1103</guid>
		<description><![CDATA[Now that Firefox 4 and IE9 have finally arrived and users upgrade their browsers in healthy numbers, applying the latest cutting-edge techniques to real-world sites becomes more of an option. One perk is that the latest versions of all browsers &#8230; <a href="http://www.mightymeta.co.uk/1103/no-more-need-for-some-css3-vendor-prefixes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Now that <a href="http://www.mozilla.com/en-US/firefox/fx/">Firefox 4</a> and <a href="http://windows.microsoft.com/en-US/internet-explorer/downloads/ie">IE9</a> have finally arrived and users upgrade their browsers in <a href="http://glow.mozilla.org/">healthy</a> <a href="http://windowsteamblog.com/ie/b/ie/archive/2011/03/16/2-3-million-downloads-of-ie9-in-the-first-24-hours.aspx">numbers</a>, applying the latest cutting-edge techniques to real-world sites becomes more of an option. One perk is that the latest versions of all browsers are beginning to drop need for vendor prefixes on some CSS3 properties. This post gives an overview.</p>
<p><span id="more-1103"></span></p>
<h2>Why Prefixes?</h2>
<p>Prefixes were introduced because the CSS3 specification is still in development. Both the proposed syntax, and the way that browser manufacturers (or &#8216;vendors&#8217;) implement the proposals is in a state of flux. But because some of the proposals were so darn cool, nobody could wait. Prefixes provide a way of adding in what are, in essence, experimental and unfinished properties in a way that (A) won&#8217;t harm or affect the rest of your code, (B) can be overridden once the spec is finished and implemented, and (C) avoid any confusion over what is unfinished and what isn&#8217;t.</p>
<h2>The Multiple Declaration Issue</h2>
<p>Each vendor providing a different prefix to use has a side-effect however. Your CSS documents soon get littered with this sort of thing:</p>
<pre>-moz-border-radius:5px;
-webkit-border-radius:5px;
-ms-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
-moz-box-shadow:1px 1px 8px #999;
-webkit-box-shadow:1px 1px 8px #999;
-ms-box-shadow:1px 1px 8px #999;
-o-box-shadow:1px 1px 8px #999;
 box-shadow:1px 1px 8px #999;</pre>
<p>This can be a pain to type out by hand and in large quantities may affect page load times. <a href="http://lesscss.org/">LESS</a>, <a href="http://sass-lang.com/">SASS</a> and <a href="http://cssprefixer.appspot.com/">CSSPrefixer</a> offer solutions using variables, mix-ins and server-side preprocessing, but require Ruby or Python plus learning some new syntax or running console commands. Chris Coyier suggests that we should stop moaning, start cutting-and-pasting, and <a href="http://www.netmagazine.com/features/how-avoid-common-css3-mistakes">just include prefixes for everything</a>.</p>
<p>While I agree with this view for some properties, there are times when we really can start doing something like this, removing the need for hassle and bloat in our stylesheets:</p>
<pre>border-radius: 5px;</pre>
<h2>Really?</h2>
<p>Yes! Although the CSS3 spec is still in development and won&#8217;t become an official recommendation for several years, some of it&#8217;s &#8216;modules&#8217; are near recommendation stage, leading to vendors removing the need for prefixes in the latest versions of their browsers.</p>
<p>The main properties that I suggest can now be considered &#8216;prefix-safe&#8217; are <code>border-radius</code> and <code>box-shadow</code>. These join the handful of other properties that never needed prefixes in the first place, such as <code>@font-face</code>, <code>text-shadow</code>, <code>opacity</code>, and multiple <code>background</code> declarations.</p>
<p>Don&#8217;t believe me? Here is a table.</p>
<p><!-- table 	{mso-displayed-decimal-separator:"\."; 	mso-displayed-thousand-separator:"\,";} .font5 	{color:windowtext; 	font-size:8.0pt; 	font-weight:400; 	font-style:normal; 	text-decoration:none; 	font-family:Verdana; 	mso-generic-font-family:auto; 	mso-font-charset:0;} td 	{padding-top:1px; 	padding-right:1px; 	padding-left:1px; 	mso-ignore:padding; 	color:windowtext; 	font-size:10.0pt; 	font-weight:400; 	font-style:normal; 	text-decoration:none; 	font-family:Verdana; 	mso-generic-font-family:auto; 	mso-font-charset:0; 	mso-number-format:General; 	text-align:general; 	vertical-align:bottom; 	border:none; 	mso-background-source:auto; 	mso-pattern:auto; 	mso-protection:locked visible; 	white-space:nowrap; 	mso-rotate:0;} ruby 	{ruby-align:left;} rt 	{color:windowtext; 	font-size:8.0pt; 	font-weight:400; 	font-style:normal; 	text-decoration:none; 	font-family:Verdana; 	mso-generic-font-family:auto; 	mso-font-charset:0; 	mso-char-type:none; 	display:none;} --></p>
<table border="0" cellspacing="0" cellpadding="0" width="300">
<colgroup>
<col span="4" width="75"></col>
</colgroup>
<tbody>
<tr height="13">
<td style="text-align: center;" width="75" height="13"><strong>Browser</strong></td>
<td width="75"><strong>Version</strong></td>
<td style="text-align: center;" width="75"><strong><code>border-radius</code></strong></td>
<td style="text-align: center;" width="75"><strong><code>box-shadow</code></strong></td>
</tr>
<tr height="13">
<td height="13"><img class="alignleft size-full wp-image-1121 colorbox-1103" title="Firefox" src="http://www.mightymeta.co.uk/wp-content/uploads/firefox.png" alt="Firefox" width="48" height="48" /></td>
<td>3.5, 3.6</td>
<td style="text-align: center;">-moz-</td>
<td style="text-align: center;">-moz-</td>
</tr>
<tr height="13">
<td height="13"><img class="alignleft size-full wp-image-1121 colorbox-1103" title="Firefox" src="http://www.mightymeta.co.uk/wp-content/uploads/firefox.png" alt="Firefox" width="48" height="48" /></td>
<td>4+</td>
<td><img class="size-full wp-image-1114 aligncenter colorbox-1103" title="Yes" src="http://www.mightymeta.co.uk/wp-content/uploads/001_06.png" alt="Tick" width="24" height="24" /></td>
<td><img class="size-full wp-image-1114 aligncenter colorbox-1103" title="Yes" src="http://www.mightymeta.co.uk/wp-content/uploads/001_06.png" alt="Tick" width="24" height="24" /></td>
</tr>
<tr height="13">
<td height="13"><img class="alignleft size-full wp-image-1116 colorbox-1103" title="Chrome" src="http://www.mightymeta.co.uk/wp-content/uploads/chrome.png" alt="Chrome" width="48" height="48" /></td>
<td>5+</td>
<td><img class="size-full wp-image-1114 aligncenter colorbox-1103" title="Yes" src="http://www.mightymeta.co.uk/wp-content/uploads/001_06.png" alt="Tick" width="24" height="24" /></td>
<td><img class="size-full wp-image-1114 aligncenter colorbox-1103" title="Yes" src="http://www.mightymeta.co.uk/wp-content/uploads/001_06.png" alt="Tick" width="24" height="24" /></td>
</tr>
<tr height="13">
<td height="13"><img class="alignleft size-full wp-image-1117 colorbox-1103" title="Safari" src="http://www.mightymeta.co.uk/wp-content/uploads/safari.png" alt="Safari" width="48" height="48" /></td>
<td>5+</td>
<td><img class="size-full wp-image-1114 aligncenter colorbox-1103" title="Yes" src="http://www.mightymeta.co.uk/wp-content/uploads/001_06.png" alt="Tick" width="24" height="24" /></td>
<td style="text-align: center;">-webkit-</td>
</tr>
<tr height="13">
<td height="13"><img class="alignleft size-full wp-image-1118 colorbox-1103" title="Opera" src="http://www.mightymeta.co.uk/wp-content/uploads/opera.png" alt="Opera" width="48" height="48" /></td>
<td>10.5+</td>
<td><img class="size-full wp-image-1114 aligncenter colorbox-1103" title="Yes" src="http://www.mightymeta.co.uk/wp-content/uploads/001_06.png" alt="Tick" width="24" height="24" /></td>
<td><img class="size-full wp-image-1114 aligncenter colorbox-1103" title="Yes" src="http://www.mightymeta.co.uk/wp-content/uploads/001_06.png" alt="Tick" width="24" height="24" /></td>
</tr>
<tr height="13">
<td height="13"><img class="alignleft size-full wp-image-1119 colorbox-1103" title="Internet Explorer" src="http://www.mightymeta.co.uk/wp-content/uploads/internet_explorer.png" alt="Internet Explorer" width="48" height="48" /></td>
<td>9+</td>
<td><img class="size-full wp-image-1114 aligncenter colorbox-1103" title="Yes" src="http://www.mightymeta.co.uk/wp-content/uploads/001_06.png" alt="Tick" width="24" height="24" /></td>
<td><img class="size-full wp-image-1114 aligncenter colorbox-1103" title="Yes" src="http://www.mightymeta.co.uk/wp-content/uploads/001_06.png" alt="Tick" width="24" height="24" /></td>
</tr>
</tbody>
</table>
<p>Ticks mean no need for a prefix, in case that isn&#8217;t clear.</p>
<p>As we can see, we&#8217;re in pretty safe territory now with these two properties. I&#8217;m surprised that Safari (5% of global share) still requires a prefix for <code>box-shadow</code> when it&#8217;s Webkit stablemate Chrome has dropped it, but as both Mozilla and Microsoft <a href="http://www.webmonkey.com/2011/03/microsoft-sets-june-date-for-automatic-ie-9-upgrades/">push for their users to upgrade</a>, this will become less of a concern. Generally though, things are looking pretty good and IE9&#8242;s general lack of a need for <code>-ms-</code> has got to be celebrated.</p>
<p>Hopefully some of the other more exciting CSS3 properties such as <code>transform</code> will follow suit soon.</p>
<p>Some links to the current available info on prefix implementations can be found <a href="http://meyerweb.com/eric/thoughts/2010/10/08/vendor-prefix-lists/">here</a></p>
<p>If you like the idea of dropping prefixes, or perhaps know of some reason as to why this would be a bad idea, please leave your views in the comments.</p>
<img src="http://feeds.feedburner.com/~r/mightymeta/~4/XndUi6RNVc4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mightymeta.co.uk/1103/no-more-need-for-some-css3-vendor-prefixes/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.mightymeta.co.uk/1103/no-more-need-for-some-css3-vendor-prefixes/</feedburner:origLink></item>
		<item>
		<title>CSS3 Animated Vignette Buttons</title>
		<link>http://feedproxy.google.com/~r/mightymeta/~3/ij5I0wp-Ta4/</link>
		<comments>http://www.mightymeta.co.uk/1075/css3-animated-vignette-buttons/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 17:35:06 +0000</pubDate>
		<dc:creator>James Brocklehurst</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[generated content]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[PNG]]></category>
		<category><![CDATA[transitions]]></category>
		<category><![CDATA[transparency]]></category>

		<guid isPermaLink="false">http://www.mightymeta.co.uk/?p=1075</guid>
		<description><![CDATA[Here I have another go at tinkering around with background images that fade on hover. This time I&#8217;ve used a patterned background and placed vignette-style .pngs over the top which are animated using transition. Demo (Works Best in Firefox 4, &#8230; <a href="http://www.mightymeta.co.uk/1075/css3-animated-vignette-buttons/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here I have another go at tinkering around with background images that fade on hover. This time I&#8217;ve used a patterned background and placed vignette-style .pngs over the top which are animated using <code>transition</code>.</p>
<p><span id="more-1075"></span></p>
<p><img class="alignnone size-full wp-image-1099 colorbox-1075" title="CSS3 Animated Vignette Buttons" src="http://www.mightymeta.co.uk/wp-content/uploads/vignette.jpg" alt="CSS3 Animated Vignette Buttons" width="600" height="166" /></p>
<p><a class="download" href="http://www.mightymeta.co.uk/demos/css3-animated-vignette-buttons/">Demo (Works Best in Firefox 4, Chrome or Safari)</a></p>
<p><a class="download" href="http://dl.dropbox.com/u/1208404/vignette-buttons.zip">Download Source</a></p>
<p><em>background image derived from one of <a href="http://www.bittbox.com/freebies/free-texture-tuesday-retro-wallpaper-2">BittBox&#8217;s Retro Wallpapers</a></em></p>
<h2>Tutorial</h2>
<h3>The Set Up</h3>
<p>Each example in the demo is a single <code>&lt;a&gt;</code> element, so the HTML is about as basic as it gets:</p>
<pre>&lt;a class="button" href="#"&gt;A Button!&lt;/a&gt;</pre>
<p>Next up, we add in some standard styling that will work in all browsers.</p>
<pre>.button {
display: block;
width: 5em;
padding: 30px 40px;
text-align: center;
font-family: Arial, sans-serif;
font-size: 18px;
color: #fff;
text-decoration: none;
background: url(images/background.png) no-repeat center -100px;
}

.button:hover {
background: url(images/background.png) no-repeat center 0px;
}</pre>
<p>You&#8217;ll notice that I&#8217;m using a sprite, it looks like this:</p>
<p><img class="size-full wp-image-1079 alignnone colorbox-1075" title="Vignette Button Background Sprite" src="http://www.mightymeta.co.uk/wp-content/uploads/background.png" alt="Vignette Button Background Sprite" width="180" height="200" /></p>
<p>The declaration positions the darker image in place first, then moves the brighter version into view on hover.</p>
<p>To finish the set up, we sprinkle on a bit of CSS3 goodness for those browsers that have joined the party.</p>
<pre>.button {
display: block;
width: 5em;
padding: 30px 40px;
text-align: center;
font-family: Arial, sans-serif;
font-size: 18px;
color: #fff;
text-decoration: none;
text-shadow: 1px 1px 0px #000;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
-o-border-radius: 25px;       
border-radius: 25px;
-moz-box-shadow: 2px 2px 10px #000;
-webkit-box-shadow: 2px 2px 10px #000;
-o-box-shadow: 2px 2px 10px #000;
box-shadow: 2px 2px 10px #000;
background: url(images/background.png) no-repeat center -100px;
}</pre>
<p>Result, one baroque looking but unremarkable button, with a basic hover effect:</p>
<p><img class="alignnone size-full wp-image-1081 colorbox-1075" title="A Button!" src="http://www.mightymeta.co.uk/wp-content/uploads/a-button.jpg" alt="A Button!" width="186" height="101" /></p>
<h3>Example One &#8211; A Simple Fade</h3>
<p>The first example uses a technique similar to that used by <a href="http://snook.ca/archives/javascript/jquery-bg-image-animations/">Jonathan Snook</a>, the difference being that we are using CSS3 instead of JQuery and layered, semi-transparent backgrounds instead of just one.</p>
<p>The additional image used is this:</p>
<p><img class="alignnone size-full wp-image-1091 colorbox-1075" title="Linear Gradient" src="http://www.mightymeta.co.uk/wp-content/uploads/linear-gradient1.png" alt="Linear Gradient" width="200" height="600" /></p>
<p>This is placed over the background using the CSS3 multiple background syntax. By moving the original background declaration to the top (rather than replacing it) means that browsers that don&#8217;t support multiple backgrounds will parse the first and simply ignore the second. For those that do, the second declaration overrides the first.</p>
<pre>.button {

/* Fallback for browsers that don't support multiple bgs*/

background: url(images/background.png) no-repeat center -100px;

/* Style for the rest */        

display: block;
width: 5em;
padding: 30px 40px;
text-align: center;
font-family: Arial, sans-serif;
font-size: 18px;
color: #fff;
text-decoration: none;
text-shadow: 1px 1px 0px #000;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
-o-border-radius: 25px;       
border-radius: 25px;
-moz-box-shadow: 2px 2px 10px #000;
-webkit-box-shadow: 2px 2px 10px #000;
-o-box-shadow: 2px 2px 10px #000;
box-shadow: 2px 2px 10px #000;
background: url(images/linear-gradient.png) no-repeat 0px -400px, url(images/background.png) no-repeat center 0px;
}

.button:hover {

/* Fallback for browsers that don't support multiple bgs*/

background: url(images/background.png) no-repeat center 0px;

/* Hover style for the rest */        

background: url(images/linear-gradient.png) no-repeat 0px 0px, url(images/background.png) no-repeat center 0px;

}</pre>
<p>So, what&#8217;s happening here is that the dark part of the gradient is placed over background pattern, then the gradient is moved on hover to a more tranparent position, revealing more of the pattern underneath.</p>
<p>Now we have this set up, we can animate the change of gradient position using CSS3 transitions by adding this code on to the end of each rule:</p>
<pre>-moz-transition: all 1s ease;
-webkit-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;</pre>
<p>Transitions are only supported by Webkit browsers and the upcoming Firefox 4, but those that don&#8217;t will still show the hover effect, it just won&#8217;t fade in. You could always supply a <a href="http://css-tricks.com/fade-image-within-sprite/">JQuery fallback</a> of course.</p>
<h3>Example Two &#8211; Peek-A-Boo!</h3>
<p>This is a simple variation of the first example, the difference being that the gradient is reflected, giving the impression that you are peeking through some sort of spy-hole when it moves into place. <code>ease-out</code> is used on the <code>transition</code> to give it extra &#8216;springyness&#8217;.</p>
<p>Image used:</p>
<p><img class="alignnone size-full wp-image-1090 colorbox-1075" title="Reflected Gradient" src="http://www.mightymeta.co.uk/wp-content/uploads/reflected-gradient.png" alt="Reflected Gradient" width="199" height="350" /></p>
<p>CSS:</p>
<pre>.button {

 /* Fallback for browsers that don't support multiple bgs*/

 background: url(images/background.png) no-repeat center -105px;

 /* Style for the rest */        

 display: block;
 width: 5em;
 margin: 0px 20px;
 padding: 30px 40px;
 text-align: center;
 font-family: Arial, sans-serif;
 font-size: 18px;
 color: #fff;
 text-decoration: none;
 text-shadow: 1px 1px 0px #000;
 -moz-border-radius: 25px;
 -webkit-border-radius: 25px;
 -o-border-radius: 25px;       
 border-radius: 25px;
 background: url(images/stripes.png) no-repeat 0px 0px, url(images/background.png) no-repeat center -8px;
 -moz-box-shadow: 2px 2px 10px #000;
 -webkit-box-shadow: 2px 2px 10px #000;
 -o-box-shadow: 2px 2px 10px #000;
 box-shadow: 2px 2px 10px #000;       
 -moz-transition: all 1s ease-out;
 -webkit-transition: all 1s ease-out;
 -o-transition: all 1s ease-out;
 transition: all 1s ease-out;

 }

 .button:hover {

 /* Fallback for browsers that don't support multiple bgs*/

 background: url(images/background.png) no-repeat center -5px;

 /* Hover style for the rest */        

 background: url(images/stripes.png) no-repeat 0px -200px, url(images/background.png) no-repeat center -8px;
 -moz-transition: all 0.5s ease;
 -webkit-transition: all 0.5s ease;
 -o-transition: all 0.5s ease;
 transition: all 0.5s ease;        

 }</pre>
<h3>Example Three &#8211; Iris</h3>
<p>This uses a different approach during the <code>transition</code>, animating <code>background-size</code>, rather than <code>background-position</code>. If we create a radial gradient with a transparent hole in the middle, this can be stretched to become larger, revealing more of the patterned background underneath on <code>:hover</code>.</p>
<p>Image used:</p>
<p><img class="alignnone size-full wp-image-1093 colorbox-1075" title="Radial Gradient" src="http://www.mightymeta.co.uk/wp-content/uploads/radial-gradient.png" alt="Radial Gradient" width="198" height="200" /></p>
<p>CSS</p>
<pre>.button {

 /* Fallback for browsers that don't support multiple bgs*/

 background: url(images/background.png) no-repeat center -105px;

 /* Style for the rest */

 display: block;
 width: 5em;
 padding: 30px 40px;
 text-align: center;
 font-family: Arial, sans-serif;
 font-size: 18px;
 color: #fff;
 text-decoration: none;
 text-shadow: 1px 1px 0px #000;
 -moz-border-radius: 25px;
 -webkit-border-radius: 25px;
 -o-border-radius: 25px;       
 border-radius: 25px;
 background: url(images/radial-gradient.png) no-repeat center center, url(images/background.png) no-repeat center -8px;
 -moz-box-shadow: 2px 2px 10px #000;
 -webkit-box-shadow: 2px 2px 10px #000;
 -o-box-shadow: 2px 2px 10px #000;
 box-shadow: 2px 2px 10px #000;       
 -moz-background-size: 200px 200px, 180px 200px;
 -webkit-background-size: 200px 200px, 180px 200px;
 -o-background-size: 200px 200px, 180px 200px;
 background-size: 200px 200px, 180px 200px;       
 -moz-transition: all 0.75s ease;
 -webkit-transition: all 0.75s ease;
 -o-transition: all 0.75s ease;
 transition: all 0.75s ease;

 }

 .button:hover {

 /* Fallback for browsers that don't support multiple bgs*/

 background: url(images/background.png) no-repeat center -5px;

 /* Hover style for the rest */

 background: url(images/radial-gradient.png) no-repeat center center, url(images/background.png) no repeat center -8px;
 -moz-background-size: 1000px 1000px, 180px 200px;
 -webkit-background-size: 1000px 1000px, 180px 200px;
 -o-background-size: 1000px 1000px, 180px 200px;
 background-size: 1000px 1000px, 180px 200px;       
 -moz-transition: all 1s ease;
 -webkit-transition: all 1s ease;
 -o-transition: all 1s ease;
 transition: all 1s ease;

 }</pre>
<h3>Conclusion</h3>
<p>I can see there being a lot more possibilities with this technique, using different background images, gradient shapes and position/size animations. If you come up with some, feel free to drop a link in to the comments.</p>
<h3>And Finally&#8230;</h3>
<p>This post is part of a personal challenge to try and create buttons that fade between two background images, without requiring lots of unsemantic absolutely positioned elements.</p>
<p>I&#8217;ve found a way to do it using CSS generated content, after reading <a href="http://nicolasgallagher.com/multiple-backgrounds-and-borders-with-css2/">this post</a> by Nicolas Gallagher, but currently only Firefox 4+ will animate generated stuff using <code>transition</code>. Yes, and before you ask, JavaScript won&#8217;t do it either.</p>
<p>Anyway, <a href="http://www.mightymeta.co.uk/demos/background-fader-4/background-fading4.html">here is a link to what I have come up with so far</a> (remember, FF4+ only). It&#8217;s one step closer, and if the WebKit team get on board with animating generated content, then we&#8217;re almost there.</p>
<img src="http://feeds.feedburner.com/~r/mightymeta/~4/ij5I0wp-Ta4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mightymeta.co.uk/1075/css3-animated-vignette-buttons/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.mightymeta.co.uk/1075/css3-animated-vignette-buttons/</feedburner:origLink></item>
		<item>
		<title>A CSS Proposal: Background-Opacity</title>
		<link>http://feedproxy.google.com/~r/mightymeta/~3/EXDdEL1VXRg/</link>
		<comments>http://www.mightymeta.co.uk/1025/a-css-proposal-background-opacity/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 15:54:40 +0000</pubDate>
		<dc:creator>James Brocklehurst</dc:creator>
				<category><![CDATA[General Musings]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[PNG]]></category>
		<category><![CDATA[RGBa]]></category>
		<category><![CDATA[transparency]]></category>

		<guid isPermaLink="false">http://www.mightymeta.co.uk/?p=1025</guid>
		<description><![CDATA[In my fantasy CSS3 world, a background-opacity property would exist, and this is why I think it would be a good thing to have. What Would it Do? Currently, we have a background property, that can take a number of &#8230; <a href="http://www.mightymeta.co.uk/1025/a-css-proposal-background-opacity/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my fantasy CSS3 world, a <code>background-opacity</code> property would exist, and this is why I think it would be a good thing to have.</p>
<p><span id="more-1025"></span><br />
<img class="alignnone size-full wp-image-1032 colorbox-1025" title="background-opacity" src="http://www.mightymeta.co.uk/wp-content/uploads/background-opacity.jpg" alt="background-opacity" width="600" height="272" /></p>
<h2>What Would it Do?</h2>
<p>Currently, we have a <code>background</code> property, that can take a number of arguments, which can be chained together using a shorthand syntax, or declared as separate properties. Some of these include:</p>
<ul>
<li><code>background-color</code> (set background as a flat colour, which can contain alpha-transparent values)</li>
<li><code>background-image</code> (set background as single or multiple images)</li>
<li><code>background-position</code> (set position of background image/s within element)</li>
<li><code>background-repeat</code> (specify tiling of background images along x and y axes)</li>
</ul>
<p>We also have an <code>opacity</code> property that allows us to specify a value from 0 to 1 to control an element&#8217;s transparency.</p>
<p><code>background-opacity</code> would take an approach similar to <code>opacity</code>, and allow us to specify a 0 to 1 value for background images. It would be able to work with single or multiple backgrounds.</p>
<h2>The Current Situation</h2>
<p>At present, if you want to make background-images semi-transparent, you have two options, either create a semi-transparent PNG in an image editor, or use the <code>opacity</code> property. Both approaches have significant shortcomings.</p>
<p>There is a &#8216;third way&#8217; using RGBa, but this only works with CSS generated colours or gradients, not images.</p>
<h3>The PNG Problem</h3>
<p>Semi-transparent PNGs are great, but to include them requires a string value for the <code>url</code> declaration. This means they can&#8217;t be animated using JavaScript or CSS transitions, other than by using other properties that contain numeric values. Therefore, it is possible to animate the position of a background image (like in <a href="http://snook.ca/archives/javascript/jquery-bg-image-animations/">this set of examples</a> by Jonathan Snook), but not it&#8217;s opacity.</p>
<h3>The Opacity Property Problem</h3>
<p><code>opacity</code> has been around for a while, but works in a singularly frustrating way. The opacity value is applied to the entire element and <em>any corresponding child elements</em>. There are <a href="http://css-tricks.com/non-transparent-elements-inside-transparent-elements/">some</a> <a href="http://acidmartin.wordpress.com/2010/11/21/using-rgba-to-prevent-the-css-opacity-inheritance-from-parent-to-child-elements/">workarounds</a> for this, but they have drawbacks. The bottom line is that you can&#8217;t override <code>opacity</code> inheritance, and if you want to make an element&#8217;s background image transparent, but keep it&#8217;s content opaque, you&#8217;re out of luck.</p>
<h2>Proposed Syntax</h2>
<pre>myElement {
background-image: url(image1.png), url(image2.png) url(image3.png);
background-opacity: 0.25, 0.5, 1;
}</pre>
<p>Using a comma separated array to target multiple images within a single rule is a convention already present within the CSS3 spec that can be used with the existing background properties. You can do a similar thing to this using <code>background-position</code> as is demonstrated <a href="http://www.storiesinflight.com/html5/backgrounds-transitions.html">here</a></p>
<h2>Why Would This Be Amazing?</h2>
<p>Because those opacity values could then be incremented/decremented over time using JavaScript or the CSS3 <code>transition</code> property. This would allow for a background image to fade in and out on mouse-over or hover event, and could work in varying amounts with multiple images applied to a single element. This in turn would enable some very neat visual effects and event-based transitions and animations.</p>
<p>Here is a link to the W3C Background and Borders Module Level 3 specification. Unfortunately, the last call on this was back in June 2010, but it may be worth contacting the editors to see what they think.</p>
<p><a href="http://www.w3.org/TR/css3-background/">http://www.w3.org/TR/css3-background/</a></p>
<p>If you like the sound of <code>background-opacity</code>, please feel free to put forward your views in the comments.</p>
<img src="http://feeds.feedburner.com/~r/mightymeta/~4/EXDdEL1VXRg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mightymeta.co.uk/1025/a-css-proposal-background-opacity/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://www.mightymeta.co.uk/1025/a-css-proposal-background-opacity/</feedburner:origLink></item>
		<item>
		<title>Test Your Website Across iOS Devices Using The iPhone Simulator</title>
		<link>http://feedproxy.google.com/~r/mightymeta/~3/BdKA1LEtOys/</link>
		<comments>http://www.mightymeta.co.uk/981/test-your-website-across-ios-devices-using-the-iphone-simulator/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 00:13:00 +0000</pubDate>
		<dc:creator>James Brocklehurst</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iPhone simulator]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://www.mightymeta.co.uk/?p=981</guid>
		<description><![CDATA[As the mobile device market expands and looks set to increase exponentially in 2011, it is no longer an option for web developers to test just for the desktop. Testing for Apple&#8217;s iOS devices is probably a good start, but &#8230; <a href="http://www.mightymeta.co.uk/981/test-your-website-across-ios-devices-using-the-iphone-simulator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As the mobile device market expands and <a href="http://letsgomo.com/mobile-web/exactly-how-fast-is-mobile-web-growing/">looks set to increase exponentially</a> in 2011, it is no longer an option for web developers to test just for the desktop. Testing for Apple&#8217;s iOS devices is probably a good start, but obtaining an iPhone, iPhone 4 and iPad just for this purpose is not practical for everyone.</p>
<p><span id="more-981"></span></p>
<p>If you develop websites on a Mac, however, there is a simple, reliable and free way of doing this without leaving OS X. In this post I&#8217;ll show you how.</p>
<h2>The iPhone Simulator</h2>
<p>Apple&#8217;s Developer Suite, which is used to create applications for OS X and iOS, comes with an excellent iOS simulator, which in turn runs a fully functioning version of Mobile Safari. With it you can test how your pages look and work using the iOS screen dimensions and orientation, rendering, and you can see whether your CSS @media queries are being called. The following instructions show how to get hold of it.</p>
<h2>Requirements</h2>
<p>You&#8217;ll need a Mac running Mac OS X 10.6 (Snow Leopard) or above. A fast and &#8216;Unlimited&#8217; internet connection is also recommended, since the download is pretty huge.</p>
<h2>Obtaining the Simulator</h2>
<h3>1. Register As An Apple Developer</h3>
<p>To download the iPhone simulator requires you to download the entire development suite. To do this you must first register with Apple as a developer. There are different registration options, with different pricing plans, but if you aren&#8217;t planning to develop your own actual apps to upload to the app store, you can choose the free option.</p>
<p>Click on the following link <a href="http://developer.apple.com/programs/register/" target="_blank">http://developer.apple.com/programs/register/</a> and click on the blue &#8216;get started&#8217; button:</p>
<p><img class="alignnone size-full wp-image-984 colorbox-981" title="Register as a Developer" src="http://www.mightymeta.co.uk/wp-content/uploads/register-as-developer.jpg" alt="Register as a Developer" width="600" height="298" /></p>
<p>Go through the registration process. If you already have an Apple ID, perhaps from using iTunes, then you can skip a few steps.</p>
<h3>Download the SDK</h3>
<p>Once registered, you will be taken through to the main Apple Developer website. Click on the link labelled &#8216;iOS Dev Center&#8217; to be taken through to the page show below. The URL for this page is <a href="http://developer.apple.com/devcenter/ios/">http://developer.apple.com/devcenter/ios/</a></p>
<p><img class="alignnone size-full wp-image-985 colorbox-981" title="iOS Dev Center" src="http://www.mightymeta.co.uk/wp-content/uploads/ios-dev-center.jpg" alt="iOS Dev Center" width="523" height="406" /></p>
<p>Click on the &#8216;download&#8217; link as indicated. You will then jump to the following section. Click on the &#8216;XCode and iOS SDK&#8217; link to download the disk image. It&#8217;s several Gigabytes so you&#8217;ll have a bit of a wait before the next step.</p>
<p><img class="alignnone size-full wp-image-987 colorbox-981" title="Download iOS SDK" src="http://www.mightymeta.co.uk/wp-content/uploads/download-ios-sdk.jpg" alt="Download iOS SDK" width="600" height="208" /></p>
<h3>Install the SDK and Locate The Simulator Application.</h3>
<p>Once the SDK is installed, you will find the simulator tucked away deep within a series of directories. The path to it is:</p>
<p>HD &gt; Developer &gt; Platforms &gt; iPhone Simulator Platform &gt; Developer &gt; Applications &gt;</p>
<p><img class="alignnone size-full wp-image-991 colorbox-981" title="Simulator Application Path" src="http://www.mightymeta.co.uk/wp-content/uploads/app-path.jpg" alt="Simulator Application Path" width="700" height="136" /></p>
<p>Once found, you can either make an alias to it or place it in your Dock for easy access.</p>
<h2>Using The Simulator</h2>
<p>Launching the simulator will give you by default an iPhone 3G running iOS 4.0. From here you can open Mobile Safari and start browsing the web:</p>
<p><img class="alignnone size-full wp-image-992 colorbox-981" title="iPhone Simulator" src="http://www.mightymeta.co.uk/wp-content/uploads/iPhone.jpg" alt="iPhone Simulator" width="401" height="743" /></p>
<p>What is really great is that you can also connect to a MAMP install and view <strong>webpages running on your local host.</strong></p>
<p>If you have any mobile specific stylesheets set up these will be called.</p>
<p>Pressing Command and the left and right arrow keys will rotate the orientation of the simulator by 90 degrees so you can see how the page looks both in portrait and landscape mode.</p>
<p>Clicking on the screen with the cursor simulates touch events and hold-dragging with the mouse does what you&#8217;d expect. Behaviour is pretty close to the real thing, the only thing that you can&#8217;t do is multi-touch actions, which of course means no page zooming.</p>
<p>Visiting the &#8216;Hardware&#8217; menu gives you further options. Here you can change the simulated device and iOS version. With the device submenu you can choose between the iPhone 3G, the iPhone 4 and the iPad:</p>
<p><img class="alignnone size-full wp-image-998 colorbox-981" title="Change Device" src="http://www.mightymeta.co.uk/wp-content/uploads/change-device.jpg" alt="Change Device" width="600" height="290" /></p>
<p><img class="alignnone size-full wp-image-994 colorbox-981" title="iPad Simulator" src="http://www.mightymeta.co.uk/wp-content/uploads/iPad-with-keypad.jpg" alt="iPad Simulator" width="594" height="490" /></p>
<p>The iOS versions let you roll back to 3.2 or forward to the most recent iteration of version 4.</p>
<h2>Conclusion</h2>
<p>Although Apple states that there are subtle differences between the simulator and the actual hardware (it is a &#8216;simulator&#8217; after all and not an &#8216;emulator&#8217;) this is the closest you are going to get to the real thing without leaving OS X.</p>
<p>The ability to view draft pages on a local host without needing to upload to a remote server tips it for me, as this is not possible with an actual handset and is really handy in the early stages of development.</p>
<p>If anyone knows of similar solutions for other mobile platforms, or a way of doing this in Windows, feel free to leave info in the comments.</p>
<img src="http://feeds.feedburner.com/~r/mightymeta/~4/BdKA1LEtOys" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mightymeta.co.uk/981/test-your-website-across-ios-devices-using-the-iphone-simulator/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.mightymeta.co.uk/981/test-your-website-across-ios-devices-using-the-iphone-simulator/</feedburner:origLink></item>
		<item>
		<title>Web Safe Fonts Cheat Sheet v.3 – With @font-face Fonts and OS Breakdown</title>
		<link>http://feedproxy.google.com/~r/mightymeta/~3/QB1oIuR6NTI/</link>
		<comments>http://www.mightymeta.co.uk/959/web-safe-fonts-cheat-sheet-v-3-with-font-face-fonts-and-os-breakdown/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 13:51:26 +0000</pubDate>
		<dc:creator>James Brocklehurst</dc:creator>
				<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[freebie]]></category>
		<category><![CDATA[Google Font API]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[printing]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://www.mightymeta.co.uk/?p=959</guid>
		<description><![CDATA[This is the third major overhaul of the Web Safe Fonts Cheat Sheet, which now includes examples of fonts suitable for the CSS @font-face property, along with revised CSS font stacks, font installation breakdowns by operating system, and some of &#8230; <a href="http://www.mightymeta.co.uk/959/web-safe-fonts-cheat-sheet-v-3-with-font-face-fonts-and-os-breakdown/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is the third major overhaul of the Web Safe Fonts Cheat Sheet, which now includes examples of fonts suitable for the CSS @font-face property, along with revised CSS font stacks, font installation breakdowns by operating system, and some of the new Google Font API fonts.</p>
<p><span id="more-959"></span><br />
<img class="alignnone size-full wp-image-960 colorbox-959" title="Web Safe Fonts Cheat Sheet v3" src="http://www.mightymeta.co.uk/wp-content/uploads/web-safe-fonts-cheat-sheet-v3-preview.jpg" alt="Web Safe Fonts Cheat Sheet v3" width="595" height="842" /></p>
<h2>Download Links</h2>
<p><a class="download" href="http://www.mightymeta.co.uk/resources/web-safe-fonts-cheat-sheet-v3.zip">Download (A3 CMYK PDF, zipped, 6.8 MB)</a></p>
<p><a class="download" href="http://www.mightymeta.co.uk/resources/web-safe-fonts-cheat-sheet-v3.png">Download (A4 RGB PNG, 1.1 MB)</a></p>
<h2>Printing</h2>
<p>It comes in A3 and A4 sizes and should print without difficultly on most domestic or office printers without cropping or readability issues. It can be printed in greyscale or colour.</p>
<p>If you want to accurately preview the quality of fonts when aliased it is recommended that you go for the A3 version using some good photo-quality paper.</p>
<h2>Statistics</h2>
<p>As explained in previous articles, the overall installation percentages are calculated by combining results from the <a href="http://www.codestyle.org/css/font-family/sampler-CombinedResults.shtml">CodeStyle Font Survey</a> and worldwide operating system statistics. On this last point, there are a few competing sets of figures out there and in the past I have used those provided by <a href="http://marketshare.hitslink.com/operating-system-market-share.aspx?qprid=8">NetMarketShare</a> After looking into how the statistics are gathered I have to say I have now &#8216;seen the light&#8217; and have moved over to <a href="http://gs.statcounter.com">StatCounter</a> primarily because it draws from a significantly larger sample than its competitors.</p>
<p><!-- table {  }.font5 { color: windowtext; font-size: 8pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Verdana; }td { padding: 0px; color: windowtext; font-size: 10pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Verdana; vertical-align: bottom; border: medium none; white-space: nowrap; }.xl24 { text-align: left; }.xl25 { font-size: 14pt; font-weight: 700; text-align: left; }.xl26 { font-size: 14pt; text-align: left; }.xl27 { font-size: 14pt; text-align: left; }.xl28 { color: rgb(221, 8, 6); font-size: 14pt; text-align: left; }.xl29 { color: rgb(221, 8, 6); font-size: 14pt; text-align: left; background: none repeat scroll 0% 0% rgb(255, 255, 153); }.xl30 { color: rgb(221, 8, 6); text-align: left; }.xl31 { color: rgb(31, 183, 20); font-size: 14pt; text-align: left; }ruby {  }rt { color: windowtext; font-size: 8pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Verdana; display: none; } --></p>
<table border="0" cellspacing="0" cellpadding="0" width="555">
<colgroup>
<col width="155"></col>
<col width="67"></col>
<col width="66"></col>
<col width="62"></col>
<col width="65"></col>
<col width="140"></col>
</colgroup>
<tbody>
<tr height="18">
<td width="155" height="18"><strong>Font</strong></td>
<td width="67"><strong>Windows</strong></td>
<td width="66"><strong>OS X</strong></td>
<td width="62"><strong>Linux</strong></td>
<td width="65"><strong>iOS</strong></td>
<td width="140"><strong>Total</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Courier</strong></td>
<td>99.71</td>
<td>99.24</td>
<td>67.62</td>
<td>100</td>
<td><strong>98.7</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Times<br />
</strong></td>
<td>99.71</td>
<td>98.48</td>
<td>67.91</td>
<td>100</td>
<td><strong>98.6</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Arial</strong></td>
<td>99.71</td>
<td>97.73</td>
<td>69.05</td>
<td>100</td>
<td><strong>98.6</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Verdana</strong></td>
<td>99.71</td>
<td>97.98</td>
<td>67.05</td>
<td>100</td>
<td><strong>98.6</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Trebuchet</strong></td>
<td>99.32</td>
<td>94.95</td>
<td>65.33</td>
<td>100</td>
<td><strong>98.0</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Georgia</strong></td>
<td>99.03</td>
<td>95.71</td>
<td>66.19</td>
<td>100</td>
<td><strong>97.8</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Lucida</strong></td>
<td>98.83</td>
<td>100</td>
<td>68.25</td>
<td>0</td>
<td><strong>97.7</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Impact</strong></td>
<td>99.03</td>
<td>91.92</td>
<td>64.18</td>
<td>0</td>
<td><strong>97.3</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Tahoma</strong></td>
<td>99.9</td>
<td>84.6</td>
<td>0</td>
<td>0</td>
<td><strong>97.2</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Palatino</strong></td>
<td>98.83</td>
<td>81.06</td>
<td>96.28</td>
<td>75</td>
<td><strong>96.9</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Arial Black</strong></td>
<td>98.25</td>
<td>94.44</td>
<td>65.62</td>
<td>0</td>
<td><strong>96.8</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Arial Narrow</strong></td>
<td>88.74</td>
<td>90.4</td>
<td>0.95</td>
<td>0</td>
<td><strong>87.3</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Century Gothic<br />
</strong></td>
<td>87.88</td>
<td>39.39</td>
<td>97.99</td>
<td>0</td>
<td><strong>84.1</strong></td>
</tr>
<tr height="18">
<td height="18"><strong>Garamond</strong></td>
<td>86.65</td>
<td>31.82</td>
<td>7.11</td>
<td>0</td>
<td><strong>81.7</strong></td>
</tr>
</tbody>
</table>
<p>You&#8217;ll notice that Garamond almost made it in at just under 82%. I think it&#8217;s kind of cool that a typeface designed nearly 500 years ago in the early days of the moveable type printing press can still work perfectly well on the web.</p>
<h3>Operating System Stats</h3>
<p>I have now included a separate breakdown for Operating Systems:</p>
<p><img class="alignnone size-full wp-image-962 colorbox-959" title="OS Breakdown" src="http://www.mightymeta.co.uk/wp-content/uploads/OS-breakdown.jpg" alt="OS Breakdown" width="423" height="46" /></p>
<p>The Windows, OS X and Linux percentages come from CodeStyle, the iOS details come from <a href="http://forgecode.net/2010/08/built-in-system-fonts-on-ios-4-0-1-3-2-1-and-3-1-3/">this useful summary</a> by Nick Forge.</p>
<h3>What About The Other Mobile Platforms?</h3>
<p>If you are wondering why no other mobile platform is included, even though Symbian, Blackberry and Android have similar or better worldwide market share compared to iOS, this is because there are no standard font installs on any of these platforms. Each handset manufacturer puts whatever fonts they see fit on a device, making it impossible to generate any meaningful statistics. The iPhone, iPad and iPod Touch on the other hand are limited to a fixed range and Apple doesn&#8217;t even let end users install additional fonts! There is some deviation across iOS devices, as can be seen <a href="http://www.iosfonts.com/">here</a>, but I have only included fonts common to all.</p>
<p>You may also notice that the OS percentages don&#8217;t add up to 100% The missing 1% consists of the &#8216;other&#8217; OS&#8217;s, including the remaining mobile platforms.</p>
<h2>Revised Font Stacks</h2>
<p>Not much to say here, other than I have tidied them up a bit based on various people&#8217;s suggestions, something I have been meaning to do for a while.</p>
<p>I also discovered some common Linux fonts that simulate the look of Palatino and Century Gothic, so have included those in the stacks.</p>
<h2>@font-face Fonts</h2>
<p>There is now a box containing a sample of what I subjectively consider to be well designed fonts that can be used commercially with the CSS @font-face property without any licencing worries. All of these, with the exception of GrauBlau Web (which can be downloaded from <a href="http://www.fonts.info/info/press/free-fonts-for-font-face-embedding.htm">here</a>) are available from the <a href="http://www.fontsquirrel.com/">Font Squirrel website</a>, along with a &#8216;bulletproof&#8217; generator that creates all the necessary CSS code and provides you with the formats required for each browser. Each font has it&#8217;s own licence so remember to read through and abide by the terms before use :)</p>
<p>A quick look on the Font Squirrel website reveals that they have catalogued over 600 fonts, and there are many more out there, yet I have only included twenty. As I said, these are my favourites, and I have loosely tested them on different browsers and platforms, at different scales, with and without anti-aliasing, with generally good results.</p>
<h2>Google Font API / Font Directory Fonts</h2>
<p>This has been available since April 2010 and has had a chance to &#8216;bed down&#8217;, but is still disappointing, in my opinion. I have only included the fonts that, after testing, seem in any way useable.</p>
<p>For those unfamiliar with how it works, the API is essentially @font-face but with Google hosting the fonts rather than you having them on your own server. This is beneficial since it saves you a bit of bandwidth, plus if the end user has been to another website that used the same font, their browser will have it already cached. Google also provide some fancy JavaScript that is supposed to help with <a href="http://paulirish.com/2009/fighting-the-font-face-fout/">FOUT</a>.</p>
<p>In principle it is a great idea, but the choice of fonts is lousy. My main contention is that most probably look fine when printed, but do not appear to have been designed for the screen at all. They can look awful at the smaller sizes and often become messy or illegible when aliased. Here&#8217;s a reminder of the issue from Google&#8217;s own preview as viewed in Windows XP (52% worldwide marketshare!) with the default &#8216;no ClearType&#8217; setup:</p>
<p><img class="alignnone size-full wp-image-422 colorbox-959" title="Tangerine Aliased" src="http://www.mightymeta.co.uk/wp-content/uploads/tangerine-aliased.png" alt="Tangerine Aliased" width="451" height="301" /></p>
<p>If anyone wants to lobby Google to get their act together please feel free.</p>
<h2>Licence</h2>
<p><a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Non-Commercial-Share Alike 3.0 unported Licence</a></p>
<h2>Conclusion</h2>
<p>I hope people find this useful and as ever any suggested improvements are welcome in the comments below.</p>
<p>I am planning one day to make a web app version, which will give more space for a better range of previews (different browsers, OS&#8217;s, font variants, etc), when I find the time. Perhaps if I clone myself first&#8230;</p>
<img src="http://feeds.feedburner.com/~r/mightymeta/~4/QB1oIuR6NTI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.mightymeta.co.uk/959/web-safe-fonts-cheat-sheet-v-3-with-font-face-fonts-and-os-breakdown/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.mightymeta.co.uk/959/web-safe-fonts-cheat-sheet-v-3-with-font-face-fonts-and-os-breakdown/</feedburner:origLink></item>
	</channel>
</rss>

