<?php 
	
	$theme = $_GET['theme'];

	$themeName = '';
	$themeSlug = '';
	$themeFullName = '';

	switch( $theme ) {
		case 'cyan-lime':
			$themeFullName = 'Material Cyan Lime';
			$themeSlug = 'cyan_lime';
		break;
		case 'indigo-pink':
			$themeFullName = 'Material Indigo Pink';
			$themeSlug = 'indigo_pink';
		break;
		case 'grey-cyan':
			$themeFullName = 'Material Grey Cyan';
			$themeSlug = 'grey_cyan';
		break;
		case 'deep-grey-amber':
			$themeFullName = 'Material Deep Grey Amber';
			$themeSlug = 'deep_grey_amber';
		break;
		case 'deep-purple-red':
			$themeFullName = 'Material Deep Purple Red';
			$themeSlug = 'deep_purple_red';
		break;
		case 'blue-yellow':
			$themeFullName = 'Material Blue Yellow';
			$themeSlug = 'blue_yellow';
		break;
	}

	/* Remove spaces from the full name */
	$themeName = str_replace( ' ', '', $themeFullName );

?>

<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Feathers themes - Open-source themes for Feathers UI | <?= ($themeFullName == '') ? 'Unknown theme' : $themeFullName ?> - Guide</title>
	<meta name="description" content="Open-source themes for Feathers UI">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	
	<!-- Styles -->
	<link rel="stylesheet" href="../styles/bootstrap.min.css">
	<link rel="stylesheet" href="../styles/hover.min.css">
	<link rel="stylesheet" href="../styles/animate.min.css">
	<link rel="stylesheet" href="../styles/owl.carousel.min.css">
	<link rel="stylesheet" href="../styles/owl.theme.default.min.css">
	<link rel="stylesheet" href="../styles/font-awesome.min.css">
	<link rel="stylesheet" href="../styles/et-line.css">
	<link rel="stylesheet" href="../styles/koel.css">
	<link rel="stylesheet" href="../styles/koel-shopping.css">
	<!-- End Styles -->
	<!-- Google Fonts -->
	<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700' rel='stylesheet' type='text/css'>
	<link href='https://fonts.googleapis.com/css?family=Raleway:400,300,200,500,600,700' rel='stylesheet' type='text/css'>
	<!-- End Google Fonts -->
	<!-- Scripts -->
	<script src="../scripts/modernizr.js"></script>
	<!-- End Scripts -->
</head>

<body>
	<!--[if lt IE 7]>
	<div class="alert alert-warning alert-dismissible" role="alert">
	  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	  <p>You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
	</div>
	<![endif]-->


	<!-- Header -->
	<section id="header" class="header header-inner">
		<!-- Navigation -->
		<nav class="navbar navbar-fixed">
			<!-- Navigation Container -->
			<div class="container">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed">
						<span class="fa fa-bars"></span>
					</button>
					<a class="navbar-brand" href="https://feathers.marpies.com">
						<img alt="Brand" src="../images/logo/logo-black.png" />
					</a>
				</div>
				<div class="collapse navbar-collapse" id="navbar-collapse">
					<ul class="nav navbar-nav navbar-right">
						<li><a href="./">Themes</a></li>
						<li><a href="https://marpies.com/contact">Contact</a></li>
					</ul>
				</div>
			</div>
			<!-- End Navigation Container -->
		</nav>
		<!-- End Navigation -->
	</section>
	<!-- End Header -->


	<!-- Main -->
	<main role="main">

		<?php if( $themeFullName == '' ): ?>

		<!-- Page Heading -->
		<div class="page-heading">
			<div class="container">
				<header>
					<h1>Unknown theme</h1>
				</header>
			</div>
		</div>
		<!-- End Page Heading -->

		<?php else: ?>

		<!-- Page Heading -->
		<div class="page-heading">
			<div class="container">
				<header>
					<h1><?= $themeFullName ?> - Guide</h1>
				</header>
			</div>
		</div>
		<!-- End Page Heading -->

		
		<!-- Blog -->
		<section id="blog">

			<div class="container">

				<!-- Blog Item -->
				<div class="blog-item">
					<article class="post" vocab="https://schema.org/">
						
						<div class="post-content full-content">
							<h2>Contents</h2>
							<ol>
								<li><a href="#structure">Repository structure</a></li>
								<li><a href="#getting-started">Getting started</a></li>
								<li><a href="#using-theme">Using the theme</a></li>
								<li><a href="#theme-icons">Using the theme's icons</a></li>
								<li><a href="#theme-styles">Using the theme's styles</a></li>
								<li><a href="#faq">FAQ</a></li>
							</ol>

							<h2 id="structure">Repository structure</h2>
							<p>The Github repository has the following structure:
							<ul>
								<li>_dev_assets
									<ul>
										<li>icons
											<p>Images of the icons</p>
										</li>
										<li>images
											<p>Sliced-up theme assets</p>
										</li>
										<li>material_<?= $themeSlug ?>_mobile.tps</li>
										<li>material_<?= $themeSlug ?>_mobile_icons.tps
											<p>TexturePacker projects</p>
										</li>
									</ul>
								</li>
								<li>assets
									<ul>
										<li>fonts
											<p>Fonts used by the theme</p>
										</li>
										<li>images
											<p>Atlas texture used by the theme</p>
										</li>
										<li>xml
											<p>Atlas XML data used by the theme</p>
										</li>
									</ul>
								</li>
								<li>src
									<p>Theme source files</p>
								</li>
								<li>swc
									<p>Compiled SWC file of the theme</p>
								</li>
							</ul>
							</p>

							<p>Folder <code>_dev_assets</code> is not required by the theme in the production and therefore should
not be packaged with your application. Should you wish to include only some of the icons, you can modify the contents of the <code>icons</code> folder and publish new texture atlas using the TPS files and TexturePacker.</p>

							<p>Folders <code>assets</code> and <code>src</code> are required by the theme and you need to include these in your application. Furthermore, these folders must be placed within the same root folder.</p>

							<h2 id="getting-started">Getting started</h2>
							<p>The theme contains two kinds of assets and source files – one of them includes additional icons, the other one does not. If you do not need additional icons in your application it is recommended to use the theme's assets without icons. Furthermore, the source files are divided into two groups depending on the way you want the assets to be loaded.</p>

							<h3>Theme without icons</h3>
							<p>If you wish to use the theme without additional icons, you will need to copy the following files to your project folder:</p>

							<ul>
								<li>assets
									<ul>
										<li>fonts
											<ul>
												<li>Roboto-Bold.ttf</li>
												<li>Roboto-Regular.ttf</li>
											</ul>
										</li>
										<li>images
											<ul>
												<li>material_<?= $themeSlug ?>_mobile.png</li>
											</ul>
										</li>
										<li>xml
											<ul>
												<li>material_<?= $themeSlug ?>_mobile.xml</li>
											</ul>
										</li>
									</ul>
								</li>
								<li>src
									<ul>
										<li>Base<?= $themeName ?>MobileTheme.as</li>
										<li><?= $themeName ?>MobileTheme.as <sup>1</sup>
											<p style="margin: 5px 0;">or</p>
										</li>
										<li><?= $themeName ?>MobileThemeWithAssetManager.as <sup>2</sup></li>
									</ul>
								</li>
							</ul>
							<p><sup>1</sup> This class embeds the asset files at compile time.</p>
							<p><sup>2</sup> This class loads the asset files at runtime.</p>
							<p>You only need to use one of these classes, depending on the way you want the assets to be loaded.</p>
							<p>Alternatively, you can copy <code><?= $themeName ?>MobileTheme.swc</code> file from the <code>swc</code> folder and add it to your project as a library. This SWC file has all the necessary classes and assets included.</p>

							<h3>Theme with icons</h3>
							<p>If you wish to use the theme with additional icons, you will need to copy the following files to your project folder:</p>

							<ul>
								<li>assets
									<ul>
										<li>fonts
											<ul>
												<li>Roboto-Bold.ttf</li>
												<li>Roboto-Regular.ttf</li>
											</ul>
										</li>
										<li>images
											<ul>
												<li>material_<?= $themeSlug ?>_mobile_icons.png</li>
											</ul>
										</li>
										<li>xml
											<ul>
												<li>material_<?= $themeSlug ?>_mobile_icons.xml</li>
											</ul>
										</li>
									</ul>
								</li>
								<li>src
									<ul>
										<li>Base<?= $themeName ?>MobileTheme.as</li>
										<li><?= $themeName ?>MobileThemeIcons.as</li>
										<li><?= $themeName ?>MobileThemeWithIcons.as <sup>3</sup>
											<p style="margin: 5px 0;">or</p>
										</li>
										<li><?= $themeName ?>MobileThemeWithAssetManagerAndIcons.as <sup>4</sup></li>
									</ul>
								</li>
							</ul>
							<p><sup>3</sup> This class embeds the asset files at compile time.</p>
							<p><sup>4</sup> This class loads the asset files at runtime.</p>
							<p>You only need to use one of these classes, depending on the way you want the assets to be loaded.</p>
							<p>Alternatively, you can copy <code><?= $themeName ?>MobileThemeWithIcons.swc</code> file from the <code>swc</code> folder and add it to your project as a library. This SWC file has all the necessary classes and assets included.</p>

							<h2 id="using-theme">Using the theme</h2>
							<p>After you copied over the required files to your project, you can jump into your favorite IDE and start coding. Once your root <code>DisplayObject</code> is created by Starling you may proceed with the theme's initialization.</p>

							<h3>Initializing the theme with embedded assets</h3>
							<p>The theme's classes which embed the assets are a bit easier to use as they simply require to be instantiated without any additional code.</p>
							<pre>
/* Theme without icons */
new <?= $themeName ?>MobileTheme();

/* Or theme with icons*/
new <?= $themeName ?>MobileThemeWithIcons();

// You can start creating your Feathers UI immediately</pre>

							<h3>Initializing the theme with loaded assets</h3>
							<p>If you wish to load the assets at runtime, you will need to wait for the loading to be completed before you start creating Feathers components, otherwise some of the components may not be skinned properly.</p>
							<pre>
/* Theme without icons */
new <?= $themeName ?>MobileThemeWithAssetManager().addEventListener( starling.events.Event.COMPLETE, onThemeAssetsReady );

/* Or theme with icons */
new <?= $themeName ?>MobileThemeWithAssetManagerAndIcons().addEventListener( starling.events.Event.COMPLETE, onThemeAssetsReady );

function onThemeAssetsReady( event:starling.events.Event ):void {
     event.currentTarget.removeEventListeners();
     // From now on you can start creating your Feathers UI
}</pre>

							<h2 id="theme-icons">Using the theme's icons</h2>
							<p>If you are using a theme's class that includes icons then you can access the icons using <code><?= $themeName ?>MobileThemeIcons</code> class. This class holds references to Starling's <code>Texture</code> – these instances represent the icons.</p>
							<p>For example, to add an icon to a <code>Button</code> you need to create an <code>Image</code> from the selected texture like this:</p>
							<pre>
const button:Button = new Button();
button.label = "Shop";
button.defaultIcon = new Image( <?= $themeName ?>MobileThemeIcons.shopTexture );
addChild( button );</pre>

							<p>In some cases, you may use the texture directly without explicitly creating an <code>Image</code>. For example, if you were to create a Feathers <code>List</code> object, you could specify the item's renderer <code>iconSourceField</code> to point to the texture, like this:</p>

							<pre>
const list:List = new List();
list.dataProvider = new ListCollection(
[
    { label: "Check", icon: <?= $themeName ?>MobileThemeIcons.checkCircleTexture },
]);
list.itemRendererFactory = function():IListItemRenderer {
	const item:DefaultListItemRenderer = new DefaultListItemRenderer();
	item.labelField = "label";
	item.iconSourceField = "icon"; // Reference the Texture
	return item;
};
addChild( list );</pre>
							<h2 id="theme-styles">Using the theme's styles</h2>
							<p>Apart from some of the default Feathers styles like <code>Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON</code>, you can use additional styles defined by the class <code>Base<?= $themeName ?>MobileTheme.as</code>. See the table below for a complete reference.</p>

							<table class="styles-table">
								<tr>
									<th>Style name</th>
									<th>Target component</th>
									<th>Description</th>
								</tr>
								<tr>
									<td><code>THEME_STYLE_NAME_BUTTON_ACCENT</code></td>
									<td><code>Button</code></td>
									<td>Applies accent-colored skin to a Button</td>
								</tr>
								<tr>
									<td><code>THEME_STYLE_NAME_BUTTON_ACCENT_QUIET</code></td>
									<td><code>Button</code></td>
									<td>Applies accent-colored quiet skin to a Button</td>
								</tr>
								<tr>
									<td><code>THEME_STYLE_NAME_BUTTON_HEADER_QUIET</code></td>
									<td><code>Button</code></td>
									<td>Applies quiet skin to a Button that displays label and is used in a Header</td>
								</tr>
								<tr>
									<td><code>THEME_STYLE_NAME_BUTTON_HEADER_QUIET_ICON_ONLY</code></td>
									<td><code>Button</code></td>
									<td>Applies quiet skin to a Button that displays icon only and is used in a Header</td>
								</tr>
								<tr>
									<td><code>THEME_STYLE_NAME_CALL_TO_ACTION_BUTTON_ACCENT</code></td>
									<td><code>Button</code></td>
									<td>Applies accent-colored rounded skin to a Button that displays icon</td>
								</tr>
								<tr>
									<td><code>THEME_STYLE_NAME_PANEL_WITHOUT_PADDING</code></td>
									<td><code>Panel</code>, <code>PanelScreen</code></td>
									<td>Removes left and right padding from a Panel</td>
								</tr>
								<tr>
									<td><code>THEME_STYLE_NAME_HEADER_WITH_SHADOW</code></td>
									<td><code>PanelScreen</code></td>
									<td>Adds shadow to PanelScreen's Header. If used together with <code>THEME_STYLE_NAME_PANEL_WITHOUT_PADDING</code> then this shadow style must be added first.</td>
								</tr>
								<tr>
									<td><code>THEME_STYLE_NAME_TAB_BAR_SHADOW_BOTTOM</code></td>
									<td><code>TabBar</code></td>
									<td>Vertically inverts the TabBar's skin, making the shadow appear at the bottom.</td>
								</tr>
								<tr>
									<td><code>THEME_STYLE_NAME_TAB_BAR_WITH_ICONS</code></td>
									<td><code>TabBar</code></td>
									<td>Adjusts the TabBar's height so that each tab can display an icon. If used together with <code>THEME_STYLE_NAME_TAB_BAR_SHADOW_BOTTOM</code> then this icons style must be added first.</td>
								</tr>
								<tr>
									<td><code>THEME_STYLE_NAME_TAB_NAVIGATOR_WITH_ICONS</code></td>
									<td><code>TabNavigator</code></td>
									<td>Adjusts height of TabNavigator's internal TabBar component so that each tab can display an icon.</td>
								</tr>
								<tr>
									<td><code>THEME_STYLE_NAME_TAB_NAVIGATOR_SHADOW_BOTTOM</code></td>
									<td><code>TabNavigator</code></td>
									<td>Vertically inverts the internal TabBar's skin, making the shadow appear at the bottom.</td>
								</tr>
							</table>

							<h2 id="faq">FAQ</h2>
							<h3>The components are not masked when showing radial effects.</h3>
							<p>In order for the masks to be working correctly you need to set the value of <code>&lt;depthAndStencil&gt;</code> element to <code>true</code> in your AIR application descriptor XML.</p>

							<h3>When trying to build a project with the theme error message 'Unable to build font Roboto' appears.</h3>
							<p>This issue may happen on Windows for some reason, using this <a href="../Roboto-Bold.zip">repacked Roboto font</a> should fix this issue. Thanks to Rui Cruz for the fix.</p>

						</div>
					</article>

				</div>
				<!-- End Blog Item -->

				<!-- <header class="text-center">
					<h3 class="post-meta">Updated Oct 28, 2015</h3>
				</header> -->

			</div>

		</section>
		<!-- End Blog -->

		<?php endif; ?>

	</main>
	<!-- End Main -->


	<!-- Footer -->
	<footer class="footer footer-light">

			<!-- Footer Container -->
			<div class="container">

				<!-- Footer Logo -->
				<div class="footer-logo">
					<a href="https://marpies.com"><img src="../images/logo/logo-footer.png" alt=""></a>
				</div>
				<!-- End Footer Logo -->

				<!-- Footer Social Links -->
				<div class="footer-social">
					<ul class="social-icons">
						<li><a href="https://twitter.com/marpies" class="hvr-rectangle-out hvr-twitter"><i class="fa fa-twitter"></i></a></li>
						
					</ul>
				</div>
				<!-- End Footer Social Links -->
				
				<!-- Copyright -->
				<div class="footer-copy">
					Created by Marcel Piestansky.
				</div>
				<!-- End Copyright -->

			</div>
			<!-- End Footer Container -->

		</footer>
	<!-- End Footer -->


	<script>
		(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
			(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
			m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
		})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

		ga('create', 'UA-63196902-2', 'auto');
		ga('send', 'pageview');
	</script>
	<!-- Scripts -->
	<script src="../scripts/retina.min.js"></script>
	<script src="../scripts/jquery.min.js"></script>
	<script src="../scripts/owl.carousel.min.js"></script>
	
	<script src="../scripts/bootstrap.min.js"></script>
	<script src="../scripts/jquery.nicescroll.min.js"></script>
	<script src="../scripts/imagesloaded.pkgd.min.js"></script>
	<script src="../scripts/koel.js"></script>
	<!-- End Scripts -->
</body>

</html>