First commit.

This commit is contained in:
gamemastr 2015-08-26 16:56:14 -07:00
commit 455bf2815f
5 changed files with 183 additions and 0 deletions

0
index.html Normal file
View file

49
index.php Normal file
View file

@ -0,0 +1,49 @@
<!DOCTYPE html>
<?php
// Setting variables
$_site = "Not Done My Website";
$_page = "Home";
$_title = $_site . ' | ' . $_page;
?>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?php echo $_title ?></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styling/css.css">
</head>
<body>
<div id="header">
<h1><?php echo $_site ?></h1>
<h2>Quickly generate temporary webpages</h2>
</div>
<div class="creation">
<h3>Variables for web page</h3>
<form action="make.php" method="POST">
<div id="var">Site name: <input type="text" name="sname" placeholder="Not Done My Website">
</div>
<div id="var">Site URL: <input type="text" name="surl" placeholder="notdonemy.website">
</div>
<div id="var">Developer/Designer: <input type="text" name="devname" placeholder="John D. Oh">
</div>
<div id="var">Primary Colour: <input type="color" name="pcolour" placeholder="#333333">
</div>
<div id="var">Secondary Colour: <input type="color" name="scolour" placeholder="#eeeeee">
</div>
<button type="submit" value="Check">Generate</button>
</form>
</div>
</body>
</html>

38
make.php Normal file
View file

@ -0,0 +1,38 @@
<?php
$sname = $_POST['sname'];
$surl = $_POST['surl'];
$devname = $_POST['devname'];
$pcolour = $_POST['pcolour'];
$scolour = $_POST['scolour'];
$template = fopen("template/template.html", "r+");
$tempContents = fread($template, filesize("template/template.html"));
$keywords = array("rep_PCOLOUR", "rep_SCOLOUR", "rep_SNAME", "rep_URL", "rep_DEVNAME");
$replacement = array($pcolour, $scolour, $sname, $surl, $devname);
$contents = str_replace($keywords, $replacement, $tempContents);
fclose($template);
/*
echo "<?php ";
echo "$sname ";
echo "$surl ";
echo "$devname ";
echo "$pcolour ";
echo "$scolour ";
echo "?> ";
*/
echo $contents;
$indexfile = fopen("index.html", "w");
fwrite($indexfile, NULL);
fclose($indexfile);
header('Content-Type: text/plain');
header('Content-Disposition: attachment; filename=index.html');
readfile("index.html");
?>

49
styling/css.css Normal file
View file

@ -0,0 +1,49 @@
/* Main element styling */
*{
margin: 0;
padding: 0;
}
body{
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif
}
h1{
font-size: 3.5em;
}
/* Div Styling */
#header{
padding-top:1%;
padding-bottom: 10px;
background-color: lightskyblue;
text-align: center;
}
.creation{
padding-top: 30px;
text-align: center;
}
#var{
padding: 5px;
line-height: 30px;
}
/* Input Styling */
*:focus {
outline: 0;
}
form{
font-size: 125%;
}
input{
padding:3px;
border: none;
border-bottom: solid 3px deepskyblue;
transition: border 0.2s;
}
input:focus, input.focus {
border-bottom: solid 3px dodgerblue;
}
button{
padding: 10px;
border: none;
border-bottom: solid 3px deepskyblue;
}

47
template/template.html Normal file
View file

@ -0,0 +1,47 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>rep_SNAME</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=Roboto:400,700' rel='stylesheet' type='text/css'>
<style type="text/css">
body{
font-family: 'Roboto', sans-serif;
position: fixed;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #E9E9E9;
}
.header{
font-weight: 700;
padding: 10px;
text-align: center;
background-color: rep_PCOLOUR;
box-shadow:2px 2px 5px #888;
}
.content{
font-weight: 400;
padding: 6%;
text-align: center;
background-color: rep_SCOLOUR;
box-shadow:2px 2px 5px #888;
}
</style>
</head>
<body>
<div class="header">
<h1>rep_SNAME</h1>
</div>
<br />
<div class="content">
<p>rep_URL is being worked on by rep_DEVNAME!</p>
</div>
</body>
</html>