Initial website

This commit is contained in:
Sean Joseph 2017-10-25 12:43:25 -04:00
commit c95ced87b5
5 changed files with 259 additions and 0 deletions

20
index.php Normal file
View File

@ -0,0 +1,20 @@
<?php
require_once 'lib/View.php';
$view = new View();
$view->setTitle("CSE 435 Group 6")
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php
echo $view->head();
?>
</head>
<body>
<?php
echo $view->header();
echo $view->page();
echo $view->footer();
?>
</body>
</html>

86
lib/Homepage/View.php Normal file
View File

@ -0,0 +1,86 @@
<?php
/**
* Created by PhpStorm.
* User: sean
* Date: 5/26/17
* Time: 8:57 PM
*/
class View
{
public function __construct() {
$this->addNav("Home", "./");
$this->addNav("About Me", "aboutme.php");
$this->addNav("Experience", "experience.php");
$this->addNav("Game", "game.php");
}
public function head(){
$html = <<<HTML
<meta charset="utf-8">
<title>$this->title</title>
<link href="style/default.css" rel="stylesheet" type="text/css">
HTML;
return $html;
}
public function header(){
$html = <<<HTML
<header>
<h1>$this->title</h1>
<nav><p class="nav-bar">|
HTML;
foreach($this->links as $link){
$name = $link['name'];
$to = $link['link'];
$html .= " <a href='$to'>$name</a> |";
}
$html .= <<<HTML
</p></nav>
</header>
HTML;
return $html;
}
public function page(){
$html = <<<HTML
<div class="card">
<p>CONTENT COMING SOON!</p>
</div>
HTML;
return $html;
}
public function addNav($name, $link){
$this->links[] = array("name" => $name, "link" => $link);
}
public function footer(){
$html = <<<HTML
<footer>
</footer>
HTML;
return $html;
}
public function setTitle($title){
$this->title = $title;
}
private $links = array();
private $title = "Not Set!";
}

93
lib/View.php Normal file
View File

@ -0,0 +1,93 @@
<?php
/**
* Created by PhpStorm.
* User: sean
* Date: 5/26/17
* Time: 8:57 PM
*/
class View
{
public function __construct() {
$this->addNav("Home", "./");
$this->addNav("Progress", "./");
$this->addNav("Meet The Team", "./");
$this->addNav("Course Site", "https://cse.msu.edu/~cse435/");
}
public function head(){
$html = <<<HTML
<meta charset="utf-8">
<title>$this->title</title>
<link href="./style/default.css" rel="stylesheet" type="text/css">
HTML;
return $html;
}
public function header(){
$html = <<<HTML
<header>
<h1>$this->title</h1>
<nav><p class="nav-bar">|
HTML;
foreach($this->links as $link){
$name = $link['name'];
$to = $link['link'];
$html .= " <a href='$to'>$name</a> |";
}
$html .= <<<HTML
</p></nav>
</header>
HTML;
return $html;
}
public function page(){
$html = <<<HTML
<div class="card">
<h2>Roster:</h2>
<ul>
<li>Project Manager - James</li>
<li>Artifacts Manager - Sean</li>
<li>Project Facilitator- Stephen</li>
<li>Safety/Security Engineer - Logan</li>
<li>Domain Expert/Customer Liaison - Colin</li>
</ul>
</div>
HTML;
return $html;
}
public function addNav($name, $link){
$this->links[] = array("name" => $name, "link" => $link);
}
public function footer(){
$html = <<<HTML
<footer>
</footer>
HTML;
return $html;
}
public function setTitle($title){
$this->title = $title;
}
private $links = array();
private $title = "Not Set!";
}

55
style/default.css Normal file
View File

@ -0,0 +1,55 @@
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video
{
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
body {
background : lightgrey;
}
header {
padding-top: 1em;
background : white;
text-align: center;
line-height: 3em;
}
header h1 {
font-size : 2em;
}
nav a{
color : darkgray;
font-style: normal;
text-decoration : none;
background : inherit;
}
nav a:hover{
color : black;
background: lightgrey;
font-size:1.1em;
}
div.card{
border:thick black;
display:inline-block;
}

5
version.php Normal file
View File

@ -0,0 +1,5 @@
<?php
echo "<pre>";
echo phpversion();
echo "</pre>";