<?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>Web Designer - Defining the internet through beautiful design &#187; Tutorials</title>
	<atom:link href="http://www.webdesignermag.co.uk/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdesignermag.co.uk</link>
	<description>Web Design for real people</description>
	<lastBuildDate>Wed, 22 May 2013 08:30:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Build a custom WordPress competitions plug-in</title>
		<link>http://www.webdesignermag.co.uk/tutorials/build-a-custom-wordpress-competitions-plug-in/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/build-a-custom-wordpress-competitions-plug-in/#comments</comments>
		<pubDate>Tue, 21 May 2013 15:45:47 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=15619</guid>
		<description><![CDATA[Learn how to build your own custom WordPress plugin to manage and run a competition on your site]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2013/05/screenshot1.jpg"><img src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/05/screenshot1.jpg" alt="Build a custom WordPress competitions plug-in" width="608" height="488" class="alignnone size-full wp-image-15637" /></a></p>
<p><strong>Everybody loves entering competitions, especially when they win! In reality the winning part rarely happens, but most people can remember a time when they have been lucky. It’s for this reason that many people still enter competitions over and over again to seek out that rush of potentially winning something. This is good news for people who run websites, as competitions can serve as a handy tool to gather key information about your visitors which you can use to your advantage. It enables you to capture data about your audience.</strong> </p>
<p>Have you ever wondered what the actual demographic of your site was? Then run a competition that requires them to fill out a form with specific information about themselves. Within a few days you will have some accurate, reliable data about your audience. Perhaps you want to increase the number of people that receive your newsletter? Capturing email addresses via a competition is a simple solution. Follow these steps to build a fully functioning competitions module for your WordPress site.</p>
<p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2013/02/5_WordPress_plugin.zip"><strong>DOWNLOAD TUTORIAL FILES</strong></a></p>
<h3>Let’s start coding</h3>
<p>When building any plug-in for WordPress it is important to define constants which you may want to refer to in the future. Here, we will define various things such as database table names and the plug-in title used for the admin sidebar.</p>
<p>001 global $wpdb;<br />
002 define(‘COMPETITIONS_TITLE’,        ‘Competitions Plugin’);<br />
003 define(‘COMPETITIONS_SLUG’,        ‘competitions_plugin’);<br />
004 define(‘COMPETITIONS_TABLE’,        $wpdb->prefix . 		‘competitions’);<br />
005 define(‘COMPETITION_ENTRIES_TABLE’, $wpdb->prefix . 		‘competition_entries’);<br />
006 define(‘COMPETITIONS_DOCROOT’,    dirname(__FILE__));<br />
007 define(‘COMPETITIONS_WEBROOT’,    str_replace(getcwd(), home_<br />
00 8url(), dirname(__FILE__)));</p>
<h3>Hooks and includes</h3>
<p>Every WordPress plug-in should use ‘hooks’ that install and uninstall the plug-in. We define those here as well as including the install, model and controller scripts that are the meat and bones of the plug-in. Using the ‘add_action’ method we can add an admin link in the sidebar that will link to our plug-in admin page. Code can be found on the resource disc.</p>
<h3>Create some database tables</h3>
<p>You will require two separate tables for this plug-in to work. One that stores data about the competitions you are running, such as the questions and answers, and another table which will be used to record the actual entry data of the users that have entered. </p>
<p>001function competitions_install () {				    global $wpdb;<br />
002    require_once ABSPATH . ‘wp-admin/includes/upgrade.php’;<br />
003    dbDelta(‘<br />
004        CREATE TABLE `’ . COMPETITIONS_TABLE . ‘` (<br />
005          `id` int(10) unsigned NOT NULL AUTO_INCREMENT,<br />
006          `competition_name` longtext CHARACTER SET utf8 	COLLATE utf8_bin NOT NULL,<br />
007          `question_1` longtext CHARACTER SET utf8 COLLATE 	utf8_bin NOT NULL,<br />
008          `answer_1_option_1` longtext CHARACTER SET utf8 	COLLATE utf8_bin NOT NULL,<br />
009          `answer_1_option_2` longtext CHARACTER SET utf8 	COLLATE utf8_bin NOT NULL,<br />
010          `answer_1_option_3` longtext CHARACTER SET utf8 	COLLATE utf8_bin NOT NULL,<br />
011          `correct_answer_1` longtext CHARACTER SET utf8 	COLLATE utf8_bin NOT NULL,     		<br />
012          `closing_date` DATETIME DEFAULT NULL,<br />
013          PRIMARY KEY (`id`),<br />
014          UNIQUE KEY `id` (`id`)<br />
015        ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;<br />
    ‘);<br />
}</p>
<h3>Allow for easy uninstallation</h3>
<p>Sometimes we may want to remove a plug-in, so it’s a good idea to provide some functionality that will allow you to do this with ease. Not only do we want to remove unwanted code, but we probably do not want unused database tables lying around. We can remove the database tables that were created during the installation process by simply using a ‘DROP TABLE’ SQL statement. The code for this step is on the resource disc.</p>
<h3>Backend form</h3>
<p>We need a way of entering competition details. To do this we first require a form with some typical information that you would normally associate with a competition. This plug-in enables you to set three multiple choice answers for a given question. You can also set a closing date and allow it to run over a specific time period. </p>
<h3>Using the generated shortcode</h3>
<p>When you’ve entered all the info needed to configure a competition, the info you provided is then saved to the competition’s table. A short-code is then generated which when inserted into a post will display the competition.</p>
<h3>Editing a competition</h3>
<p>You can quite easily make changes to an existing competition that<br />
you have, should you wish to make any slight alterations to the information that you have already saved earlier in the tutorial. Under the Edit/Delete competition section simply click on the Edit button. This will now pre-fill the form with the saved data you have already entered. This is all controlled from the competitions_main function which can be found within the controller.php script.</p>
<p>001// Update data<br />
002if (isset($_POST[‘competitions_update_data’])) {<br />
003	$id = $_GET[‘id’];<br />
004	competitions_table::update($id,$_POST);		<br />
005	$location = strtok($_SERVER[“REQUEST_URI”], ‘&#038;’);<br />
006	wp_redirect( $location );<br />
}</p>
<h3>The competitions_main function</h3>
<p>The competitions_main function is the backbone of the plug-in, and is found within the controller.php script. We use this function primarily for adding/editing and deleting competition data. All of its functionality can be rendered via one template named main.php. The methods it employs can be found within the model.php script and are all declared as public static functions, which means that they can be called from outside the scope of the script in which it resides.</p>
<p>001//Inserts competition data when form is submitted<br />
002public static function insert ($row) {<br />
003	global $wpdb;<br />
004      return $wpdb->insert(COMPETITIONS_TABLE, array(	<br />
005            ‘competition_name’=> stripslashes_		deep($row[‘competition_name’]), <br />
007            ‘question_1’=> stripslashes_<br />
008deep($row[‘question_1’]),<br />
009        	‘answer_1_option_1’=> stripslashes_		deep($row[‘answer_1_option_1’]),<br />
010       	‘answer_1_option_2’=> stripslashes_deep($row[‘answer_1_option_2’]),<br />
011        	‘answer_1_option_3’=> stripslashes_		deep($row[‘answer_1_option_3’]),<br />
012        	‘correct_answer_1’=> stripslashes_deep($row[‘correct_013answer_1’]),<br />
014        	‘closing_date’=> stripslashes_deep($row[‘closing_	date’])        	      	        		<br />
             ));<br />
    }</p>
<h3>Downloading entry data</h3>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p>Another piece of administration functionality which needs to be added is the ability to download and view the details of the people that have entered the competition. We can do this by querying both of our database tables. The only information we need is the personal details of every user and the answer they gave for the question that was asked. It’s also a good idea to include the correct answer of question so you can easily pick a winner.</p>
<h3>Create the CSV file</h3>
<p>To view the entry information simply click the ‘download entries’ button on the competition you wish to view. This can be found in the Edit/Delete section under the form. Once clicked it will initiate the competitions_main function and grab all the data using the SQL query shown in the previous step. We then create a new CSV file and write to it using a built in PHP function called fputcsv.</p>
<p>001if (!empty($compEntries))<br />
{<br />
002	$fileName = strtolower($compEntries[0][‘competition_name’]);     003	$fileName = str_replace(“ “, “_”, $fileName);<br />
004   	$fp = fopen(‘../competition_entries/’.$fileName.’.csv’, 	‘w’);<br />
005   	$coloumTitles[‘0’][‘competition_name’] = ‘Competition 	Name’;   <br />
006    	$coloumTitles[‘0’][‘correct_answer_1’] = ‘Correct 	Answer’;<br />
007    	$coloumTitles[‘0’][‘answer’] = ‘Answer’;   	 <br />
008	$coloumTitles[‘0’][‘forename’] = ‘Forename’;<br />
009	$coloumTitles[‘0’][‘surname’] = ‘Surname’;<br />
010	$coloumTitles[‘0’][‘email’] = ‘Email’;<br />
011	$compEntries = array_merge($coloumTitles,$compEntries);<br />
012    	foreach ($compEntries as $fields) 			    	{<br />
013		fputcsv($fp, $fields);					}<br />
014	fclose($fp);	    	<br />
015	header(‘location:http://’.$_SERVER[‘SERVER_NAME’].’/		competition_entries/’.$fileName.’.csv’);<br />
}</p>
<h3>Displaying the amount of entries</h3>
<p>Another handy feature of this plug-in is the ability to view the amount of people that have entered the competition without the need to download the CSV file. This information can be found at the top left of the competition box. We can display this information to the user by querying the number of rows in the competition_entries table. </p>
<h3>Active/inactive competitions</h3>
<p>Some people may want to run multiple competitions on their website. Therefore it is important to keep track of your competitions and know which ones are currently running and which ones have expired. To make this obvious to the user, change the expired competition boxes to red and the active ones to green.</p>
<p>001$time = strtotime($data[‘closing_date’]);<br />
002//Chance css class if comp has expired<br />
003if ($time >= time())<br />
{<br />
004	$compBoxClass = ‘competitionBox’;<br />
005	$statusText = ‘Active’;					}<br />
006 else<br />
{<br />
007	$compBoxClass = ‘inactiveBox’;<br />
008	$statusText = ‘Expired’;<br />
}</p>
<h3>The front-end</h3>
<p>Let’s move on to the frontend now. The function responsible for actually displaying the competition to the user is called insert_competition<br />
and is found within the controller.php script. First of all we extract the competition ID from the shortcode and grab the competition information from the database.</p>
<h3>Loop through our data</h3>
<p>Once we have executed our SQL we can put the resultset into an array and loop through each element. It’s a good idea to check if we actually have any competition data returned from our SQL query, because if we don’t it’s likely that the competition has expired as one of the conditions in the SQL was that the closing date had to be in the future. Wrap your loop in an IF statement and only loop through the array if it is not empty.</p>
<p>001if (!empty($competitionSQL))<br />
{<br />
002	foreach ($competitionSQL as $competitionData)<br />
	{<br />
003		$id = $competitionData->id;<br />
004		$competition_name = $competitionData->competition_name;<br />
005		$question_1 = $competitionData->question_1;<br />
006		$answer_1_option_1 = $competitionData->answer_1_option_1;<br />
007		$answer_1_option_2 = $competitionData->answer_1_option_2;<br />
008		$answer_1_option_3 = $competitionData->answer_1_option_3;<br />
009		$correct_answer_1 = $competitionData->correct_answer_1;<br />
010		$closing_date = $competitionData->closing_date;<br />
	}<br />
}</p>
<h3>Displaying the competition</h3>
<p>Now we have fetched our competition from the database and looped through each element we can now display this information to the user. To do this we need to write some HTML that uses the PHP variables populated with the information we fetched from the database. We also require a CSS file to give the output some style, not forgetting some JavaScript to validate the data the user enters.</p>
<h3>Validating user input</h3>
<p>Sometimes website users can be pretty stupid. It is always worth putting in some sort of validation to prevent them from missing out vital fields and mistyping email addresses. In this example we use some JavaScript to make sure all fields are filled out correctly. The JavaScript is triggered when it detects that the ‘Enter Now’ button is clicked.</p>
<p>001if (comp_firstname == “First Name”) <br />
{	  <br />
002	$(“label#comp_firstname_comp_error”).show();  <br />
003	$(“.errorSpacer”).show();  <br />
004      $(“input#comp_firstname”).focus();  <br />
005     return false;  <br />
}   </p>
<h3>Validating email addresses</h3>
<p>To double check the user has provided an email address is the easy part – we can do that by checking to see that the email input is empty. Next we have to see if the data provided is actually an address. We can do this by using regular expressions combined with the JavaScript ‘test’ method.</p>
<h3>Using Ajax</h3>
<p>Ajax is a useful tool for posting data to a PHP script without the need to refresh the page. We can use Ajax here to post the data from the competition form to a PHP script for processing. Once this action has been performed we can feed back to the user that their entry has been received, and hide the input fields to prevent multiple entries.</p>
<h3>Deleting old competitions</h3>
<p>As time goes on your old competitions will start to clutter up the screen. When you no longer want your competition/entry data simply click on the ‘delete competition’ button. This will trigger a simple piece of SQL that erases all your competition and entry data. See the code on the resource disc at the back of the mag.</p>
<h3>That’s it!</h3>
<p>Have a look around the code on the disc and install the plug-in. Try running a competition on your website and see if you manage to obtain some details about your user demographic. Use the emails that your form has captured to your advantage and remember you don’t have to break the bank when it comes to your prizes. Running a competition can be a very cost-effective way of increasing your potential reach.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/build-a-custom-wordpress-competitions-plug-in/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Build stylish, scalable  maps using Leaflet.js</title>
		<link>http://www.webdesignermag.co.uk/tutorials/15569/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/15569/#comments</comments>
		<pubDate>Thu, 16 May 2013 08:30:09 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Leaflet.js]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=15569</guid>
		<description><![CDATA[Discover how to develop stunning mapping interfaces using open-source geographic data and Leaflet.js]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2013/05/step_12.jpg"><img src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/05/step_12.jpg" alt="Build stylish, scalable  maps using Leaflet.js" width="608" height="392" class="alignnone size-full wp-image-15577" /></a></p>
<p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2013/03/6_Interactive_scalable_maps.zip">DOWNLOAD TUTORIAL FILES</a></p>
<p><strong>Maps and geographic location data are a big part of our online presence and applications. More often than not, maps tend to look similar, as a single provider generates them. This means your map looks just like everyone else’s.</strong></p>
<p>Let’s take a step back from the existing mapping libraries available and investigate the small but powerful Leaflet.js library. Used by a number of recognisable organisations including Flickr, Meetup and foursquare, Leaflet.js works wonderfully on desktop and mobile devices, and makes use of modern HTML5 and CSS3 techniques, yet it’s still accessible on older browsers.</p>
<p>In this tutorial we will create a data-driven mapping application to plot the location of London train stations. We will see how we can build up the various layers of the map, including the zoom and scale controls, and we’ll obtain our geographic tiles for display from a third-party client. We’ll also incorporate some simple functions to update the style of the generated tiles directly from our map interface.</p>
<h3>Import Project</h3>
<p>Create a new project or folder in your chosen code editor and import the code from the starting_project directory on the resource disc. This contains the default html page, stylesheets, and jQuery library. Alternatively, you can create your own layout and transfer all of the required asset files to incorporate your own design.</p>
<h3>Include Leaflet.js</h3>
<p>To begin creating our map, we first need to reference the relevant JavaScript files to include the Leaflet.js functionality. You can download the files if you want to run them locally (available here: monkeh.me/8resh), but we will take advantage of the hosted libraries and call them via the CDN. Place these within the head of your document.</p>
<h3>Map container</h3>
<p>Create a div element as the container for the map. Any specific ID attribute value can be used for any number of elements – this means that you can include multiple maps on one page, should you so wish. We’ll keep it simple and call our container ‘map_holder’ so it’s easy to recognise and remember. Place this within the main div element.</p>
<h3>CloudMade Account</h3>
<p>The Leaflet.js mapping tool needs access to tiles – the square images that are pieced together to make the map. There are many tile providers out there, and you can host your own server if you wish. For this tutorial, we will use CloudMade. Head over to cloudmade.com, sign up for a free developer account, and obtain your API key. </p>
<h3>Global values</h3>
<p>Create a new script tag block, into which we’ll place two global variables. The first is the CloudMade API key, and the second is the default style of map you would like to use – in this instance, we’re going for the Fresh theme. We’ll then add in the jQuery ready() method, inside of which we’ll place the rest of our code.</p>
<p>001 <em>< </em>script type=”text/javascript”><br />
002    <br />
003 var apiKey  = ‘Your CloudMade API key’,<br />
004       styleID = ‘997’;<br />
005    <br />
006  $(document).ready(function() {<br />
007<br />
008  });<br />
009 </em><em>< </em>/script></p>
<h3>Define boundaries</h3>
<p>Our map data will focus on central London, so we have no specific requirements for the user to be able to view outside of a certain area. We can generate two pairs of co-ordinates and set those as the defining boundary box for our application, which will create a specific rectangular area on the map, between the boundaries of which people can view.</p>
<p>001 var southWest   = new L.LatLng(50.233152, -6.635742),<br />
002      northEast   = new L.LatLng(53.644638, 2.109375),<br />
003      bounds      = new L.LatLngBounds(southWest, northEast);</p>
<h3>Initialize Map</h3>
<p>To display our map on the page, we now need to initialize it and assign it to the map container element. To do so, we’ll create a new map and set the default view using a LatLon pair defaulting to central London. We’ll also set the maxBounds using our bounds value, defined earlier.</p>
<h3>generateTileURL</h3>
<p>Before we add any tiles to the map, create a function called generateTileURL that will accept the API key and style ID variables. This will generate the required string URL for inclusion in the map, and we can reuse this method a little later on to change the style of the map tiles from a select box element.</p>
<p>001 function generateTileURL(apiKey, styleID) {<br />
002  return ‘http://{s}.tile.cloudmade.com/’ + apiKey + ‘/’ +     styleID + ‘/256/{z}/{x}/{y}.png’;<br />
003 }</p>
<h3>Add tiles</h3>
<p>Using the generateTileURL function with default values, we’ll also create the text for the map attribution layer and set up the default values for our map tiles, including the maximum zoom level. Here, we also detect if the device has a high-definition display. If so, it will use four tiles of half the size to utilise the higher resolution.</p>
<p>001 var cloudmadeUrl = generateTileURL(apiKey, styleID),<br />
002      attribution = ‘Map data &copy; OpenStreetMap contributors.’,<br />
003      tileLayer = new L.TileLayer(<br />
004                                    cloudmadeUrl, <br />
005                                    { <br />
006                                        maxZoom: 18, <br />
007                                       attribution: 		attribution,<br />
008                                        detectRetina: true<br />
009                                   });<br />
010                                    <br />
011 tileLayer.addTo(map);</p>
<h3>Custom zoom</h3>
<p>We added zoomControl false to our map initialization method. By default a control is added to the top-left. We can override this to suit our<br />
layout by creating a new zoom control object and specifying the required position from a list of predefined options. We then need to add this to our map object like so.</p>
<p>001 var zoomControl = new L.Control.Zoom({ position: ‘topright’}  );<br />
002 zoomControl.addTo(map);</p>
<h3>Display scale</h3>
<p>We can also create a new scale control object to accurately display<br />
the scale of the map. Our attribution layer is positioned down on the bottom-right of the map object, so we’ll position our scale control over on the bottom-left and add this to the map using the same method as we have with the zoom control.</p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p>001 var scaleControl = new L.Control.Scale({ position:‘bottomleft’ });<br />
002      scaleControl.addTo(map);</p>
<h3>Style selection</h3>
<p>Create a new select box form element before the map container, setting the id attribute to styleSelector. This will hold the name and ID values of the styles we would like to select from. This contains the default CloudMade styles, but could also contain any custom styles you may have created especially for your application.</p>
<h3>Change style</h3>
<p>Add an onchange handler within the jQuery script block. When a new style is selected, this will set the ID value of the chosen style to the styleID global variable, which we’ll pass through to our tile generation function to update the URL. We then call the setUrl() method to update this value and regenerate the tiles for display.</p>
<p>001 $(“#styleSelector”).bind(“change”, function() <br />
002   {<br />
003  if ($(“#styleSelector”).val() !== “”) {<br />
004    styleID = $(“#styleSelector”).val();<br />
005    var revisedURL = generateTileURL(apiKey, styleID);<br />
006    tileLayer.setUrl(revisedURL);<br />
007  }<br />
008 });</p>
<h3>Import Data</h3>
<p>Our application needs to read the data we have about the London train stations. The project contains a file called stationData.js, which includes the JSON data. This data has the latitude, longitude and name of each station, which is perfect for plotting any markers on the map. Reference this file in the head of the HTML document.</p>
<h3>Generate markers</h3>
<p>Create a new function call addMarkers. This will accept the map object and the stationData in JSON format. Looping over the data, we will create a new Marker object for each station, setting the latitude, longitude and title, as well as binding a Popup window to also display the title string, complete with any HTML markup that may be included.</p>
<p>001 function addMarkers(map, stationData) {<br />
002  for (var i = 0; i < stationData.length; i++) {<br />
003    var a = stationData[i];<br />
004    var popupDetail = a[2];<br />
005    var title = popupDetail.replace(/(<([^>]+)>)/ig,””);<br />
006    var marker = new L.Marker(new L.LatLng(a[0], a[1]), { <br />
title: title });<br />
007      marker.bindPopup(popupDetail);<br />
008      map.addLayer(marker); }<br />
009 } </p>
<h3>Add markers</h3>
<p>Place a reference to the addMarkers function within the main mapping code, after the zoom and scale controls, sending through the required parameters. This will generate the markers and add each one onto the map.</p>
<p>001 addMarkers(map, stationData);</p>
<h3>Station selector</h3>
<p>Create a new select form element next to the style selector. Set the id attribute for this to stationSelector and provide a default value for display. We’ll use this to select a station, which in turn will prompt the map to pan, zoom and centre itself upon the selected marker.</p>
<p>001 </em><em>< </em>select id=”stationSelector”><br />
<option>&#8212; Select Station &#8212;</option>
<p></em><em>< </em>/select>                                                  </p>
<h3>Populate list</h3>
<p>Within the jQuery block, let’s once again loop over the data available from the stationData JSON. We’ll create a new option tag block with every loop, setting the custom data attributes with the station’s geographic co-ordinates, and the name of the station for visual reference. Finally, we’ll append this string to the select element to display the data.</p>
<p>001 var stationOptions = “”;<br />
002             <br />
003 for (var i = 0; i < stationData.length; i++) {<br />
004  stationOptions += ‘<br />
<option data-latitude=”’  + stationData[i][0] + ‘” data-longitude=”’ + stationData[i][1] + ‘”>’ +            stationData[i][2] + ‘’;        <br />
005 }<br />
006            <br />
007 $(“#stationSelector”).append(stationOptions);</p>
<h3>Set view</h3>
<p>Add a new onchange function that will obtain the latitude and longitude from the data attributes for the selected station. This function will then call the setView() method directly on the map, passing in the<br />
co-ordinates and setting the zoom level from the maxZoom value we<br />
added when instantiating the tile layer.</p>
<p>001 $(“#stationSelector”).bind(“change”, function() <br />
002 {<br />
003  var selectedStation = $(“#stationSelector :selected”);<br />
004 if (selectedStation.attr(“data-latitude”) !== undefined <br />
005    &#038;&#038; selectedStation.attr(“data-longitude”) !== undefined) {<br />
006    var thisLat = selectedStation.attr(“data-latitude”);<br />
007    var thisLon = selectedStation.attr(“data-longitude”);<br />
008    map.setView([thisLat, thisLon], map.getMaxZoom());<br />
009  } else {<br />
010    map.setView(latlng, 1);<br />
011  }<br />
012 });                                                                </p>
<h3>Using plug-ins</h3>
<p>There are many open-source plug-ins for integration with the Leaflet mapping library, available from the plug-in list: leafletjs.com/plugins.html. We’ll use the marker cluster plug-in to provide a much nicer, simplified view of our generated markers on the map. Download the plug-in code and export the contents of the dist folder into your project. The full code for this step can be found on the resource disc.</p>
<h3>Revise Markers</h3>
<p>With the cluster plug-in added to our page, we must make some small changes to the addMarkers function. Firstly, we’ll create a new MarkerClusterGroup object into which our markers will be placed. Finally we’ll add the populated markers object as a layer onto the map, instead of the individual station markers.</p>
<p>001 function addMarkers(map, stationData) <br />
002    {<br />
003  var markers = new L.MarkerClusterGroup();<br />
004  for (var i = 0; i < stationData.length; i++) {<br />
005    var a = stationData[i];<br />
006    var popupDetail = a[2];<br />
007    var title = popupDetail.replace(/(<([^>]+)>)/ig,””);<br />
008    var marker = new L.Marker(new L.LatLng(a[0], a[1]), { 	title: title });<br />
009    marker.bindPopup(popupDetail);<br />
010    markers.addLayer(marker);        <br />
011  }<br />
012  map.addLayer(markers);<br />
013 }</p>
<h3>Improved visuals</h3>
<p>With the addition of the marker cluster group, the mapping interface has been improved. The markers are now grouped in clusters based on the generated polylines from each marker’s geographic location, and the clusters will update and animate whenever we zoom in our out of the map.<br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/15569/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a cool sliding and scrollable mobile menu</title>
		<link>http://www.webdesignermag.co.uk/tutorials/create-a-cool-sliding-and-scrollable-mobile-menu/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/create-a-cool-sliding-and-scrollable-mobile-menu/#comments</comments>
		<pubDate>Sat, 11 May 2013 08:30:24 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Responsive]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Osborn Barr]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=15276</guid>
		<description><![CDATA[Emulate this neat and clever navigation solution from Osborn Barr that will work across all screens ]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.webdesignermag.co.uk/tutorials/create-a-cool-sliding-and-scrollable-mobile-menu/attachment/osbornbarr-2/" rel="attachment wp-att-15282"><img class="alignnone size-full wp-image-15282" title="Create a cool sliding and scrollable mobile menu" alt="Create a cool sliding and scrollable mobile menu" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/05/osbornbarr.png" width="608" height="343" /></a></p>
<p><strong>Osbornbarr.com is a digital agency that’s set in the very heart of rural USA. Your first impressions of the site may lead you to believe that it is in fact promoting agriculture, and you would be forgiven for thinking this. However, as soon as you explore the actual content it becomes obvious that this digital agency specialises in telling your story to your clients.</strong></p>
<p>The site is beautifully designed with clean sections of content, textured side panels, and footers that provide good contrast. The site is fully responsive and loses only the textured sidebar when scaling down, and the only content found in the said sidebar is the logo. This really is a great design experience for mobile and desktop browsers alike.</p>
<p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2013/05/7_Mobile-friendly_navigation.zip">DOWNLOAD THE CODE</a></p>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-a-cool-sliding-and-scrollable-mobile-menu/attachment/osbornbarrdefault/" rel="attachment wp-att-15283"><img class="size-full wp-image-15283 alignleft" style="margin-right: 10px;" title="Create a cool sliding and scrollable mobile menu" alt="Create a cool sliding and scrollable mobile menu" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/05/osbornbarrdefault.png" width="250" height="383" /></a></p>
<h3>TECHNIQUE</h3>
<p>Create mobile-friendly navigation</p>
<h3>Link up to the libraries</h3>
<p>Download the nano scroller and the CSS file from http://jamesflorentino.github.com/nanoScrollerJS/. Place these in your website root folder and then create a new HTML5 page. In the head section, link up the jQuery library, the nanoscroller plug-in file and the nanoscroller CSS file as shown in the code below.<br />
These will power part of the menu.</p>
<h3>Style up the content</h3>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p>We will now add our CSS for the menu. We are making the page black and creating a panel that will slide on and off from the left. This will contain the nano scrolling section of the project. A button will hold the controls to move the menu on and off the page.</p>
<p>001 body, html<br />
{ background: #111; color: #fff; height: 100%; overflow: hidden; font-family: Helvetica, Arial, sans- serif;}<br />
002 #panel<br />
{background-color: #555; width: 180px; height: 100%; padding: 10px; position:absolute; top: 0; left: -200px;}<br />
003 #switch<br />
{background-color: #555; position: absolute; padding: 10px; top: 0; left: 0; cursor: pointer; font-size: 3em;}<br />
004 .nano<br />
{ width: 180px; height: 300px; }</p>
<h3>Add the document content</h3>
<p>Now simply move your cursor to the body section of the document and then add your content div tags as shown in the code below. Here we have the overall side panel menu and inside that is the nano scroll section. Everything that can scroll goes into the content class. Any other menu elements can go below the scrolling section.</p>
<h3>Make it work</h3>
<p>Under the last code add the JavaScript tag as shown in the code below then the JavaScript code. It’s here that we initialise the nano scroller and we then add a click function to the switch, which will subsequently allow the menu to slide on when it is pressed, thus revealing the scrolling list and any other menu goodies that might exist.</p>
<h3>Finish the code</h3>
<p>Here we set the panel to animate in if it’s not on the screen already, which is in fact the complete opposite of the last step, which had it animate out. Now you need to save your work and test it in your browser to see the panel sliding in and out of the screen revealing a scrollable section. And, mobile-friendly navigation has been created.</p>
<p>001 } else {<br />
002 $(&#8220;#panel&#8221;).animate({&#8216;left&#8217;:&#8217;0&#8242;}, &#8216;easeOutSine&#8217;);<br />
003 $(&#8216;#switch&#8217;).text(&#8216;&lt; &#8216;); 004 onScreen = true; 005 }  006 });  // ]]&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/create-a-cool-sliding-and-scrollable-mobile-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create illustrative web styles</title>
		<link>http://www.webdesignermag.co.uk/tutorials/how-to-create-illustrative-web-styles/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/how-to-create-illustrative-web-styles/#comments</comments>
		<pubDate>Mon, 06 May 2013 09:00:17 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Andy Ward]]></category>
		<category><![CDATA[CS6]]></category>
		<category><![CDATA[Vector shapes]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=15231</guid>
		<description><![CDATA[Illustrated layout have become a real hit with creative web designers. Its appeal lies in its limitless imagination. Find out how to get creative with Photoshop
]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.webdesignermag.co.uk/tutorials/how-to-create-illustrative-web-styles/attachment/andyward/" rel="attachment wp-att-15235"><img class="alignnone size-full wp-image-15235" title="How to create illustrative web styles" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/05/andyward.png" alt="How to create illustrative web styles" width="608" height="408" /></a></p>
<p><span style="color: #888888;"><strong>inspiration: <a href="http://www.andyward.co.uk"><span style="color: #888888;">www.andyward.co.uk</span></a></strong></span></p>
<p><strong>Heavily illustrated layout has become a real hit with creative web designers. Such appeal is be attributed to the limitless imagination and creativity applicable within your design projects. Creating blueprints for sites normally means that you will have to go against standard images, layouts and simple textures – thereby offering regular fresh challenges.</strong><br />
<strong>There is a no-holds-barred approach to style, which includes examples such as vector, photo-illustration, real world and mixed media. Designers are even able to experiment and renew retro looks, such as Web 2.0 and 8-bit.</strong></p>
<p>These are applied in subtle and inventive ways. In essence, creating illustrative websites enables designers to have fun. This also extends to the use of colour, which is equally liberating. Vibrant tones are often encouraged to enhance what is essentially a very playful style. From a commercial point of view, even though numerous subcategories exist, illustration itself isn’t likely to be going away any time soon. Therefore it has become a web trend that clients and audiences can trust as it continues to be contemporary.<br />
In a nutshell, illustration gives the viewer a wholly memorable experience when visiting your website. Applying relative styles gives your website the personality to stand out from the crowd, which is always one of the most important factors. In this Web Workshop we will be showing you how to produce exciting styles to achieve this aim using<br />
Adobe Photoshop.</p>
<h3>INSPIRATION</h3>
<p><strong>CS6 Vector shapes</strong><br />
Clean bold vector styles are in fashion, with many sites sporting vector-drawn mascots. You may think that Adobe Illustrator would be your choice tool, with its vector engine offering you resizable elements. But if you don’t want to make the jump from Photoshop to another software package, you needn’t. Version CS6 of Photoshop now includes its own vector engine, applied to Shape and Type tools.</p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p><a href="http://www.webdesignermag.co.uk/tutorials/how-to-create-illustrative-web-styles/attachment/cs6vectors/" rel="attachment wp-att-15247"><img class="alignnone size-full wp-image-15247" title="How to create illustrative web styles" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/05/CS6vectors.jpg" alt="How to create illustrative web styles" width="608" height="342" /></a></p>
<h3>TECHNIQUE</h3>
<p><strong>Pen Path illustration</strong><br />
The Pen tool and its two settings, Shape and Path, become essential when creating digital illustrations inside of Photoshop. Here we look at how to apply the Path setting to create open paths. Add a stroke to these to create line work. Of course, this means we also must set the correct brush settings, which we also reveal to you. We finish this effect by using our brush to colour our line art.</p>
<p><strong>Draw open paths</strong><br />
Create a new layer called ‘Lines’ then use the Pen Path tool to create an illustration outline. You can use paths to create line detail too. Just Cmd/Ctrl-click to close a path, then start a new one.</p>
<p><strong>Set brush style</strong><br />
Select Paths Panel&gt;Create New Path and add line areas to one layer. Select Brush Presets&gt;Brush Tip Shape (Angle at 45°, Roundness at 12%). Activate Shape Dynamics from the same options.</p>
<p><strong>Paint in colour</strong><br />
Shape Dynamics Size Jitter = 100, Control = Pen Pressure, Min Diameter 35, Angle Jitter 5. Cmd-click path, Stroke Path. Use same brush (10% Opacity, Shape Dynamics off) to add colour.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/how-to-create-illustrative-web-styles/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Customising the Bootstrap framework</title>
		<link>http://www.webdesignermag.co.uk/tutorials/customising-the-bootstrap-framework/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/customising-the-bootstrap-framework/#comments</comments>
		<pubDate>Sat, 27 Apr 2013 08:30:24 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Responsive]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Responsive design]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=15088</guid>
		<description><![CDATA[Bootstrap is, if not one of, the most popular responsive frameworks available today. Here we show you how to customise the framework to create a bespoke responsive site.
]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.webdesignermag.co.uk/tutorials/customising-the-bootstrap-framework/attachment/bootstrap-2/" rel="attachment wp-att-15093"><img class="alignnone size-full wp-image-15093" title="Customising the Bootstrap framework" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/bootstrap.png" alt="Customising the Bootstrap framework" width="608" height="372" /></a></p>
<p><strong>The rise of Bootstrap, or as it was formerly known, Twitter Bootstrap, has been phenomenal. In case you are not aware, Bootstrap is a responsive framework created by two Twitter employees so that they didn’t have to start from scratch when starting web projects. The problem is, there are many people using it while not really having the understanding that it is a starting point for projects, so we have many sites with a Bootstrap look!</strong></p>
<p>Bootstrap is built on LESS, so it can be customised using that, but there are plenty of people who just want to get on to using it and not bother with LESS or having to compile via Node and command line. There is a customise page on the Bootstrap site that enables a unique look to be created, but if you change all the colours, there’s no way to save that style – so if you want to download a newer version of Bootstrap at some point in the future, you will lose that unique look you have crafted. The acceptable way to create a unique look is to download the base version of Bootstrap, and then modify the features in a new CSS file, which is what we’ll be doing.</p>
<p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2013/03/1_Customizing_Bootstrap.zip">DOWNLOAD TUTORIAL FILES</a></p>
<h3>Setting up</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/customising-the-bootstrap-framework/attachment/step-1-14/" rel="attachment wp-att-15101"><img class="alignnone size-full wp-image-15101" title="Customising the Bootstrap framework" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/step-1.jpg" alt="Customising the Bootstrap framework" width="608" height="339" /></a><br />
Copy the start folder from the resource disc onto your desktop and open ‘index.html’ in a code editor such as Dreamweaver. In the head section add the following links that provide the css for Bootstrap, link to a custom font and our own style sheet that will give us the unique look we want.</p>
<p>001 &lt;link href=”css/Bootstrap.min.css”     rel=”stylesheet”&gt;<br />
002 &lt;link href=”css/Bootstrap-responsive.min.    css” rel=”stylesheet”&gt;<br />
003 &lt;link href=’http://fonts.googleapis.com/    css?family=Quando’ rel=’stylesheet’ type=’text/    css’&gt;<br />
004 &lt;link href=’css/mystyle.css’         rel=’stylesheet’ type=’text/css’&gt;</p>
<h3>Link to the JavaScript</h3>
<p>The next part is to link up the JavaScript. Scroll to the bottom of the document and there will be some code inside &lt;script&gt; tags that power the Carousel. Just above those lines add the code shown below that links to the jQuery library and the Bootstrap library.</p>
<p>001 &lt;script src=”https://ajax.googleapis.com/    ajax/libs/jquery/1.8.3/jquery.min.js”&gt;&lt;/script&gt; 002 &lt;script src=”js/Bootstrap.min.js”&gt;&lt;/script&gt;</p>
<h3>Open the CSS document</h3>
<p>Now we are ready to start adding our content, so open the file ‘mystyle.css’ – there is already some code in there, but add the new code at the top. We will change the font and background colour slightly, which we will do in the body. Next we change the typeface for the branding and h1 and h2 of the site to our custom font from Google Web Fonts.</p>
<p>001 body {<br />
002 color: #5a5a5a;<br />
003 background-color:#fff;<br />
004 }<br />
005 .brand, h1, h2{<br />
006         font-family: ‘Quando’, serif;<br />
007 }</p>
<h3>Branding image problems</h3>
<p>One of the major problems with the site design is that the branding image is too large for the header and navigation section. In the code below we reduce the size of this. We also start to give our navigation a unique highlight colour to move away from the traditional Bootstrap look.</p>
<p>001 .myImg{<br />
002         width: 35px;<br />
003         height: auto;<br />
004 }<br />
005 a {color: #f5850c;}<br />
006 a:hover {color: #960;}  </p>
<h3>Unique navigation</h3>
<p>Nothing says Bootstrap quite like the navigation bar, so let’s start giving this a completely new look. This piece of code will give the drop menu an orange background when it is selected. Add the following code to the section of the stylesheet that is commented with Customise the navbar.</p>
<p>001 .navbar .nav li.dropdown.open &gt; .dropdown- toggle,<br />
002 .navbar .nav li.dropdown.active &gt;     .dropdown-toggle,<br />
003 .navbar .nav li.dropdown.open.active &gt;     .dropdown-toggle {<br />
004 color: #fff;<br />
005 background-color: #f5850c;<br />
006 }</p>
<h3>Drop down highlights</h3>
<p>If you move your mouse over the drop menu you will see that the background here is still the default blue, so we’ll change that by adding the next section of the CSS that changes the highlight colour to orange. We do this by overwriting the gradients of the original.</p>
<p>001 .dropdown-menu li &gt; a:hover,<br />
002 .dropdown-menu li &gt; a:focus,.dropdown-submenu:hover &gt; a {<br />
003 color: #ffffff;<br />
004 text-decoration: none;<br />
005 background-color: #f5850c;<br />
006 background-image: none;</p>
<h3>Finish the drop down</h3>
<p>The remaining code that we add here ensures that we cover every browser for the gradient background images. Because the original CSS file from Bootstrap has the background-image listed for each one, we have to set it back to none. Hopefully, one day, we might be able to get rid of the multiple prefixes.</p>
<p>001 background-image: none;<br />
002 background-image: none;<br />
003 background-image: none;<br />
004 background-image: none;<br />
005 background-repeat: no-repeat;<br />
006 filter: none;</p>
<h3>Move the navigation down</h3>
<p>We want the navigation bar moving down and sitting in the white space at the top of the document a little better than it currently does. The next section of code moves this down, but the bar still has the default gradient that makes it look so obviously like a Bootstrap-based document. We will sort the gradient out in the next step.</p>
<p>001 .navbar-wrapper {<br />
002 position: absolute;<br />
003 top: 0;<br />
004 left: 0;<br />
005 right: 0;<br />
006 z-index: 10;<br />
007 padding-top: 20px;<br />
008 margin-bottom: -90px; <br />
009 background-color: #FFF;<br />
010 }</p>
<h3>Remove the gradients</h3>
<p>Now we’ll overwrite the gradient in the navigation bar, so we’ll do that by overwriting the default values of the nav bar with just white as the background colour. As stated earlier, the only reason this code is so large is because there are so many different browser prefixes required for this to work.</p>
<p>001 .navbar .navbar-inner {<br />
002 border: 0;<br />
003 background-image: none;<br />
004 background-image: none;<br />
005 background-image: none;<br />
006 background-image: none;<br />
007 background-image: none;</p>
<h3>Finish the nav bar</h3>
<p>We also remove the drop shadow that is a very default look of the Bootstrap theme. It’s probably worth checking out at this stage how the changes look. Save the file and load the page in your web browser. A few simple modifications of the base Bootstrap theme are already beginning to give us a unique look.</p>
<p>001 background-image: none;<br />
002      -moz-box-shadow: none;<br />
box-shadow: none;<br />
004 filter: none;<br />
005 }</p>
<h3>Focus colour change</h3>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p>The current page still has the highlight style that has the default grey background. We’ll change that by removing the inner shadow and changing the hover and focus colour to the orange that we have used elsewhere in the design of our navigation. Save the page now and we are really moving away from the default look of the standard theme.</p>
<p>001 .navbar .nav &gt; .active &gt; a,<br />
002 .navbar .nav &gt; .active &gt; a:hover,<br />
003 .navbar .nav &gt; .active &gt; a:focus {<br />
004 color: #f5850c;<br />
005 text-decoration: none;<br />
006 background-color: #ffffff;<br />
007 -webkit-box-shadow: none;<br />
008 -moz-box-shadow: none;<br />
009 box-shadow: none;</p>
<h3>Starting the Carousel</h3>
<p>One of the main problems you will notice as you look at the page is that the Carousel isn’t quite big enough to deal with our images or the content inside of each of the slides. Add the code below to the CSS after the comment Carousel base class. Save this and give your browser a refresh to see the changes made.</p>
<p>001 .Carousel .item {<br />
002 height: 550px;</p>
<h3>Controlling the Carousel</h3>
<p>Because we’ve made the Carousel larger the controls need to be moved down to a more central position because they are too close to the top at present. We add the following CSS rule to keep everything the same but just move the controls down by 60px to sort out the problem.</p>
<p>001 timeline.timeline.date.push(tweet); } <br />
002 deferred.resolve();</p>
<h3>Highlighting the three images</h3>
<p>The three images immediately below the Carousel are going to be given greater emphasis now. We will do this by adding two background images, which is a CSS3 feature. The first will give us a pattern while the second will be a gradient. This will help to define this section.</p>
<p>001 .hilite-wrapper{<br />
002 background-image: url(../img/drop.png), url(../img/diamond_upholstery.png);<br />
003 background-position: left top, left top;<br />
004 background-repeat: repeat-x, repeat;<br />
005 padding: 50px 10px 80px 10px;<br />
006 border-top-width: 1px;<br />
007 border-top-style: solid;<br />
008 border-top-color: #ccc;<br />
</p>
<h3>Centre the heading and image</h3>
<p>The section is nicely highlighted with the background, but we also want to centre both the image and heading in each column. We could always just centre everything in the column, but centred body text is slightly harder to read for users’ eyes owing to the ragged edge on the left. This code will just centre the heading and image.</p>
<p>001 .hilite h2 {<br />
002 font-weight: normal;<br />
003 text-align: centre;<br />
004 }<br />
005 .hilite img{<br />
006 display: block;<br />
007 margin: 0 auto;<br />
008 }</p>
<h3>Responsive Carousel</h3>
<p>If we change the view of our design so that we are at a tablet-sized display, you will see that the Carousel has a large section of white underneath it. To fix this, we’ll change the height slightly and some of the positioning. Add the following code inside the @media (max-width: 979px) { section of code.</p>
<p>001.Carousel .item {<br />
002 height: 500px;<br />
003 }<br />
004 .Carousel img {<br />
005 top: 100px;<br />
006 width: auto;<br />
007 }<br />
008.Carousel-caption {<br />
009 padding: 0 70px;<br />
010 }</p>
<h3>Phone-sized fixes</h3>
<p>We just need to add some other fixes now to the design when we are at the phone size. Change your web browser viewport to a phone-sized display and you will see there are a few problems. Add the following code inside the @media (max-width: 767px) { section of code. This fixes the margins of the Carousel.</p>
<p>001 .Carousel {<br />
002 margin-left: -20px;<br />
003 margin-right: -20px;<br />
004 }</p>
<h3>Phone Carousel</h3>
<p>Despite the extra width to the Carousel there are still some problems. Lets reduce the size of the Carousel height and then set the width to be automatically sized for the image. Add the following code immediately under the last. This helps the image appear much better. Next, to sort out the text.</p>
<p>001 .Carousel .item {<br />
002 height: 300px;<br />
003 }<br />
004 .Carousel img {<br />
005 width: auto;<br />
006 }</p>
<h3>Change the caption</h3>
<p>With the addition of the following code we can see much more of the caption as we’ve reduced our width and moved the text up slightly. Despite these changes for the better the text is just too large and there is far too much of it, so let’s consider how we can clear that up.</p>
<p>001 .Carousel-caption {<br />
002 width: 65%;<br />
003 margin-top: 120px;<br />
004 }</p>
<h3>Caption fixes</h3>
<p>We’ll reduce the size of the caption text and remove the lead text that is immediately under the caption heading. Save this and check out the changes in the document. Now you should be able to read the heading much more clearly, especially without the clutter of the other text.</p>
<p>001 .Carousel-caption h1 {<br />
002 font-size: 25px;<br />
003 }<br />
004 .Carousel-caption .lead {<br />
005 display: none; <br />
006 }</p>
<h3>Extend to the edges</h3>
<p>The highlight wrapper code is used to highlight the three images in the footer section of the site. We’ll widen those sections to take advantage of the full width of the display in the smaller device by extending the margins, as the base class for Bootstrap brings the margins in by 20px.</p>
<p>001 .hilite-wrapper{<br />
002 margin-left: -20px;<br />
003 margin-right: -20px;<br />
004 }</p>
<h3>Final fix</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/customising-the-bootstrap-framework/attachment/step-21-4/" rel="attachment wp-att-15102"><img class="alignnone size-full wp-image-15102" title="Customising the Bootstrap framework" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/step-21.jpg" alt="Customising the Bootstrap framework" width="608" height="1132" /></a><br />
For the last part, we will add a little more space to each entry in the highlight section and reduce the size of the typography further down the page. With this in place, save your file and you should see a fully responsive Bootstrap site that starts to move away from the default look and feel of the template.</p>
<p>001.hilite .span4 + .span4 {<br />
002 margin-top: 40px;<br />
003 }<br />
004.featurette-heading {<br />
005 font-size: 25px;<br />
006 } </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/customising-the-bootstrap-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to build hover and transition effects</title>
		<link>http://www.webdesignermag.co.uk/tutorials/how-to-build-hover-and-transition-effects/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/how-to-build-hover-and-transition-effects/#comments</comments>
		<pubDate>Sat, 20 Apr 2013 08:30:39 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[hover effect]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[nav]]></category>
		<category><![CDATA[Substrakt]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=14971</guid>
		<description><![CDATA[Employ CSS3 transitions and opacity to create jQuery-like hover effects. Plus, use HTML5-friendly nav tags to create text hover effects]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.webdesignermag.co.uk/tutorials/how-to-build-hover-and-transition-effects/attachment/substrakt/" rel="attachment wp-att-14978"><img class="alignnone size-full wp-image-14978" title="How to build hover and transition effects" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/Substrakt.jpg" alt="How to build hover and transition effects" width="608" height="363" /></a></p>
<p><strong>INSPIRATION: www.substrakt.co.uk</strong></p>
<p><strong>The rise of CSS3 has seen a whole new collection of methods for creating cool and contemporary styling that used to need jQuery at its side to be achieved. The introduction of CSS transforms and transitions means that CSS is now far more capable of creating animation effects without the need for any external code. </strong></p>
<p>CSS transitions could be construed as hover effects on steroids, but that would be doing them an injustice as they have so much more to offer. Transitions can add a smooth transition from one state to another. Adding opacity into the mix allows the transition to go from a solid colour to an translucent state, or the opposite effect can be achieved just as easily. This is a technique seen on the homepage of the Substrakt site with the addition of increasing the background image size. The opacity can be played with to create the right amount in the start and finish states.</p>
<p>Hover effects, it seems, have been around since HTML was invented and they are still a popular technique. The beauty of hover effects is that they can be manipulated to appear in a host of guises. They are relatively quick to build and offer good browser support.</p>
<p>The typical approach for creating navigational elements is to use an unordered list and add the hover effect on the active link. Nothing wrong with this, but to go more HTML5-friendly the nav tag can be styled to achieve much the same effect. This requires less code and is easy to display horizontally or vertically. Adding an underline, as demonstrated in the Substrakt site, is again a simple but effective hover effect using only CSS.</p>
<h3>TECHNIQUE</h3>
<p><strong>QUICK CSS3 FADE EFFECTS</strong><br />
Fade effects on the hover state are very popular and the use of CSS transitions removes the need for any user coding. In the following example a <em>&lt; </em>div<em>&gt;</em> tag contains a background image with styled text overlaying it. The initial state uses a high opacity to give the merest hint of the image. The hover effect, applied to the <em>&lt; </em>header<em>&gt;</em> tag, uses a low opacity to view the image when the cursor rolls over the associated text.</p>
<h3>Create container</h3>
<p>Create a <em>&lt; </em>div<em>&gt;</em> tag to contain the background image and set height and width to match the latter. Now add the background image in the tag: background-image: url(escape.jpg);</p>
<h3>Fade class</h3>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p>Now to create the fade class that determines colour, length of transition and starting opacity. The opacity ranges from 0-1, set to .9 to start with a dark background. Adjust speed of fade (eg 1s).</p>
<h3>Hover effect</h3>
<p>Set the fade hover opacity to 0 or 0.1 to ensure the background image gets seen. Use the <em>&lt; </em>h2<em>&gt;</em> tag to add text and add the fade class to the tag (see disc for full code).</p>
<h3>TECHNIQUE</h3>
<p><strong>ADD CUSTOM UNDERLINES TO LINKS</strong><br />
An underline is often added to text links to emphasise the current link. The Substrakt site takes the basic concept and adds a hover effect. The hover effect changes the text colour and adds a styled underline.</p>
<h3>The nav tag</h3>
<p>To create the navigation base, the semantic <em>&lt; </em>nav<em>&gt;</em> tag is going to be used rather than an unordered list. The first step is to add a set of <em>&lt; </em>/nav<em>&gt;&lt; </em>nav<em>&gt;</em> tags in the body and then include the links that are to occupy the menu.<br />
001 <em>&lt; </em>nav<em>&gt;</em><br />
002 <em>&lt; </em>a href=&#8221;#&#8221;&gt;WORK<em>&lt; </em>/a&gt;<br />
003 <em>&lt; </em>a href=&#8221;#&#8221;&gt;ABOUT<em>&lt; </em>/a&gt;<br />
004 <em>&lt; </em>a href=&#8221;#&#8221;&gt;JOURNAL<em>&lt; </em>/a&gt;<br />
005 <em>&lt; </em>a href=&#8221;#&#8221;&gt;CONTACT<em>&lt; </em>/a&gt;<br />
006 <em>&lt; </em>/nav<em>&gt;</em></p>
<h3>Style link</h3>
<p>By default links will sit horizontally, so the first step is to add a right margin to add space. To create the space between the link and underline, bottom padding needs to be added. To finish, style the text and set text-decoration to none to remove underline</p>
<p>001 nav a {<br />
002 padding: 10px 0px 20px 0px;<br />
003 margin: 0px 30px 0px 0px;<br />
004 text-decoration: none;<br />
005 color: #999;<br />
006 font: 800 14px Open Sans;}</p>
<h3>Add underline</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/how-to-build-hover-and-transition-effects/attachment/underline/" rel="attachment wp-att-14977"><img class="alignnone size-full wp-image-14977" title="How to build hover and transition effects" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/underline.jpg" alt="How to build hover and transition effects" width="608" height="202" /></a><br />
The final step is to add the underline on hover. This is achieved by adding a bottom border, nav a:hover {border-bottom: #000 solid 3px;}. A designer has the option to modify all the settings – eg colour, width, style – to suit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/how-to-build-hover-and-transition-effects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create CSS3 badges with Arctext.js</title>
		<link>http://www.webdesignermag.co.uk/tutorials/create-css3-badges-with-the-arctext-js/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/create-css3-badges-with-the-arctext-js/#comments</comments>
		<pubDate>Fri, 19 Apr 2013 08:30:24 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[arctext.js]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=14936</guid>
		<description><![CDATA[CSS3 makes it possible to achieve a lot of effects that previously would have required an image editor]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.webdesignermag.co.uk/tutorials/create-css3-badges-with-the-arctext-js/attachment/final-41/" rel="attachment wp-att-14953"><img class="alignnone size-full wp-image-14953" title="Create CSS3 badges with Arctext.js" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/final.jpg" alt="Create CSS3 badges with Arctext.js" width="608" height="391" /></a></p>
<p><strong>One of the most gratifying aspects of CSS3 and the advent of jQuery, is the manner in which it has unleashed the web designer’s creativity to come up with novel approaches and solutions to design problems. CSS3 alone isn’t enough to transform the web as we experience it today, but when boundaries are pushed and new ideas are developed, the result can become mainstream with large-scale adoption (as with CSS-only image galleries for example).</strong></p>
<p>In this tutorial we’re creating a badge using CSS and a jQuery plug-in to wrap the words along a curved path. This isn’t going to become a common technique in itself by any means, but the concepts may get you thinking of fresh ideas and solutions to user interface challenges, developing approaches that could become mainstream tomorrow!</p>
<p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2013/03/4_Curved_text_effects.zip">DOWNLOAD TUTORIAL FILES</a></p>
<h3>Create the HTML</h3>
<p>Our final badge is going to incorporate CSS, jQuery and some Photoshop work. First we need some simple HTML elements to work with, so start off by creating a badge container &lt;div&gt;, and within it place a separate &lt;div&gt; for the badge top and the badge bottom, with a final &lt;div&gt; for the centre of the badge. You can find our starting HTML on the resource disc.</p>
<p>001    &lt;body&gt;<br />
002        &lt;div id=”container”&gt;<br />
003            &lt;header&gt;<br />
004                &lt;h1 id=”headline”&gt;Arctext.js&lt;/h1&gt;<br />
005                &lt;h2&gt;Curving text with CSS3 &amp;amp; jQuery&lt;/h2&gt;<br />
006            &lt;/header&gt;<br />
007            &lt;section class=”sub” id=”sub2”&gt;<br />
008                &lt;div id=”badge”&gt;<br />
009                    &lt;h3 id=”badgetop”&gt;Experience•the<br />
•power&lt;/h3&gt;<br />
010                    &lt;h3 id=”badgebottom”&gt;Of • curved • CSS3 • text&lt;/h3&gt;<br />
011                    &lt;div id=”badgeinner”&gt;POLICE&lt;/div&gt;<br />
012                &lt;/div&gt;<br />
013                &lt;div class=”clr”&gt;&lt;/div&gt;<br />
014            &lt;/section&gt;<br />
015            &lt;div class=”clr”&gt;&lt;/div&gt;<br />
016        &lt;/div&gt;<br />
017    &lt;/body&gt;</p>
<h3>Download Arctext</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-css3-badges-with-the-arctext-js/attachment/step02-17/" rel="attachment wp-att-14954"><img class="alignnone size-full wp-image-14954" title="Create CSS3 badges with Arctext.js" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/step02.jpg" alt="Create CSS3 badges with Arctext.js" width="608" height="475" /></a><br />
To achieve simple text along a path, we’re using the Arctext plug-in for jQuery. This works by splitting words in to individual letters and rotating each about a central point, allowing the word to appear to curved around that point. Download the plug-in from tympanus.net/Development/Arctext.</p>
<h3>Make the badge</h3>
<p>We’ll need some basic styles for our page – to help define how the badge will look (although this is also handled by the script for the curve of the text), as well as the design around the badge. The first thing to do, however, is create your badge graphics, so open Photoshop and create a document that’s 400px square.</p>
<h3>Circular selections</h3>
<p>Fill your canvas with a dark blue colour (we used #1A1A33 but you can find a shade you prefer if you wish), and apply the noise filter by choosing Filters&gt;Noise&gt;Add Noise. This will form the basis of the background to the badge, but we need to create the outer ring of the badge, leaving space for the text to slot in. Use the marquee tool to create a circular selection that fills the canvas as close as you can get to the edge.</p>
<h3>Layer Styles</h3>
<p>With your selection active, create a new layer and fill the selection with any colour. Set the fill value of this layer to 0% in the layers panel, then add a stroke layer style by choosing Layer&gt;Layer Styles&gt;Stroke. Set the stroke to be 1px, inside, and white.</p>
<h3>Add stars</h3>
<p>Repeat the process to create a smaller ring inside the first, and then use the shape tool to draw a star in a gold colour. Position the star so that it will appear between the two text phrases. Duplicate it and position the copy on the other side of the canvas.</p>
<h3>The inner badge</h3>
<p>Now repeat the same process as in the previous steps, this time creating the inner section of the badge. The document should be 260px square instead of 400px, and you can add some ornamentation to suit your own design – we added a gloss effect and a large central star.</p>
<h3>Create basic styles</h3>
<p>Now that we’ve got our graphics ready, it’s time to create the basic CSS styles that will position them accordingly. Start with the overall badge by setting it to be 400px in width and height. Add a border-radius value of 200px to force it into a circular shape, and apply the main badge graphic as a background.</p>
<p>001    #badge {<br />
002        position:        relative;<br />
003        width:            400px;<br />
004 height: 400px;<br />
005 background: #1a1a66 url(badgebg.jpg) <br />
no-repeat top left;<br />
006 border-radius: 200px;<br />
007 color: #fff;<br />
008 text-align: center;<br />
009 }</p>
<h3>Create the inner badge</h3>
<p>Using a similar approach, position and set the inner badge area using a width and height of 260px and a border-radius of half that – 130px – to achieve a circular object. Apply the badge centre graphic as a background, and use absolute positioning with margins to ensure the centre appears in the exact middle of the main badge.</p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p>001 #badgeinner {<br />
002 position: absolute;<br />
003 top: 50%;<br />
004 left: 50%;<br />
005 margin-left: -130px;<br />
006 margin-top: -130px;<br />
007 background: #1a1a33 url(badgeinner.jpg)<br />
no-repeat center center;<br />
008 border-radius: 130px;<br />
009 width: 260px;<br />
010 height: 260px;<br />
011 }</p>
<h3>Get jQuery ready</h3>
<p>We’re ready to try curving our text! Start off by downloading and including the jQuery library and the Arctext plug-in in the section of your page, then create a set of <em>&lt; </em>script<em>&gt;</em> tags and the standard $(document).ready() function ready for our calls to the Arctext plug-in methods. Note that jQuery 1.9 and above no longer supports IE versions older than v9.</p>
<h3>Make it curve!</h3>
<p>Arctext works by calling the Arctext method on a jQuery selection, and passing in a radius you’d like to curve around. Additionally, you can specify the type of curve you’d like to apply: 1 for a curve up, and -1 for a curve down. Add the code shown to curve the top and bottom badge text.</p>
<p>001 <em>&lt; </em>script type=”text/JavaScript” <br />
src=”scripts/jquery.js”&gt;<em>&lt; </em>/script&gt;<br />
002 <em>&lt; </em>script type=”text/JavaScript” <br />
src=”scripts/jquery.Arctext.js”&gt;<em>&lt; </em>/script&gt;<br />
003 <em>&lt; </em>script type=”text/JavaScript”<em>&gt;</em><br />
004<br />
005 $(document).ready(function(){<br />
006 $(“#badgetop”).Arctext({radius: 170, dir: 1});<br />
007 $(“#badgebottom”).Arctext({radius: <br />
170, dir: -1});<br />
008 });<br />
009 <em>&lt; </em>/script<em>&gt;</em></p>
<h3>Position with CSS</h3>
<p>If you test your page you’ll notice that the curves don’t line up with the badge very well. That’s no problem though, we can fix this using CSS to position the top and bottom text independently of each other. Add the code shown below to your stylesheet to put this in place, and then run a test again to see the text in the correct place on your badge.</p>
<p>001 #badgetop {<br />
002 width: 440px;<br />
003 position: absolute;<br />
004 top: -10px;<br />
005 left: -20px;<br />
006 text-align: center;<br />
007 color: #dec705;<br />
008 }<br />
009 <br />
010 #badgebottom {<br />
011 width: 440px;<br />
012 position: absolute;<br />
013 bottom: -10px;<br />
014 left: -20px;<br />
015 text-align: center;<br />
016 color: #c4a704;<br />
017 }</p>
<h3>Animated centre</h3>
<p>We can also apply animations using Arctext. Start by applying the same call to Arctext as in the previous step, then use the set method to add an animation to the text. We’ll do this to the centre of our badge by adding the code shown below immediately beneath our existing calls to the Arctext() method.</p>
<p>001 $(“#badgeinner”).Arctext({radius:-1,dir:1});<br />
002 $(“#badgeinner”).Arctext(‘set’,{<br />
003 radius: 200,<br />
004 dir: 1,<br />
005 animation: {<br />
006 speed: 5000<br />
007 }<br />
008 });</p>
<h3>Grab a web font</h3>
<p>Our text is looking good, but it would look better if we used a more appropriate font to suit our subject matter. We can grab a suitable font from the Google Web Fonts service – www.google.com/webfonts. Choose one you like the look of and follow the instructions to install it on your page.</p>
<h3>Animate the badge</h3>
<p>Although we’ve already got an animation, it would be nice to make more of the curved text. We’ll create a CSS animation and apply it to our badge to maximize the effect! Start by adding the code shown to create two different animations (our code is shown for WebKit browsers, but you can also create Mozilla, IE and Opera versions to suit).</p>
<p>001 @-webkit-keyframes rotatecw {<br />
002 0% {<br />
003 -webkit-transform: rotate(0deg);<br />
004 }<br />
005 100% {<br />
006 -webkit-transform: rotate(359deg);<br />
007 }<br />
008 }<br />
009 <br />
010 @-webkit-keyframes rotateccw {<br />
011 0% {<br />
012 -webkit-transform: rotate(0deg);<br />
013 }<br />
014 100% {<br />
015 -webkit-transform: rotate(-359deg);<br />
016 }<br />
017 }</p>
<h3>Apply the animation</h3>
<p>Now we’ve got the animations set up, we can apply them to our badge with a simple line of CSS. We’ve added a rotation to the badge overall, and then the second animation to the inner badge. The two rotate in opposite directions to give the impression that only the outer ring of the badge is animated.</p>
<p>001 #badge {<br />
002 font-size: 1.5em;<br />
003 position: relative;<br />
004 width: 360px;<br />
005 height: 360px;<br />
006 padding: 20px;<br />
007 background: #1a1a66 url(badgebg.jpg) <br />
no-repeat top left;<br />
008 border-radius: 200px;<br />
009 color: #fff;<br />
010 text-align: center;<br />
011 margin: 50px;<br />
012 border: 4px solid #1a1a33;<br />
013 box-shadow: 0px 0px 10px #000;<br />
014 text-transform: uppercase;<br />
015 -webkit-animation:rotatecw 10s linear;<br />
016 }<br />
017 <br />
018 #badgeinner {<br />
019 position: absolute;<br />
020 top: 50%;<br />
021 left: 50%;<br />
022 margin-left: -130px;<br />
023 margin-top: -130px;<br />
024 background: #1a1a33 url(badgeinner.jpg) <br />
no-repeat center center;<br />
025 box-shadow: 0px 0px 10px #000;<br />
026 border-radius: 130px;<br />
027 width: 260px;<br />
028 height: 260px;<br />
029 line-height: 120px;<br />
030 font-size: 2em;<br />
031 -webkit-animation:rotateccw 10s linear;<br />
032 text-shadow: 0px 0px 10px #000;<br />
033 }</p>
<h3>Add a final polish</h3>
<p>We can complete our design by creating a page background in Photoshop and adding some additional styling to our text to make it appear all upper-case. Add the final styles shown, and then test in your browser to make sure the completed design works as it should. Tweak animation timings to suit your own preferences.</p>
<p>001 h1, h2 {<br />
002 text-align: center;<br />
003 text-transform: uppercase;<br />
004 font-weight: normal; <br />
005 margin: 0;<br />
006 padding: 0;<br />
007 }<br />
008 <br />
009 h1 {<br />
010 font-size: 4.5em;<br />
011 color: #f4d006;<br />
012 text-shadow: 0px 0px 10px #000;<br />
013 }<br />
014 <br />
015 <br />
016 #container {<br />
017 position: relative;<br />
018 width: 500px;<br />
019 margin: auto;<br />
020 font-size: 1.4em;<br />
021 }<br />
022 <br />
023 #badge h3 {<br />
024 font-weight: normal;<br />
025 }</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/create-css3-badges-with-the-arctext-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create and intergrate a Facebook ecommerce store with StoreYa</title>
		<link>http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/#comments</comments>
		<pubDate>Mon, 15 Apr 2013 12:00:38 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Developer]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[StoreYa]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=14836</guid>
		<description><![CDATA[Start selling online and increase your business’s reach by connecting to the world’s largest social network]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_4-2/" rel="attachment wp-att-14840"><img class="alignnone size-full wp-image-14840" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_4.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="325" /></a></p>
<p><strong>Facebook is a platform that serves many eCommerce purposes. From large global corporations to small family-run businesses, they are all using Facebook to reach their customers, promote their brands and build their customer base. The ability for the public to write their own Facebook applications has once again seen the many uses for Facebook grow even bigger.</strong></p>
<p>StoreYa is a Facebook app that helps you integrate your online store to your Facebook page, allowing you to display your entire catalogue of products. Once installed, you can sort, re-order and categorise your products with the simple-to-use interface on the StoreYa website. Your new Facebook store will include many useful features – worth a mention are the Like and Share buttons for each product. These buttons allow your customers to promote specific products on their own Facebook page. StoreYa boasts that you can integrate your eCommerce store with your Facebook page using their application in 30 seconds. We’ll be putting that to the test using a Magento platform.</p>
<p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2013/03/5_Facebook_eCommerce.zip">DOWNLOAD TUTORIAL FILES</a></p>
<h3>Get a Facebook account</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_1-2/" rel="attachment wp-att-14837"><img class="alignnone size-full wp-image-14837" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_1.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="299" /></a><br />
If you’re not part of the 1 billion people with a Facebook account, go to www.facebook.com and create one. It’s really simple to do and should only take a few minutes. Make sure to follow the three main steps carefully and add as many people as you can. Remember – the more friends you have, the number of potential sales you could get is increased.</p>
<h3>Create a fan page</h3>
<p>If you already have a Facebook account (or have just created one) you now have to set up a fan page. A fan page is slightly different from your normal Facebook page and is primarily used to build a closer relationship with your customers. Go to www.facebook.com/pages and click on the green Create a Page button on the right of the screen.</p>
<h3>Pick your page category</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_2-2/" rel="attachment wp-att-14838"><img class="alignnone size-full wp-image-14838" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_2.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="355" /></a><br />
The first step towards creating your new Facebook fan page is selecting the category that suits your needs, and is the most relevant to the service and/or product you are selling. If you are a business that wants to promote your products or services, then typically you would select the Local Business or Place category. The other categories to choose from include: Company, Organization or Institution, Brand or product, Artist, Band or Public Figure, Entertainment, and Cause or community.</p>
<h3>Describe your business</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_3-2/" rel="attachment wp-att-14839"><img class="alignnone size-full wp-image-14839" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_3.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="368" /></a></p>
<p>Choose suitable profile and header images for your page. It’s probably a good idea to use your company logo for the profile image and if you have the Photoshop skills then create a collage of your most interesting products for the header. A great example of this can be seen at www.facebook.com/imagineshopuk. Next add a description and website URL to improve the ranking of your page in the search results.</p>
<h3>Develop your fan page</h3>
<p>Now that the basics are in place it gives you a good foundation to build on. Try sharing something, or perhaps promote a special offer you are currently running. The more people your page is connected to on Facebook, the more active and engaging it will be. Set an achievable goal of getting your first 50 Page Likes. Get started by inviting your friends.</p>
<h3>Register with StoreYa</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_5-2/" rel="attachment wp-att-14841"><img class="alignnone size-full wp-image-14841" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_5.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="324" /></a></p>
<p>Now that your Facebook page is up and running, it’s time to set up the StoreYa application. Head over to www.storeya.com and click on the Connect with Facebook button. Logging in to StoreYa is done by connecting with Facebook using your personal profile.</p>
<h3>Create your Facebook store</h3>
<p>First you need to select which eCommerce platform you are using. For this example we will use Magento but the StoreYa application supports a wide range of platforms including: Shopify, Amazon and WordPress to name but a few. If your platform does not appear in the list then you can still upload your products using the CSV export option.</p>
<h3>Setting up the API</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_6-2/" rel="attachment wp-att-14842"><img class="alignnone size-full wp-image-14842" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_6.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="296" /></a></p>
<p>In order for the StoreYa application to sync with your Magento store, you first need to create an API User; this is done by creating an API role. Log in to the Magento admin panel and navigate to System&gt;Web Services&gt;Roles. This page lists the current API roles, and it is here that you will need to create a new role.</p>
<h3>Creating a new API role</h3>
<p>Click Add New Role and give it a name of your choosing. It can be anything, but a descriptive name such as ‘StoreYa API’ would be ideal. Next, click on Role Resources, which is on the left-hand side, then select the All option which appears in the drop-down list. Finally, click Save Role and the new API role will be saved.</p>
<h3>Create a new API User</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_7-2/" rel="attachment wp-att-14843"><img class="alignnone size-full wp-image-14843" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_7.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="342" /></a></p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p>Now that the role is created you need to create a user that will be associated with this role. Click: System&gt;Web Services&gt;Users and you will be presented with a form. Fill out all the fields on the form and bear in mind that the API Username and API Key will be the username and password you will use later, so make sure they are secure. Click Save User and then select the role you created earlier.</p>
<h3>Using the API User and Key</h3>
<p>If the process was successful then you should see a green tick with a confirmation message presented at the top-left of the screen. You can now use the API User and API Key in the next step of the import process. Write them in the fields provided and hit Continue.</p>
<h3>Alternative syncing methods</h3>
<p>If you are using an older version of Magento then the API method may not work. If you experienced any problems following the steps above then you may want to consider using a Google base feed or manually exporting your products to a CSV file that you can then upload manually.</p>
<h3>Exporting the CSV file</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_9/" rel="attachment wp-att-14845"><img class="alignnone  wp-image-14845" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_9.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="295" /></a></p>
<p>Go to the admin control panel and click System&gt;Import/Export&gt;Profiles. Next you have to add a profile so click on the Add Profile button. Fill out the form ensuring that the Entity Type drop down has the Product option selected and the Profile Direction field displays Export. Hit the Save Profile button.</p>
<h3>Run the export command</h3>
<p>The profile you created should now be shown in the profile list. When you click on it you will be presented with a form filled with options. Choose a file name for the CSV file and select where you want to export the file to. Be aware that you cannot export this file to your local desktop; you can only export it to the server on which the Magento store is hosted. Fill in the rest of the fields, and hit Run Profile, which is in the left-hand navigation bar.</p>
<h3>Upload the CSV</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_8-2/" rel="attachment wp-att-14844"><img class="alignnone size-full wp-image-14844" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_8.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="324" /></a></p>
<p>FTP to your server and navigate to the directory you told Magento to export the CSV file to. Copy it to your local machine and in your browser go to www.storeya.com/register/magento-csv. Enter your store URL and upload the CSV. A progress bar should appear, and once it has been uploaded hit the Activate button. Your Facebook store should now be up and running!</p>
<h3>Check out your store</h3>
<p>Log in to Facebook and navigate to your fan page – you should see a Shop now button. Click on the button and it will take you to your new store. You will see that the categories are listed along the top for easy navigation. There is also a search bar that allows your Facebook users to search your catalogue of products. The order in which the categories and products are presented along with other customising options can all be managed by using the admin section of the StoreYa website. Simply log in and start configuring!</p>
<h3>Managing your store</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_13-2/" rel="attachment wp-att-14849"><img class="alignnone size-full wp-image-14849" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_13.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="324" /></a></p>
<p>When you get logged in you will be presented with a graph showing the number of visitors you have had. When a few weeks/months have passed this page will become increasingly useful as more data will be generated, allowing you to see which of your products and categories are most popular.</p>
<h3>Change the appearance</h3>
<p>Next we will want to give our store some style and individuality. Click Customize your store&gt;Customization. From here you will be able to add a header image, change colours, select the number of products per page, and change the currency to that of your choosing. The easy-to-use interface makes this process a breeze, and it also allows you to see what your changes look like without having to navigate away to your Facebook page.</p>
<h3>Customising your store</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_14-2/" rel="attachment wp-att-14850"><img class="alignnone size-full wp-image-14850" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_14.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="324" /></a></p>
<p>You may want to change the order of the products on the landing page of your store. To do this you can use the intuitive drag and drop system. Click Manage store&gt;Manage products. From this page you can perform a variety of tasks such as editing product data, removing a product from your store, and changing the order in which it appears.</p>
<h3>Watch your sales increase</h3>
<p><a href="http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/attachment/screenshot_15/" rel="attachment wp-att-14851"><img class="alignnone size-full wp-image-14851" title="Create and intergrate a Facebook ecommerce store with StoreYa" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/screenshot_15.jpg" alt="Create and intergrate a Facebook ecommerce store with StoreYa" width="608" height="325" /></a></p>
<p>Reaching out to a Facebook audience is a great way to raise your brand/product awareness with an online community that may never have seen or heard about what your business is selling. Having a direct link from your Facebook page to your products removes the process of a potential customer having to track down your eCommerce store and view your product information the conventional way. Hopefully, over time you will see your sales increase, as well as raised awareness of your products.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/create-and-intergrate-a-facebook-ecommerce-store-with-storeya/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a fullscreen video background</title>
		<link>http://www.webdesignermag.co.uk/tutorials/create-a-fullscreen-video-background/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/create-a-fullscreen-video-background/#comments</comments>
		<pubDate>Fri, 12 Apr 2013 16:07:13 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[video background]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=14821</guid>
		<description><![CDATA[Discover how to add short video backgrounds using YouTube]]></description>
				<content:encoded><![CDATA[<p><strong><a href="http://www.webdesignermag.co.uk/tutorials/create-a-fullscreen-video-background/attachment/barrell/" rel="attachment wp-att-14828"><img class="alignnone size-full wp-image-14828" title="Create a fullscreen video background" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/barrell.jpg" alt="Create a fullscreen video background" width="608" height="306" /></a></strong></p>
<p><strong></strong><strong>inspiration: <a href="http://barrelny.com/recap/2012">barrelny.com/recap/2012</a></strong></p>
<p>Barrel is a digital agency from New York, and like many agencies it enjoys showing off its design and development skills. The 2012 Recap element of the site, chosen here, uses a full screen video background.<br />
The selected video clip shows an everyday scene at the agency to help emphasis who and what they are. The short clip runs on a loop simply repeating at the end of the clip. The length of the clip is around 30 seconds, but it is the size that is a more important consideration. The bigger a clip the longer it will take to load, so keeping it short/small will help to ensure a more enjoyable user experience.<br />
There are various options for creating a video background. There is the more bespoke option of using Video.js or BigVideo.js for one thing. Alternatively, for those who do not have the video they want, a video from YouTube can be implemented.</p>
<h3>Big div</h3>
<p>The first step is to create a div to contain the video. This will have a height of 100% and a width of 100%. Add a new div tag, <em>&lt; </em>div id=”bigvid”<em>&gt;</em><em>&lt; </em>/div<em>&gt;</em>, to the body and name it accordingly. Add a comment to the closing tag for future reference.</p>
<p>001 <em>&lt; </em>div id=”bigvid”<em>&gt;</em><br />
<br />
text will go in here<br />
<br />
002 <em>&lt; </em>/div&gt; <!-- //#bigvid --<em>></p>
<h3>Video container CSS</h3>
<p>The video container will need its width and height set to 100%. In the head of the page add a set of style tags. Inside, add the selector name and then add the height and width properties. Include the background colour black, this will help blend the video into the background when it is not at full width.</p>
<p>001	#bigvid {<br />
002	background-color: #F30;<br />
003	height: 100%;<br />
004	width: 100%;<br />
005	}</p>
<h3>Add video</h3>
<p>Head to YouTube, select a video to use click Share>Embed tab and copy the iframe code and paste in the div tag created in Step 1. Now set the width and height to 100%. To hide YouTube elements, eg the title bar, add parameters after the video URL as shown. See<br />
bit.ly/znAzhT for a full parameters list.</p>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p>001	<em>< </em>div id=”bigvid”</em><em>></em><br />
002	<em>< </em>iframe width=”100%” height=”100%”<br />
003	src=”http://www.youtube.com/embed/MXh3YRtTiGg?autoplay=1;controls=0;showinfo=0”frameborder=”0”allowfullscreen><br />
004	</em><em>< </em>/iframe><br />
005	</em><em>< </em>/div</em><em>></em><!-- // #bigvid --></p>
<h3>Go fullscreen</h3>
<p>Save the page and preview in your preferred browser. The video will currently have a space around it – set the body tag to 0 padding and margins. Even though the video is set to 100% on both height and width, only the width is currently observing the width value. Add position:absolute to the video container CSS to resolve.</p>
<p>001 #bigvid {<br />
002 position: absolute;<br />
003 background-color: #000;<br />
004 height: 100%;<br />
005 width: 100%;<br />
006 }<!-- // #bigvid --></p>
<h3>Add an overlay</h3>
<p>To overlay a div tag over the video the div needs to be positioned using the absolute value. Add a new div tag and name appropriately. Now set the width and height to 400px and set position to absolute. Add a background colour, but make sure that it is one that complements the background video.</p>
<p>001 #start<br />
002 {<br />
003 position: absolute;<br />
004 width: 400px;<br />
005 height: 400px;<br />
006 z-index: 1;<br />
007 background-color: #000;<br />
008 }</p>
<h3>Styling and centring</h3>
<p>To make the div created in the previous step a circle, the border-radius property is to be used. Add border-radius and set to the width of the div tag to 400px. To position the circle, first add top: 30%. To centre the circle add left: 50%, and margin-left to half the width with a minus value, -200px. Finally add some padding and text.</p>
<p>001 #start<br />
002 {<br />
003 position: absolute;<br />
004 width: 400px;<br />
005 height: 400px;<br />
006 z-index: 1;<br />
007 background-color: #000;<br />
008 border-radius: 400px;<br />
009 top: 30%;<br />
010 left: 50%;<br />
011 margin-left: -200px;<br />
012 }</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/create-a-fullscreen-video-background/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to build tiled mosaic layouts</title>
		<link>http://www.webdesignermag.co.uk/tutorials/how-to-build-tiled-mosiac-layouts/</link>
		<comments>http://www.webdesignermag.co.uk/tutorials/how-to-build-tiled-mosiac-layouts/#comments</comments>
		<pubDate>Sun, 07 Apr 2013 08:30:12 +0000</pubDate>
		<dc:creator>Steve Jenkins</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Automatic Image Montage]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Montage]]></category>

		<guid isPermaLink="false">http://www.webdesignermag.co.uk/?p=14728</guid>
		<description><![CDATA[Fill the browser window with good-looking content to gain interest and engage visitors]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.webdesignermag.co.uk/tutorials/how-to-build-tiled-mosiac-layouts/attachment/oscar/" rel="attachment wp-att-14748"><img class="alignnone size-full wp-image-14748" title="How to build tiled mosaic layouts" src="http://www.webdesignermag.co.uk/wp-content/uploads/2013/04/oscar.png" alt="How to build tiled mosaic layouts" width="608" height="349" /></a></p>
<p><span style="color: #888888;"><strong>inspiration <a href="http://www.oscar-charlie.com"><span style="color: #888888;">www.oscar-charlie.com</span></a></strong></span></p>
<p><a href="http://www.webdesignermag.co.uk/wp-content/uploads/2013/03/7_Montage_layout.zip">DOWNLOAD TUTORIAL FILES</a></p>
<p><strong>One of the more recent trends in web design has been filling the web browser width with content. An extremely good way of doing this is with masonry layouts, which have been covered in Web Designer on previous occasions (see issue 195). Oscar Charlie takes a variation of the masonry layout and applies a grid structure to a mosaic image layout. </strong></p>
<p>The whole of this layout is one long, endlessly sliding carousel. This provides a great interface by which customers can move through a lot of content in both a graphic and visual way. The site has been designed this way to link to an employee mobile app, which allows for real-time status and photo uploads. This provides a simple and intuitive way for customers and other interested parties to experience these uploads.</p>
<h3>TECHNIQUE</h3>
<p><strong>Develop a montage layout</strong></p>
<h3>Get the library</h3>
<p>Like most projects, we can kick start ours by using jQuery and the Automatic Image Montage plug-in, so download this from tympanus.net/codrops/2011/08/30/automatic-image-montage. Create a new HTML document in this folder, and in the head section we’ll link to the stylesheet that will style the images. You could add a border to each image, or make them flush against each other here.</p>
<p>001    &lt;link rel=”stylesheet” type=”text/    css” href=”css/style.css” /&gt;</p>
<h3>Add page content</h3>

					<div class="adInPost">
						<script type="text/javascript">
							GA_googleFillSlot("WD_MidPage_MPU1");
						</script>
					</div><p>Move into the body section and we’ll create a container div tag to hold everything. Inside here we’ll add another div tag to hold the montage. Finally we add the images. Feel free to add as many as you like here – the image folder has 73 images named numerically. The code for this step is on the resource disc.</p>
<h3>Link to the library</h3>
<p>After the closing div tag of the container div, we can add our links to the appropriate JavaScript libraries. The first line of code links to the CDN jQuery library online. The second links to the minified version of the montage library that will power our layout here. The code for this step is also on the CD.</p>
<h3>Count the images</h3>
<p>Here our container for the montage is recorded together with the number of images within the montage, and each one is hidden from the display. Then each of the images is looped through with a load function to see if they have loaded into the browser.</p>
<p>001    $(function() {<br />
002    var $container = $(‘#montage’),<br />
003    $imgs    = $container.find(‘img’)    .hide(),<br />
004    totalImgs = $imgs.length,<br />
005    cnt = 0;<br />
006    $imgs.each(function(i) {<br />
007    var $img = $(this);<br />
008    $(‘&lt;img/&gt;’).load(function() {</p>
<h3>Display the montage</h3>
<p>Once all images have loaded, they are made visible again and arranged within the display to fill the browser. Save the page and test in the browser to see the images load in a style very similar to the website.</p>
<p>001    ++cnt;    <br />
<br />
002    if( cnt === totalImgs ) {<br />
003                                $imgs.show();    <br />
004                                $container.montage({<br />
005                                fillLastRow : true,<br />
006                                alternateHeight : true,<br />
007                                alternateHeightRange :     {min:180, max:240}<br />
008                        });<br />
009 }<br />
010 }).attr(‘src’,$img.attr(‘src’));<br />
011 });    <br />
012 });<br />
013 &lt;/script&gt;</p>
<p>The Automatic Image Montage plug-in for jQuery is very easy to use and can fill a webpage with images. The plug-in contains a number of different attributes that allow the layout to be customised.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdesignermag.co.uk/tutorials/how-to-build-tiled-mosiac-layouts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
