-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
77 lines (76 loc) · 2.71 KB
/
index.php
File metadata and controls
77 lines (76 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
// Get the page that the user is looking for. I know, big long conditional chain. BUT it works
if(isset($_GET["page"])){
if(in_array($_GET["page"], ["home", "tutorial_select", "reference", "tools", "not_found", "about"])){
$page = $_GET["page"].".php";
}
else if($_GET["page"] == "tutorial"){
if(isset($_GET["tutorial"])){
if(in_array($_GET["tutorial"], ["intro", "parts", "circuits", "breadboards", "setup", "blink", "variables","functions", "extraforexperts", "blinkled", "knightrider", "input", "ifelse"])){
$page = "tutorialsecs/".$_GET["tutorial"].".php";
}
else{
header("Location: index.php?page=tutorial_select");
}
}
else {
header("Location: index.php?page=tutorial_select");
}
}
else {
header("Location: index.php?page=not_found");
}
}
else {
header("Location: index.php?page=home");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Learn Arduino</title>
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Julius+Sans+One" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="icon" type="image/png" href="img/logo/favicon.png">
</head>
<body>
<nav id="header">
<div id="logo">
<a href="index.php?page=home"><img src="img/logo/logo.png" alt="Arduino Logo" id="logoimg"/></a>
</div>
<div id="hamburger">
<div id="bar-cont">
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</div>
<ul id="menu">
<li class="menu-item"><a href="index.php?page=home">Home</a></li>
<li class="menu-item"><a href="index.php?page=tutorial_select">Tutorial</a></li>
<li class="menu-item"><a href="index.php?page=reference">Reference</a></li>
<li class="menu-item"><a href="index.php?page=tools">Tools</a></li>
<li class="menu-item"><a href="index.php?page=about">About</a></li>
</ul>
</nav>
<div id="main-wrapper">
<?php
// Include the page that the user is looking for
include("pages/$page");
?>
</div>
<div id="toTop"></div>
<!-- Include all the neccessary scripts for the page -->
<!-- jQuery because getting elements becomes a million times easier. Also, has a lot of useful event listeners that JS doesn't -->
<script type="text/javascript" src="js/jquery-3.1.0.min.js"></script>
<!-- Modernizr for SVG images -->
<script type="text/javascript" src="js/modernizr.js"></script>
<!-- Hammer.js for swipe on the slider -->
<script type="text/javascript" src="http://hammerjs.github.io/dist/hammer.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</body>
</html>