Created
May 24, 2013 12:49
-
-
Save mermshaus/5643279 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} -s [OR] | |
RewriteCond %{REQUEST_FILENAME} -l [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^.*$ - [NC,L] | |
RewriteRule ^.*$ index.php [NC,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace myproject; | |
use org\ermshaus\MenuGenerator; | |
error_reporting(-1); | |
ini_set('display_errors', 1); | |
require_once __DIR__ . '/org.ermshaus.MenuGenerator.bundle.php'; | |
$menuData = <<<EOT | |
# Lines starting with a hash sign (#) will be ignored | |
Home ; / | |
About ; /about | |
The Company ; /about/company | |
Germany ; /germany | |
Europe ; /europe | |
ROW ; /about/company/row | |
Team ; /about/team | |
Careers ; /about/careers | |
Services ; /services | |
What we do ; /services/what-we-do | |
Our process ; /services/our-process | |
Testimonials ; /services/testimonials | |
Portfolio ; /portfolio | |
Web Design ; /portfolio/webdesign | |
Development ; /portfolio/development | |
Identity ; /portfolio/identity | |
SEO & Internet Marketing ; /portfolio/seo-marketing | |
Print Design ; /portfolio/print-design | |
Contact ; /contact | |
EOT; | |
$menuGenerator = new MenuGenerator(); | |
$url = 'data://text/plain;base64,' . base64_encode($menuData); | |
$stream = fopen($url, 'rb'); | |
$menuGenerator->readFlatFile($stream); | |
fclose($stream); | |
$menuHtml = $menuGenerator->renderMenu(); | |
$rootUrl = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/'); | |
header('Content-Type: text/html; charset=UTF-8'); | |
?><!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>title</title> | |
<link href="<?=$rootUrl?>/line25.css" media="screen" rel="stylesheet" type="text/css"> | |
</head> | |
<body> | |
<nav> | |
<?=$menuHtml?> | |
</nav> | |
<p style="text-align: center;"> | |
Demo CSS taken from | |
<a href="http://line25.com/tutorials/how-to-create-a-pure-css-dropdown-menu">line25.com</a> | |
</p> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
CSS code taken from: | |
http://line25.com/tutorials/how-to-create-a-pure-css-dropdown-menu | |
*/ | |
body, div, h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dt, dd, img, form, fieldset, input, textarea, blockquote { | |
margin: 0; padding: 0; border: 0; | |
} | |
body { | |
background: #909eab url(bg.png); | |
font-family: Helvetica, sans-serif; font-size: 18px; line-height: 24px; | |
} | |
nav { | |
margin: 100px auto; | |
text-align: center; | |
} | |
nav ul ul { | |
display: none; | |
} | |
nav ul li:hover > ul { | |
display: block; | |
} | |
nav ul { | |
background: #efefef; | |
background: linear-gradient(top, #efefef 0%, #bbbbbb 100%); | |
background: -moz-linear-gradient(top, #efefef 0%, #bbbbbb 100%); | |
background: -webkit-linear-gradient(top, #efefef 0%,#bbbbbb 100%); | |
box-shadow: 0px 0px 9px rgba(0,0,0,0.15); | |
padding: 0 20px; | |
border-radius: 10px; | |
list-style: none; | |
position: relative; | |
display: inline-table; | |
} | |
nav ul:after { | |
content: ""; clear: both; display: block; | |
} | |
nav ul li { | |
float: left; | |
} | |
nav ul li:hover { | |
background: #4b545f; | |
background: linear-gradient(top, #4f5964 0%, #5f6975 40%); | |
background: -moz-linear-gradient(top, #4f5964 0%, #5f6975 40%); | |
background: -webkit-linear-gradient(top, #4f5964 0%,#5f6975 40%); | |
} | |
nav ul li:hover a { | |
color: #fff; | |
} | |
nav ul li a { | |
display: block; padding: 25px 40px; | |
color: #757575; text-decoration: none; | |
} | |
nav ul ul { | |
background: #5f6975; border-radius: 0px; padding: 0; | |
position: absolute; top: 100%; | |
} | |
nav ul ul li { | |
float: none; | |
border-top: 1px solid #6b727c; | |
border-bottom: 1px solid #575f6a; position: relative; | |
} | |
nav ul ul li a { | |
padding: 15px 40px; | |
color: #fff; | |
} | |
nav ul ul li a:hover { | |
background: #4b545f; | |
} | |
nav ul ul ul { | |
position: absolute; left: 100%; top:0; | |
} | |
/* mermshaus, additions */ | |
.onpath > a { background: rgba(255, 0, 0, 0.1); } | |
.selected > a { font-weight: bold; text-decoration: underline; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment