Inital main site
authorRichard Whitehouse <github@richardwhiuk.com>
Sat, 29 Jan 2011 17:25:08 +0000 (17:25 +0000)
committerRichard Whitehouse <github@richardwhiuk.com>
Sat, 29 Jan 2011 17:25:08 +0000 (17:25 +0000)
20 files changed:
.htaccess [new file with mode: 0644]
index.php [new file with mode: 0644]
page.php [new file with mode: 0644]
page/about.php [new file with mode: 0644]
page/tickets.php [new file with mode: 0644]
template.php [new file with mode: 0644]
template/about.php [new file with mode: 0644]
template/index.php [new file with mode: 0644]
template/tickets.php [new file with mode: 0644]
theme/.htaccess [new file with mode: 0644]
theme/Carousel.ttf [new file with mode: 0644]
theme/Colour Swatch.png [new file with mode: 0644]
theme/King Arthur.png [new file with mode: 0644]
theme/Website Mock-up.jpg [new file with mode: 0644]
theme/background.png [new file with mode: 0644]
theme/hmb.css [new file with mode: 0644]
theme/hmb.js [new file with mode: 0644]
theme/left.png [new file with mode: 0644]
theme/logo.png [new file with mode: 0644]
theme/right.png [new file with mode: 0644]

diff --git a/.htaccess b/.htaccess
new file mode 100644 (file)
index 0000000..a67cbcf
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,5 @@
+AuthType Ucam-WebAuth
+Require user rjw201 jel55 famh2 bw300
+
+RewriteEngine on
+RewriteRule (.*) index.php?page=$1 [QSA,L]
diff --git a/index.php b/index.php
new file mode 100644 (file)
index 0000000..6d922a4
--- /dev/null
+++ b/index.php
@@ -0,0 +1,45 @@
+<?php
+
+require_once 'template.php';
+require_once 'page.php';
+
+require_once 'template/index.php';
+
+$pages = array();
+$templates = array();
+
+$files = array('about','tickets','food','ents','committee','sponsorship','charity','workers');
+
+foreach($files as $page){
+       if(is_file('page/' . $page . '.php') && is_file('template/' . $page . '.php')){
+               require_once ('page/' . $page . '.php');
+               require_once ('template/' . $page . '.php');
+               $class = 'Page_' . $page;
+               $pages[$page] =  new $class();
+
+               $class = 'Template_' . $page;
+               $templates[$page] = new $class();
+       }
+}
+
+foreach($pages as $name => $page){
+       $page->execute($templates[$name]);
+}
+
+if(isset($_GET['page']) && isset($templates[$_GET['page']])){
+       $current = $_GET['page'];
+} elseif(isset($templates['about'])){
+       $current = 'about';
+} elseif(count($templates) > 0) {
+       $current = array_shift(array_keys($templates));
+}
+
+$index = new Template_Index();
+
+$index->numbers = array_keys($templates);
+$index->keys = array_flip($index->numbers);
+$index->current = $current;
+$index->templates = $templates;
+
+$index->display();
+
diff --git a/page.php b/page.php
new file mode 100644 (file)
index 0000000..96afef7
--- /dev/null
+++ b/page.php
@@ -0,0 +1,10 @@
+<?php
+
+class Page {
+
+ public function execute($template){
+
+ }
+
+
+}
diff --git a/page/about.php b/page/about.php
new file mode 100644 (file)
index 0000000..12fe641
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+class Page_About extends Page {
+
+ public function execute($template){
+
+ }
+
+
+}
diff --git a/page/tickets.php b/page/tickets.php
new file mode 100644 (file)
index 0000000..66b4b3e
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+class Page_Tickets extends Page {
+
+ public function execute($template){
+
+ }
+
+
+}
diff --git a/template.php b/template.php
new file mode 100644 (file)
index 0000000..3ff5ca6
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+class Template {
+
+public function display(){
+
+}
+
+}
+
diff --git a/template/about.php b/template/about.php
new file mode 100644 (file)
index 0000000..1553170
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+
+class Template_About extends Template {
+
+
+
+}
diff --git a/template/index.php b/template/index.php
new file mode 100644 (file)
index 0000000..61c8ec8
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+
+class Template_Index extends Template {
+
+public function Display(){
+
+// A little setup
+
+?>
+<!DOCTYPE html>
+<html>
+<head>
+       <title>Homerton May Ball</title>
+       <link rel="stylesheet" href="theme/hmb.css">
+       <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
+       <script src="theme/hmb.js"></script>
+       <script>
+       hmb_setup(<?php echo $this->keys[$this->current]; ?>,<?php echo count($this->keys); ?>, {
+<?php 
+               foreach($this->keys as $name => $i){ 
+               
+                       if($i != 0){ echo ",\r\n"; }  
+                       
+                       echo "\t\t" . $name . ': ' . $i;
+               }
+               ?> 
+       });
+       </script>
+</head>
+<body>
+       <div id="wrapper">
+               <div id="logo">
+                       <a href="/"><img src="theme/logo.png"></a>
+               </div>
+               <div id="navbar">
+                       <ul>
+                               <li class="l"><a class="link_about" href="/about">About</a></li>
+                               <li class="l"><a class="link_tickets" href="/tickets">Tickets</a></li>
+                               <li class="l"><a class="link_food" href="/food">Food &amp; Drink</a></li>
+                               <li class="l"><a href="/ents">Ents</a></li>
+                               <li class="r"><a href="/workers">Workers</a></li>
+                               <li class="r"><a href="/committee">Committee</a></li>
+                               <li class="r"><a href="/sponsorship">Sponsorship</a></li>
+                               <li class="r"><a href="/charity">Charity</a></li>
+                       </ul>
+               </div>
+               <div id="main">
+                       <div class="arrow" id="arrow-l" <?php if(!($this->keys[$this->current] > 0)){ ?> style="display: none;" <?php } ?>>
+                               <a href="-1"><img src="theme/left.png"></a>
+                       </div>
+                       <ul id="panes" style="left: -<?php echo $this->keys[$this->current] * 80; ?>%;">
+                               <?php 
+                               if(count($this->templates) == 0){ 
+                               ?>
+                               <li class="pane pane-r">
+                                       &nbsp;
+                               </li>
+                               <?php 
+                               } else { 
+                                       foreach($this->templates as $name => $template){
+                               ?>
+                               <li class="pane pane-<?php echo ($this->keys[$name] % 2) == 0 ? 'r' : 'p'; ?>" style="left: <?php echo ($this->keys[$name] * 80) + 10; ?>%;" id="pane-<?php echo $name; ?>">
+                                       <div class="content">
+                                               <?php $template->display(); ?>
+                                       </div>
+                               </li>
+                               <?php
+                                       }
+                               }
+                               ?>
+                       </ul>
+                       <div class="arrow" id="arrow-r">
+                               <a href="<?php echo $this->numbers[$this->keys[$this->current] + 1]; ?>"><img src="theme/right.png"></a>
+                       </div>
+               </div>
+               <div id="footer">
+                       &copy; 2010 Homerton May Ball Committee. All rights reserved.
+               </div>
+       </div>
+</body>
+</html>
+<?php
+
+}
+
+}
+
diff --git a/template/tickets.php b/template/tickets.php
new file mode 100644 (file)
index 0000000..b57faa2
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+
+class Template_Tickets extends Template {
+
+
+
+}
diff --git a/theme/.htaccess b/theme/.htaccess
new file mode 100644 (file)
index 0000000..e406d25
--- /dev/null
@@ -0,0 +1 @@
+RewriteEngine off
diff --git a/theme/Carousel.ttf b/theme/Carousel.ttf
new file mode 100644 (file)
index 0000000..02807a8
Binary files /dev/null and b/theme/Carousel.ttf differ
diff --git a/theme/Colour Swatch.png b/theme/Colour Swatch.png
new file mode 100644 (file)
index 0000000..469b3db
Binary files /dev/null and b/theme/Colour Swatch.png differ
diff --git a/theme/King Arthur.png b/theme/King Arthur.png
new file mode 100644 (file)
index 0000000..15f514d
Binary files /dev/null and b/theme/King Arthur.png differ
diff --git a/theme/Website Mock-up.jpg b/theme/Website Mock-up.jpg
new file mode 100644 (file)
index 0000000..b9b2178
Binary files /dev/null and b/theme/Website Mock-up.jpg differ
diff --git a/theme/background.png b/theme/background.png
new file mode 100644 (file)
index 0000000..bcd6323
Binary files /dev/null and b/theme/background.png differ
diff --git a/theme/hmb.css b/theme/hmb.css
new file mode 100644 (file)
index 0000000..819fc42
--- /dev/null
@@ -0,0 +1,172 @@
+/** Homerton May Ball CSS File - Richard Whitehouse **/
+
+body {
+       margin: 0;
+       padding: 0;
+       background-image: url(background.png);
+       background-position: center center;
+       position: absolute;
+       width: 100%;
+       height: 100%;
+}
+
+div#wrapper {
+       overflow: hidden;
+       position: absolute;
+       top: 0;
+       bottom: 20px;
+       left: 0;
+       right: 0;
+}
+
+div#logo {
+       z-index: 20;
+       position: absolute;
+       left: 50%;
+       width: 100px;
+       top: 60px;
+       height: 40px;
+       margin-top: -64px;
+       margin-left: -60px;
+}
+
+div#logo img {
+       z-index: 30;
+       width: 200px;
+}
+
+div#navbar {
+       background: black;
+       width: 70%;
+       height: 40px;
+       position: absolute;
+       left: 15%;
+       right: 15%;
+       top: 104px;
+       z-index: 10;
+}
+
+div#navbar ul {
+       margin: 0;
+       padding: 0;
+       list-style: none;
+       height: 40px;
+}
+
+div#navbar ul li {
+       z-index: 50;
+       position: relative;
+       display: inline-block;
+       text-align: center;
+       line-height: 40px;
+       margin: 0 0.2em;
+}
+
+div#navbar ul li.l {
+       float: left;
+}
+
+div#navbar ul li.r {
+       float: right;
+}
+
+div#navbar ul li a:link, div#navbar ul li a:visited {
+       padding: 0.7em;
+       position: relative;
+       z-index: 50;
+       text-decoration: none;
+       color: white;
+}
+
+div#navbar ul li a:hover, div#navbar ul li a:active {
+       color: #4a0d0e;
+}
+
+div#main {
+       z-index: 0;
+       width: 100%;
+       position: absolute;
+       left: 0;
+       right: 0;
+       top: 124px;
+       bottom: 20px; 
+}
+
+div.arrow {
+       position: absolute;
+       top: 0;
+       padding: 0 1em 0;
+       height: 100%;
+       width: 20px;
+       z-index: 20;
+}
+
+div.arrow img {
+       position: absolute;
+       top: 50%;
+       height: 40px;
+       margin-top: -20px;
+}
+
+div#arrow-l {
+       left: 10%;
+}
+
+div#arrow-r {
+       right: 10%;
+}
+
+ul#panes {
+       z-index: 1;
+       padding: 0;
+       margin: 0;
+       position: relative;
+       top: 0;
+       height: 100%;
+}
+
+ul#panes li.pane {
+       display: block;
+       width: 80%;
+       background: white;
+       height: 100%;
+       position: absolute;
+       z-index: 3;
+       padding: 1px;
+       overflow: hidden;
+}
+
+ul#panes li.pane-r {
+       background: #4a0d0e;
+       background: rgba(74,13,14,0.75);
+}
+
+
+ul#panes li.pane-p {
+       background: #593b63;
+       background: rgba(89,59,99,0.75);
+}
+
+div.content {
+       height: 100%;
+       overflow: auto;
+       padding: 20px;
+       color: white;
+}
+
+div#footer {
+       z-index: 10;
+       background: black;
+       width: 70%;
+       position: absolute;
+       left: 15%;
+       right: 15%;
+       bottom: 0;
+       height: 40px;
+       line-height: 40px;
+       font-size: 14px;
+       color: white;
+       text-align: center;
+       font-weight: black;
+       font-family: Verdana, Arial, sans-serif;
+}
diff --git a/theme/hmb.js b/theme/hmb.js
new file mode 100644 (file)
index 0000000..bdef3a8
--- /dev/null
@@ -0,0 +1,74 @@
+/** Homerton May Ball JavaScript File - Richard Whitehouse **/
+
+function hmb_setup(pane, panes, panemap){
+
+var current = pane;
+
+function update_hmb(){
+       $("#arrow-l,#arrow-r").hide();
+
+       var left = current * 80;
+       $("#panes").animate({ left: "-" + left + "%" }, function(){
+
+       if(current > 0){
+               $("#arrow-l").fadeIn('slow');
+       } else {
+               $("#arrow-l").hide();
+       }
+       if(current + 1 < panes){
+               $("#arrow-r").fadeIn('slow');
+       } else {
+               $("#arrow-r").hide();
+       }
+       });
+}
+
+$(function($){
+
+update_hmb();
+
+for(var p in panemap){
+       
+       $(".link_" + p).click({pane: p}, function(ev){ 
+               current = panemap[ev.data.pane];
+               update_hmb();
+               return false;
+       });
+}
+
+$("#arrow-r").click(function(){
+
+       if((current + 1) < panes){
+               $("#arrow-l").hide();
+               $("#arrow-r").fadeOut(function(){
+                       ++current;
+                       update_hmb();
+               });
+       } else {
+               update_hmb();
+       }
+
+       return false;
+});
+
+$("#arrow-l").click(function(){
+
+       if(current > 0){
+               $("#arrow-r").hide();
+               $("#arrow-l").fadeOut(function(){
+                       --current;
+                       update_hmb();
+               });
+       } else {
+               update_hmb();
+       }
+
+       return false;
+});
+
+
+});
+
+
+}
+
diff --git a/theme/left.png b/theme/left.png
new file mode 100644 (file)
index 0000000..ffbfc84
Binary files /dev/null and b/theme/left.png differ
diff --git a/theme/logo.png b/theme/logo.png
new file mode 100644 (file)
index 0000000..ff7009b
Binary files /dev/null and b/theme/logo.png differ
diff --git a/theme/right.png b/theme/right.png
new file mode 100644 (file)
index 0000000..5834de4
Binary files /dev/null and b/theme/right.png differ