Skip to content

Commit

Permalink
directory "www" is added and cgi was complete
Browse files Browse the repository at this point in the history
  • Loading branch information
aegiryy committed Mar 17, 2011
1 parent b22e226 commit 91531ea
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/server.c
Expand Up @@ -14,7 +14,7 @@
#define BUFFER_SIZE 1024
#define SOCKET_ERROR -1
#define QUEUE_SIZE 5
#define ROOT_DIR "."
#define ROOT_DIR "./www"

int main(int argc, char* argv[])
{
Expand Down
Binary file added www/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 112 additions & 0 deletions www/nn/maze.css
@@ -0,0 +1,112 @@
h1, h2 {
text-align: center;
}

p {
width: 600px;
margin: 1em auto;
}

#maze {
margin: auto;
position: relative;
height: 300px;
width: 500px;
}

#start, #end {
position: absolute;
top: 205px;
height: 30px;
width: 30px;
border: 1px solid black;
padding: 5px;

font-family: "Helvetica", "Arial", sans-serif;
font-size: 25pt;
text-align: center;
}

#maze #start {
background-color: #88ff88;
left: 0;
}

#maze #end {
background-color: #8888ff;
right: 0;
}

div.boundary {
background-color: #eeeeee;
border: 1px solid black;
}

div.boundary.example {
margin: auto;
width: 100px;
height: 25px;
}

div.youlose {
background-color: #ff8888;
}

/*
Hack hack hack; these are CSS "sibling selectors" for selecting
neighboring elements. Necessary to avoid giving ids to the boundary divs
*/
/*
You don't need to download or edit this file.
*/


#maze div.boundary {
position: absolute;

top: 0;
left: 0;
height: 200px;
width: 150px;
z-index: 1;
}

#maze div.boundary + div.boundary {
border-left: none;
border-right: none;
z-index: 2;

left: 151px;
height: 50px;
width: 198px;
}

#maze div.boundary + div.boundary + div.boundary {
border-left: 1px black solid;
border-right: 1px black solid;
z-index: 1;

left: 348px;
height: 200px;
width: 150px;
}

#maze div.boundary + div.boundary + div.boundary + div.boundary {
border: 1px black solid;

top: 250px;
left: 0;
height: 48px;
width: 498px;
}

#maze div.boundary + div.boundary + div.boundary + div.boundary + div.boundary {
border-bottom: none;

top: 100px;
left: 200px;
height: 150px;
width: 98px;
}
73 changes: 73 additions & 0 deletions www/nn/maze.html
@@ -0,0 +1,73 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<!--
You don't need to download or edit this file.
-->

<head>
<title>Maze!</title>
<link href="maze.css" type="text/css" rel="stylesheet" />

<script type="text/javascript">
function change(){
if (start==1) {
setcolor("#ff8888");
end=start;
}

}
function result() {
if(start==1) {
if (end==1) {

alert("you lose");
}
else {
alert("you win");
}
}
start=0;
end=0;
document.getElementById("start").style.backgroundColor="#88ff88";
setcolor("#eeeeee");
}
function setcolor(color) {
for (var i=1;i<6;i++) {
document.getElementById("boundary"+i).style.backgroundColor=color;
}

}
</script>
</head>

<body>
<h1>The Amazing Mouse Maze!</h1>
<h2 id="status">Move your mouse over the "S" to begin.</h2>
<script type="text/javascript">
start=0;
end=0;
</script>
<!-- This part of the page represents the maze -->
<div id="maze">

<div id="start" onmouseover="start=1;this.style.backgroundColor='yellow';">S</div>
<div class="boundary" id="boundary1" onmouseover="change();"></div>
<div class="boundary" id="boundary2" onmouseover="change();"></div>
<div class="boundary" id="boundary3" onmouseover="change();"></div>
<div class="boundary" id="boundary4" onmouseover="change();"></div>
<div class="boundary" id="boundary5" onmouseover="change();"></div>
<div id="end" onmouseover="result()">E</div>
</div>

<p>
The object of this game is to guide the mouse cursor through the start area and get to the end area. Be sure to avoid the walls:
</p>

<div class="boundary example"></div>

<p>
Good luck!
</p>
</body>
</html>
6 changes: 6 additions & 0 deletions www/test.py
@@ -0,0 +1,6 @@
from sys import argv

print 'HTTP/1.1 200 OK'
print 'Content-Type: text/html'
print ''
print argv

0 comments on commit 91531ea

Please sign in to comment.