Robert Marshall пре 10 година
родитељ
комит
b063755917
6 измењених фајлова са 54 додато и 2 уклоњено
  1. 10 0
      images/menu.svg
  2. 3 2
      index.php
  3. 18 0
      javascript.js
  4. 5 0
      style-med.css
  5. 16 0
      style.css
  6. 2 0
      template.php

+ 10 - 0
images/menu.svg

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
+<path fill="none" d="M0,0h24v24H0V0z"/>
+<rect x="3" y="16" fill="#455A64" width="18" height="2"/>
+<rect x="3" y="11" fill="#546E7A" width="18" height="2"/>
+<rect x="3" y="6" fill="#455A64" width="18" height="2"/>
+</svg>

+ 3 - 2
index.php

@@ -4,9 +4,10 @@ $url="";
 if (!isset($_GET['__url'])){
 	if (!isset($_SERVER['PATH_INFO']))
 		$_SERVER['PATH_INFO']="/";
+	$url=$_SERVER['PATH_INFO'];
 } else {
-	$url=filter_input(INPUT_GET, $_GET['__url']);
+	$url=filter_input(INPUT_GET, '__url', FILTER_SANITIZE_URL);
 }
-$url=ltrim($_SERVER['PATH_INFO'],'/');
+$url=ltrim($url,'/');
 $app=new Application($url);
 echo $app->GetOutput();

+ 18 - 0
javascript.js

@@ -56,5 +56,23 @@ $(function(){
 		$("#cookiePopup").fadeOut();
 		CreateCookie("cookiePopupConfirmed",true,0);
 	});
+	
+	$("#menu-button").click(function(e){
+		$("#menu").show();
+		$("body>.backdrop").show();
+	});
+	
+	$("body>.backdrop").click(function(e){
+		$("#menu").hide();
+		$("body>.backdrop").hide();
+	});
 });
 
+
+$(window).resize(function(e){
+	if (window.innerWidth>1023){
+		$("#menu").attr("style","");
+		$("#menu-button").attr("style","");
+		$("body>.backdrop").hide();
+	}
+});

+ 5 - 0
style-med.css

@@ -4,4 +4,9 @@
 
 #main, #main-header{
 	padding-left:0;
+}
+
+#menu-button{
+	cursor: pointer;
+	display: inline-block;
 }

+ 16 - 0
style.css

@@ -76,6 +76,7 @@ img{
 	position:fixed;
 	height:100%;
 	box-shadow: 7px 0px 4px 0px rgba(0,0,0,0.15);
+	z-index: 400;
 }
 
 #menu>div{
@@ -87,6 +88,10 @@ img{
 	padding-left:10px;
 }
 
+#menu-button{
+	display:none;
+}
+
 #nav-container{
 	position:fixed;
 	top:64px;
@@ -231,4 +236,15 @@ img{
 	display:none;
 	padding-right:10px;
 	float:right;
+}
+
+.backdrop{
+	background: rgba(0,0,0,0.5);
+	width: 100%;
+	height:100%;
+	position:fixed;
+	top:0;
+	left:0;
+	z-index:100;
+	display:none;
 }

+ 2 - 0
template.php

@@ -36,6 +36,7 @@ function FormatURI(URI $uri, $base=""){
 	<body>
 		<div id="main-header">
 			<div class="header">
+				<img src="/images/menu.svg" id="menu-button" />
 				<h2>
 					<span>{@Title}</span>
 					<?php
@@ -98,5 +99,6 @@ function FormatURI(URI $uri, $base=""){
 				</div>
 			</div>
 		<?php }?>
+		<div class="backdrop"></div>
 	</body>
 </html>