Skip to content

Commit

Permalink
- Change Config.Json to Local
Browse files Browse the repository at this point in the history
- Modularise Code for Index
- Modularise Code for Navigation Bar
  • Loading branch information
Silfer committed Apr 10, 2017
1 parent 695aeb6 commit c91d7c6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 109 deletions.
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"server-ip": "attack-on-tutor.herokuapp.com",
"server-port": 80,
"server-ip": "127.0.0.1",
"server-port": 8081,
"api-key": "Zj9Moa3qSwP8aXdQlUQUK",
"db-host": "localhost",
"db-dialect": "mysql",
Expand Down
58 changes: 5 additions & 53 deletions public/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,85 +2,37 @@ body {
background-color: #141311;
}

ul {
margin: 0;
padding: 0;
overflow: hidden;
background-color: #141311;
}

li {
float: left;
}

li a {
font-family: 'VT323', monospace;
font-size: 1.5vw;
color: #FFFFFF;
display: block;
padding: 10px;
text-align: center;
text-decoration: none;
}

li a:hover {
background-color: #B7B7B6;
}

h1 {
font-family: 'VT323', monospace;
font-size: 5vw;
color: #FFFFFF;
margin: 0;
padding: 0;
text-align: center;
margin-top: 20vh;
}

h2 {
font-family: 'VT323', monospace;
font-size: 4.5vh;
color: #A2482E;
margin:0;
padding:0;
text-align: center;
margin-top: 1vh;
}

#logout {
cursor: pointer;
}

.titleContainer {
#titleContainer {
margin-top: 5%;
}

#welcomeText {
margin-top: 8%;
}

.hiddenText {
#hiddenText {
margin-top: 8%;
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}

.dashboardButton {
text-align: center;
margin-top: 2%;
background-color: transparent;
outline: none;
}

p {
.centralise {
text-align: center;
margin-top: 2%;
background-color: transparent;
outline: none;
}

img.logo {
.logo {
display: block;
margin: 0 auto;
width:300px;
Expand All @@ -89,7 +41,7 @@ img.logo {
image-rendering: -moz-crisp-edges; /* Firefox */
image-rendering: -o-crisp-edges; /* Opera */
image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */
image-rendering: pixelated; /* Chrome */
image-rendering: pixelated; /* Chrome */
image-rendering: optimize-contrast; /* CSS3 Proposed */
-ms-interpolation-mode: nearest-neighbor; /* IE8+ */
}
12 changes: 7 additions & 5 deletions public/css/navigationbar.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
ul#header {
margin: 0;
padding: 0;
overflow: hidden;
background-color: #141311;
}

li.header {
float: left;
float: right;
list-style-type: none;
}

li.header a {
li a {
font-family: 'VT323', monospace;
font-size: 1.5vw;
color: #FFFFFF;
Expand All @@ -20,6 +18,10 @@ li.header a {
text-decoration: none;
}

li.header a:hover {
li a:hover {
background-color: #B7B7B6;
}

#logout {
cursor: pointer;
}
60 changes: 11 additions & 49 deletions source/view/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -16,62 +16,38 @@
<body>
<ul>
<ul id="header">
<li class="header" style="float:right"><a class="active" href="https://github.com/nus-mtp/etutorial">GitHub Repository</a></li>
<li class="header">
<a class="active" href="https://github.com/nus-mtp/etutorial">GitHub Repository</a>
</li>

<% if(user){ %>
<li style="float:right"><a class="active" id="logout" >Log Out</a></li>
<li class="header">
<a class="active" id="logout" >Log Out</a>
</li>
<% } %>
</ul>

<!--<li><a class="active" href="/">Attack on Tutor</a></li>-->
<!--else{ %>
<li style="float:right"><a class="active" href="/login" >Log In</a></li> -->
</ul>

<div class="logoContainer">
</div>

<div class="titleContainer">
<!--<h1>
Attack on Tutor
</h1>
<h2>
A Fantasy-like Tutorial Experience
</h2>-->

<div id="titleContainer">
<img class="logo" src="/images/logo.png"></img>

<% if(user){ %>
<!--<h2 id="welcomeText" onclick="createWelcomeText()">Test</h2>-->
<h2 id="welcomeText">Welcome, <%= user.name %>!</h2>
<a href="/dashboard">
<p><button type="button" class="btn btn-danger btn-lg">Go to Dashboard!</button></p>
<div class="centralise"><button type="button" class="btn btn-danger btn-lg">Go to Dashboard!</button></div>
</a>
<% } else{ %>
<h2 class="hiddenText">-</h2>
<h2 id="hiddenText">-</h2>
<a href="/login">
<p><button type="button" class="btn btn-danger btn-lg">Login Here!</button></p>
<div class="centralise"><button type="button" class="btn btn-danger btn-lg">Login Here!</button></div>
</a>
<!--<img class="login-button" src="">-->
<% } %>
</div>
</body>

</html>

<script>
/*function capitalizeEachWord(str) {
return str.replace(/\w\S*/ /*g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
}
function createWelcomeText() {
var userNameCap = capitalizeEachWord(userName);
document.getElementById("welcomeText").innerHTML = "Welcome, " + userNameCap + "!";
}*/
var logoutConfirmation = "Would You Like to Log Out?";
$("#logout").on
Expand All @@ -83,18 +59,4 @@
location.reload();
}
);
/*$(".login-button").on
(
"click",
function(event)
{
console.log ( "See You Soon!" );
}
);*/
//createWelcomeText();
</script>

<style>
</style>
</script>

0 comments on commit c91d7c6

Please sign in to comment.