<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Luscarpa Blog &#187; Development</title>
	<atom:link href="http://www.luscarpa.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.luscarpa.com</link>
	<description>Php, Zend Framework, Symfony, jQuery, Mootools, Joomla, Wordpress</description>
	<lastBuildDate>Thu, 02 Feb 2012 07:43:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Make your website an iPhone web application</title>
		<link>http://www.luscarpa.com/development/make-your-website-an-iphone-web-application/</link>
		<comments>http://www.luscarpa.com/development/make-your-website-an-iphone-web-application/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 07:26:25 +0000</pubDate>
		<dc:creator>Luscarpa</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Web Application]]></category>

		<guid isPermaLink="false">http://www.luscarpa.com/?p=232</guid>
		<description><![CDATA[These are a lot of tips to make your website an iPhone app so users can save it on their Home screens and access to your site faster.]]></description>
			<content:encoded><![CDATA[<p>These are a lot of tips to make your website an iPhone app so users can save it on their Home screens and access to your site faster.</p>
<h3 class="space">Specifying a Webpage Icon for iPhone Home</h3>
<p>We have two ways to design a custom icon that users can display on their Home screens using the Web Clip feature:</p>
<ul class="bullet-1">
<li>a simple image where iPhone 1.1.3 and later automatically adds some visual effects so that it coordinates with the built-in icons. Specifically, iPhone 1.1.3 adds:
<ul class="bullet-2">
<li>rounded corners</li>
<li>drop shadow</li>
<li>reflective shine</li>
</ul>
<p>This is the image for Luscarpa.com:<br />
<img style="margin: 5px 0;" src="http://www.luscarpa.com/wp-content/themes/luscarpa_v1.0/images/apple-touch-icon.png" alt="iPhone Icon" /><br />
and this is how it is on iphone home screen:<br />
<img class="size-full wp-image-285" title="iphone_home_screen_luscarpa" src="http://www.luscarpa.com/wp-content/uploads/2010/02/iphone_home_screen_luscarpa.png" alt="Luscarpa icon on iphone home screen" width="320" height="103" /></li>
<li>an image precomposed, to this image iPhone doesn&#8217;t add effects.<br />
This is the image precomposed  for Luscarpa.com:<br />
<img style="margin: 10px 0 5px;" src="http://www.luscarpa.com/apple-touch-icon-precomposed.png" alt="iPhone Icon" /><br />
and this is how it is on iphone home screen:<br />
<img class="size-full wp-image-287" title="iphone_home_screen_luscarpa_precomposed" src="http://www.luscarpa.com/wp-content/uploads/2010/02/iphone_home_screen_luscarpa_precomposed.png" alt="Luscarpa image precomposed on iphone home screen" width="320" height="101" /></li>
</ul>
<p>How we can provide this image? There are two ways:</p>
<ul class="bullet-1">
<li>place an icon file in PNG format in the root document folder called <code>apple-touch-icon.png</code> or <code>apple-touch-icon-precomposed.png</code>. With this method you specify an icon for the entire website (every page on the website),</li>
<li>add a link element to the webpage, as in:
<pre class="html">&lt;link rel="apple-touch-icon" href="/custom_icon.png"/&gt;</pre>
<p>or</p>
<pre class="html">&lt;link rel="apple-touch-icon-precomposed" href="/custom_icon_precomposed.png"/&gt;</pre>
<p>With this code you specify an icon for a single webpage or replace the website icon with a webpage-specific icon.</li>
</ul>
<h3 class="space">Hide Safari Components</h3>
<p>Add this line if you want that your web app/website don&#8217;t show the safari user interface components:</p>
<pre class="html">&lt;meta name="apple-mobile-web-app-capable" content="yes" /&gt;</pre>
<h3 class="space">Status Bar Appearance</h3>
<p>You can change the Status Bar of web app/website using the following line of code:</p>
<pre class="html">&lt;meta name="apple-mobile-web-app-status-bar-style" content="black" /&gt;</pre>
<p>There are three different colors:</p>
<p><span class="number">1</span>default</p>
<p><span class="number">2</span>black</p>
<p><span class="number">3</span>black-translucent</p>
<p><em>NOTE: If set to default or black, the web content is displayed below the status bar. If set to black-translucent, the web content is displayed on the entire screen, partially obscured by the status bar.</em></p>
<h3 class="space">Specifying a Startup Image</h3>
<p>On iPhone OS, similar to native applications, you can specify a startup image that is displayed while your web application/website launches. By default, this image is a screenshot of the web application with the page that the user has visited the last time. If you want customize it, add a link element to the webpage, like this:</p>
<pre class="html">&lt;link rel="apple-touch-startup-image" href="/startup.png"&gt;</pre>
<p>Here an example of my custom startup:<br />
<img style="margin: 10px 0;" src="http://www.luscarpa.com/startup.png" alt="Luscarpa.com Startup Image" /><br />
The image must be a png file and his dimensions 320 x 460 pixels in portrait orientation.<br />
<em>NOTE: this option works only if <code>apple-mobile-web-app-capable</code> is set to yes</em></p>
<h3 class="space">Standalone Detection</h3>
<p>You can develope custom features or effects for your standalone version of site, you can detect it using the boolean var <code>window.navigator.standalone</code> from javascript.</p>
<h3 class="space">Note &amp; Conclusion</h3>
<p>All these tips only works for web pages that have been saved to the home screens and opened from there, if you access to your website using safari you don&#8217;t have this customizations. Remember also that any new link will be open in new browser tab so you lost these settings.</p>
<p>Is my opinion that if you develop a strongly ajax-oriented web application, so to avoid the users from stressing clicking and page refresh, allowing them to use just the &#8220;first page&#8221; , all these settings can be make your app amazing.</p>
<p>This website uses these options, you can test them adding it to your home screen of iPhone/iPod Touch, actually I&#8217;m using wordpress so there isn&#8217;t a customization to load all site with ajax so you can see the home page like web application, but if you click on a post link you will be redirect to safari.</p>
<h3>Resources</h3>
<ul class="bullet-3">
<li><a style="font-weight: 400;" title="Safari Dev Center - Safari Web Content Guide" href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/Introduction/Introduction.html#//apple_ref/doc/uid/TP40002079-SW1" target="_blank">Safari Dev Center &#8211; Safari Web Content Guide</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.luscarpa.com/development/make-your-website-an-iphone-web-application/feed/</wfw:commentRss>
		<slash:comments>96</slash:comments>
		</item>
		<item>
		<title>PillMenu &#8211; Simple Pill Mootools Menu</title>
		<link>http://www.luscarpa.com/development/pillmenu-simple-pill-mootools-menu/</link>
		<comments>http://www.luscarpa.com/development/pillmenu-simple-pill-mootools-menu/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 20:58:50 +0000</pubDate>
		<dc:creator>Luscarpa</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://www.luscarpa.com/?p=192</guid>
		<description><![CDATA[PillMenu is a simple Mootools class that helps you to add a nice effect to your menu.]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-204" title="mootools" src="http://www.luscarpa.com/wp-content/uploads/2010/02/mootools.png" alt="Motools Logo" width="184" height="46" />PillMenu is a simple Mootools class that helps you to add a nice effect to your menu.</p>
<div class="post_toolbar"><a class="demo" title="Go to demo page" href="http://www.luscarpa.com/demo/pill-menu.php">Demo</a><a class="download" title="Go to download page" href="http://github.com/luscarpa/PillMenu" target="_blank">Download</a></div>
<h3>THE HTML</h3>
<p>How you can see, this is a typical list with a div container used to apply the script and render the style. I added pillMenu class to give it a default style, but you can replace it with another class like nav or nav-wrap of wordpress.</p>
<p><em>Selected</em> is the name of the class for the selected menu, this class name can be changed in the options of Mootools class. Change in &#8220;current_page_item&#8221; if you want to use the script with the list of  pages in wp.</p>
<pre class="html">&lt;div id="menu1" class="pillMenu"&gt;
	&lt;ul&gt;
		&lt;li class="selected"&gt;&lt;a href="#" title="Go to Home Page"&gt;Home&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="#" title="Go to About Page"&gt;About&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="#" title="Go to Archive Page"&gt;Archive&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="#" title="Go to Sitemap Page"&gt;Sitemap&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="#" title="Go to Contact Page"&gt;Contact&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="#" title="Go to Long Text Menu Page"&gt;Long Text Menu&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;div class="clearfix"&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
<h3 class="space">THE CSS</h3>
<p>These are the style rows of code that you have to add in your css file if you want an horizontal movement, I added also clearfix style, but if you have your own you can remove it.</p>
<p>The class <em>.pill</em> is the class of pill that you can customize, actually it is only a transparent block with 1px border, but, if you want, you can replace it with a background or a single line.</p>
<p><em>If you decide to change the name of the selected class, remember to change it also in the css. </em></p>
<pre class="css">.pillMenu{ position: relative; }
.pillMenu ul{ margin: 0; padding: 0; position: relative; }
.pillMenu ul li{ float: left; list-style: none; margin: 0 5px; position: relative; z-index: 10; }
.pillMenu ul li a{ color: #000; display: block; padding: 5px 10px; text-decoration: none; }
.pillMenu ul li.selected{ background-color: #000; border: 1px solid #000; }
.pillMenu ul li.selected a{ color: #fff; }
.pillMenu .pill{ border: 1px solid #666; }
.pillMenu .clearfix{ clear:both; display:block; height:0; font-size:0; line-height:0 }</pre>
<p>This is the version of css for a vertical movement.</p>
<pre class="css">.pillMenu_vertical{ position: relative; width: 75px; }
.pillMenu_vertical ul{ margin: 0; padding: 0; position: relative; }
.pillMenu_vertical ul li{ list-style: none; margin: 5px; position: relative; z-index: 10; }
.pillMenu_vertical ul li a{ color: #000; display: block; padding: 5px 10px; text-decoration: none; }
.pillMenu_vertical ul li.selected{ background-color: #000; border: 1px solid #000; }
.pillMenu_vertical ul li.selected a{ color: #fff; }
.pillMenu_vertical .pill{ border: 1px solid #666; }</pre>
<h3 class="space">The MooTools Class</h3>
<pre class="js">var PillMenu = new Class({

	//implements
	Implements: [Options,Events],

	//options
	options: {
		vertical: 0,
		pillClass: 'pill',
		selectedClass: 'selected',
		duration: 'short',
		transition: Fx.Transitions.Linear
	},

	//initialization
	initialize: function(element,options) {
		//set options
		this.setOptions(options);
		//set element
		this.element = document.id(element);
		//set pill element
		this.pill = this.element.getElement('.pill');

		if(!this.pill){
		    //build pill element
		    this.pill = new Element('div',{
		    	'class': this.options.pillClass,
		    	'style': 'position:absolute; z-index:1;'
		    });
		    //inject pill into element
		    this.pill.inject(this.element,'top');
		}
		//make effect
		this.pillFx = new Fx.Morph(this.pill, {'duration': this.options.duration, 'link': 'cancel', 'transition': this.options.transition});

		this.start();
	},

	start: function() {
		//fire event start
		this.fireEvent('start');

        this.element.getElements('li').each(function(el,i){
			//detect selected menu
			if(el.hasClass(this.options.selectedClass)){
				//save selected menu
				this.selected = el;
				//set pill dimensions
				this.pill.setStyles({
				    width: el.getStyle('width'),
				    height: el.getStyle('height'),
				    left: el.getPosition().x - this.element.getPosition().x,
				    top: el.getPosition().y - this.element.getPosition().y
				});

			}						

			//add event to element
			el.addEvent('mouseenter', function(){
				//fire event start
				this.fireEvent('change');
				//set effect for horizontal and vertical style
				if(!this.options.vertical){
					this.pillFx.start({
					    'left': [this.pill.getStyle('left'), el.getPosition().x - this.element.getPosition().x],
					    'width': [this.pill.getStyle('width'), el.getStyle('width')]
					});
				} else {
					this.pillFx.start({
					    'top': [this.pill.getStyle('top'), el.getPosition().y - this.element.getPosition().y],
					    'height': [this.pill.getStyle('height'), el.getStyle('height')]
					});
				}

			}.bind(this));

		}.bind(this));

        //add event to reset all
        this.element.addEvent('mouseleave', function(){
        	//set effect for horizontal and vertical style
        	if(!this.options.vertical){
        		this.pillFx.start({
				    'left': [this.pill.getStyle('left'), this.selected.getPosition().x - this.element.getPosition().x],
				    'width': [this.pill.getStyle('width'), this.selected.getStyle('width')]
				});
			} else {
				this.pillFx.start({
				    'top': [this.pill.getStyle('top'), this.selected.getPosition().y - this.element.getPosition().y],
				    'height': [this.pill.getStyle('height'), this.selected.getStyle('height')]
				});
			}			

		}.bind(this));

	}

});</pre>
<p>The following are arguments, options, and events for PillMenu:</p>
<h4>Arguments</h4>
<ul class="bullet-1">
<li><strong>element:</strong> The element to apply the script</li>
<li><strong>option:</strong> The class options</li>
</ul>
<h4>Options</h4>
<ul class="bullet-1">
<li><strong>vertical:</strong> [0/1] makes the movement horizontal or vertical</li>
<li><strong>pillClass:</strong> [pill] name of class to give to pill element</li>
<li><strong>selectedClass:</strong> [selected] name of class of selected menu item</li>
<li><strong>duration:</strong> [short] time of duration of transition</li>
<li><strong>transition:</strong> [Fx.Transitions.Linear] transition to apply</li>
</ul>
<h4>Events</h4>
<ul class="bullet-1">
<li><strong>start:</strong> Fire when the script is started</li>
<li><strong>change:</strong> Fire when the mouse go over the menu item</li>
</ul>
<h3 class="space">Usage</h3>
<p>These are a lot of examples that you can add to your domready to use the script.</p>
<pre class="js">window.addEvent('domready',function() {
	//example for default menu
	var myMenu1 = new PillMenu('menu1');

	//example for vertical menu
	var myMenu1 = new PillMenu('menu1', {vertical: 1});

	//example for elastic menu
	var myMenu1 = new PillMenu('menu1', {
		duration: 'long',
		transition: Fx.Transitions.Elastic.easeOut
	});

	//example for event actions
	var myMenu4 = new PillMenu('menu4', {
  		onStart: function() {
			alert('Start');
		},
  		onChange: function() {
			alert('Change');
		}
	})
});</pre>
<p><strong>This script is released under the MIT and GPL licenses,</strong> feel free to edit and use it everywhere.</p>
<div class="post_toolbar"><a class="demo" title="Go to demo page" href="http://www.luscarpa.com/demo/pill-menu.php">Demo</a><a class="download" title="Go to download page" href="http://github.com/luscarpa/PillMenu" target="_blank">Download</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.luscarpa.com/development/pillmenu-simple-pill-mootools-menu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

