Skip to content

Commit

Permalink
Mobile menu
Browse files Browse the repository at this point in the history
Multilevel menu  for mobile in top-bar.
This is not Foundation navigation. It is an independent development.
  • Loading branch information
nandroid committed May 12, 2013
1 parent 48bd3cb commit ffb8f28
Show file tree
Hide file tree
Showing 16 changed files with 300 additions and 89 deletions.
8 changes: 7 additions & 1 deletion app/magento-foundation/default/layout/catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Default layout, loads most of the pages
</block>
</reference>
<reference name="right">
<block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
<block type="catalog/product_compare_sidebar" after="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
<block type="core/template" name="right.permanent.callout" template="callouts/right_col.phtml">
<action method="setImgSrc"><src>images/media/col_right_callout.jpg</src></action>
<action method="setImgAlt" translate="alt" module="catalog"><alt>Keep your eyes open for our special Back to School items and save A LOT!</alt></action>
Expand All @@ -63,6 +63,12 @@ Default layout, loads most of the pages
<action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map"><label>Site Map</label><url helper="catalog/map/getCategoryUrl" /><title>Site Map</title></action>
</reference>
<block type="catalog/product_price_template" name="catalog_product_price_template" />

<!-- Menu mobile -->
<reference name="header">
<block type="catalog/navigation" name="catalog_footernav" template="catalog/navigation/mobile-menu.phtml" before="-" />
</reference>

</default>


Expand Down
32 changes: 27 additions & 5 deletions app/magento-foundation/default/layout/local.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
* @package waterlee
* CC BY 3.0 2012 Željko Prša. (http://www.zeljkoprsa.com)
* modified by Alexander Kaiser (@alexksr)
* Attribute this work: <div xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/" about="http://waterlee.zeljkoprsa.com/1tb-7200rpm"><span property="dct:title">WaterleeBoilerplate</span> (<a rel="cc:attributionURL" property="cc:attributionName" href="http://zeljkoprsa.com">Želko Prša</a>) / <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a></div>
* @package base_default
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
-->

<layout>
Expand All @@ -27,8 +45,12 @@
<action method="addItem"><type>skin_js</type><name>js/foundation/jquery.foundation.tabs.js</name><params/></action>
<action method="addItem"><type>skin_js</type><name>js/foundation/jquery.foundation.tooltips.js</name><params/></action>
<action method="addItem"><type>skin_js</type><name>js/foundation/jquery.placeholder.js</name><params/></action>
<action method="addItem"><type>skin_js</type><name>js/jquery.isotope.min.js</name><params/></action>
<action method="addItem"><type>skin_js</type><name>js/foundation/app.js</name><params/></action>

<action method="addItem"><type>skin_js</type><name>js/jquery.isotope.min.js</name><params/></action>
<action method="addItem"><type>skin_js</type><name>js/jquery/mobile-menu.js</name><params/></action>

<action method="addCss"><stylesheet>css/mobile-menu.css</stylesheet></action>
</reference>
</default>
</layout>
2 changes: 2 additions & 0 deletions app/magento-foundation/default/layout/page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ Default layout, loads most of the pages
<label>Page Footer</label>
<action method="setElementClass"><value>bottom-container</value></action>
</block>

<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
<block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
</block>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

<div id="mobile-menu">

<ul>
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php echo $this->drawItem($_category) ?>
<?php endforeach ?>
</ul>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@
</ul>
</div>
<?php endif ?>

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</div>
</div>
<div class="row">
<div class="six columns centered text-center">
<div class="twelve columns centered text-center">
<p class="bugs">
<?php echo $this->__('Help Us to Keep Magento Healthy') ?> - <a href="http://www.magentocommerce.com/bug-tracking" onclick="this.target='_blank'"><strong><?php echo $this->__('Report All Bugs') ?></strong></a> <?php echo $this->__('(ver. %s)', Mage::getVersion()) ?>
</p>
Expand Down
34 changes: 20 additions & 14 deletions app/magento-foundation/default/template/page/html/header.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,28 @@
?>
<div class="header-container">
<header class="row header">
<div class="logo-box">
<h1 class="logo">
<a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>">
<img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
</a>
</h1>

<h1 class="logo">
<a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>">
<img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
</a>
</h1>

<div class="quick-access">
<?php echo $this->getChildHtml('topSearch') ?>
<?php echo $this->getChildHtml('topLinks') ?>
</div>

<nav class="top-bar">
<ul>
<li class="toggle-topbar">
<a href="#"></a>
<a class="menu-button" href="#" alt="Menu">
<svg width="30" height="20">
<path d="M0,2 20,2" stroke="#fff" stroke-width="2"/>
<path d="M0,10 20,10" stroke="#fff" stroke-width="2"/>
<path d="M0,18 20,18" stroke="#fff" stroke-width="2"/>
</svg>
</a>
</li>
<li class="mini-cart">

Expand Down Expand Up @@ -69,16 +80,11 @@
</ul>

<section>
<div class="quick-access">
<?php echo $this->getChildHtml('topSearch') ?>
<?php echo $this->getChildHtml('store_language') ?>
</div>
<?php echo $this->getChildHtml('catalog_footernav') ?>

<?php echo $this->getChildHtml('topContainer'); ?>
<?php echo $this->getChildHtml('topLinks') ?>
</section>
</nav>

<?php echo $this->getChildHtml('topMenu') ?>

</header>
</div>
34 changes: 16 additions & 18 deletions app/magento-foundation/default/template/page/template/links.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,20 @@

<?php $_links = $this->getLinks(); ?>
<?php if(count($_links)>0): ?>
<div class="row">
<div class="twelve columns">
<ul class="links"<?php if($this->getName()): ?> id="<?php echo $this->getName() ?>"<?php endif;?>>
<?php foreach($_links as $_link): ?>
<?php if ($_link instanceof Mage_Core_Block_Abstract):?>
<?php echo $_link->toHtml() ?>
<?php else: ?>
<li<?php if($_link->getIsFirst()||$_link->getIsLast()): ?> class="<?php if($_link->getIsFirst()): ?>first<?php endif; ?><?php if($_link->getIsLast()): ?> last<?php endif; ?>"<?php endif; ?> <?php echo $_link->getLiParams() ?>>
<?php echo $_link->getBeforeText() ?>
<a class="button small" href="<?php echo $_link->getUrl() ?>" title="<?php echo $_link->getTitle() ?>" <?php echo $_link->getAParams() ?>><?php echo $_link->getLabel() ?>
</a>
<?php echo $_link->getAfterText() ?>
</li>
<?php endif;?>
<?php endforeach; ?>
</ul>
</div>
</div>

<ul class="links"<?php if($this->getName()): ?> id="<?php echo $this->getName() ?>"<?php endif;?>>
<?php foreach($_links as $_link): ?>
<?php if ($_link instanceof Mage_Core_Block_Abstract):?>
<?php echo $_link->toHtml() ?>
<?php else: ?>
<li<?php if($_link->getIsFirst()||$_link->getIsLast()): ?> class="<?php if($_link->getIsFirst()): ?>first<?php endif; ?><?php if($_link->getIsLast()): ?> last<?php endif; ?>"<?php endif; ?> <?php echo $_link->getLiParams() ?>>
<?php echo $_link->getBeforeText() ?>
<a class="button small" href="<?php echo $_link->getUrl() ?>" title="<?php echo $_link->getTitle() ?>" <?php echo $_link->getAParams() ?>><?php echo $_link->getLabel() ?>
</a>
<?php echo $_link->getAfterText() ?>
</li>
<?php endif;?>
<?php endforeach; ?>
</ul>

<?php endif; ?>
Binary file modified skin/magento-foundation/default/Thumbs.db
Binary file not shown.
127 changes: 127 additions & 0 deletions skin/magento-foundation/default/css/mobile-menu.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@

#mobile-menu {
display:none;
margin: 0;
}

#mobile-menu h2 {
margin:0;
padding: 15px;
background: #666;
color: #fff;
text-transform:uppercase;
}

#mobile-menu ul {
margin:0;
display: block;

position: relative;

}

#mobile-menu #nav li ul.shown-sub { left:0; z-index:999; border: 1px solid #0f0; }

#mobile-menu li {
font-size: 18px;
border-bottom: 1px solid #666;
width: 100%;
background:#777;
}

.header-container .top-bar #mobile-menu ul > li a:not(.button) {
display: block !important;
right: 15px;
line-height: 24px;
}


#mobile-menu li a{
color:#eee;
padding: 10px 15px 10px 20px;
width: 100%;
font-family: "OpenSans","Helvetica Neue","Helvetica",Arial,Verdana,sans-serif !important;
}


.top-bar #mobile-menu ul > li a:not(.button) {
font-size: 18px;
font-weight: normal;
}

#mobile-menu li a:hover { color:#fff; }

#mobile-menu li a span{
float:left;
padding: 0 0 0 15px;
}

#mobile-menu li:hover { background:#888; }
#mobile-menu li li{ background: #999; }
#mobile-menu li li:hover { background: #aaa; }
#mobile-menu li li li { background: #bbb; }
#mobile-menu li li li:hover { background: #ccc; }

#mobile-menu li.level1.last, #mobile-menu li.level2.last { border-bottom:0; }
#mobile-menu li a { border-right: 0!important; }

#mobile-menu li a span{ padding-left: 0px; }
#mobile-menu li li a span{ padding-left: 15px; }
#mobile-menu li li li a span{ padding-left: 30px; }

#mobile-menu li a{ background:url(../images/white-arrows.png) no-repeat; display:block; }

#mobile-menu li a{ background-position: 98% -105px; }
#mobile-menu li.accordion a { background-position: 98% -244px; }
#mobile-menu li.accordion a.accordionExpanded { background-position: 98% -197px; }

#mobile-menu li.parent li a { background-position: 98% -105px; }

#mobile-menu li li.parent a { background-position: 98% -244px; }

#mobile-menu li.parent li.parent li a { background-position: 98% -108px; }

/************ MEDIA QUERIES ************/

.boton-menu-movil {
float:left;
margin:8px 0 0 8px;
display:none;
}

.boton-menu-movil a {
font-size:18px;
overflow:visible;
width:auto;
border:0;
padding:8px 16px 6px;
margin:0;
cursor:pointer;
color:#fff;
float:right;
text-shadow: 0 1px 1px #333;

border-radius:5px;
-webkit-border-radius:5px;
-moz-border-radius:5px;

background: #666;

text-decoration:none;
text-transform:uppercase;
}


@media only screen and (max-width: 800px) {

nav ul { display: none; }

.nav-container { display: none !important; }

#mobile-menu .nav-container { display: block !important; }

.boton-menu-movil { display:inline;}

#mobile-menu { display:block;}

}
Loading

0 comments on commit ffb8f28

Please sign in to comment.