Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue4 Adding homepage to the app #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const viewsRouter = require('./routes/viewsRouter')
app.use(viewsRouter)


app.get("/home", (req, res)=>{
res.render("home");
})



Expand Down
94 changes: 94 additions & 0 deletions views/home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
body{
background-color:#f4f4f4;
color:#555;
font-family:Arial, Helvetica, sans-serif;
font-size:16px;
line-height:1.6em;
margin:0;
}

.container{
width:80%;
margin:auto;
overflow:hidden;
}

#main-header{
background-color:rgb(36, 131, 215);
color:#fff;
}
#main-header h1{
text-align: center;
}

#navbar{
background-color:#333;
color:#fff;
}

#navbar ul{
padding:0;
list-style: none;
}

#navbar li{
display:inline;
}

#navbar a{
color:#fff;
text-decoration: none;
font-size:18px;
padding-right:15px;
}

#showcase{
background-image:url('./images/weather.jpg');
background-position:center right;
min-height:300px;
margin-bottom:30px;
text-align: center;
}

#showcase h1{
color:#fff;
font-size:50px;
line-height: 1.6em;
padding-top:30px;
}

#main{
float:left;
width:70%;
padding:0 30px;
box-sizing: border-box;
}

#sidebar{
float:right;
width:30%;
background: #333;
color:#fff;
padding:10px;
box-sizing: border-box;
}

#main-footer{
background: #333;
color:#fff;
text-align: center;
padding:20px;
margin-top:40px;
}

@media(max-width:600px){
#main{
width:100%;
float:none;
}

#sidebar{
width:100%;
float:none;
}
}
53 changes: 53 additions & 0 deletions views/home.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<link rel="stylesheet" type="text/css" href="home.css">
</head>
<body>
<header id="main-header">
<div class="container">
<h1>Weather App</h1>
</div>
</header>

<nav id="navbar">
<div class="container">
<ul>
<li><a href="/home">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="/">Search</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</nav>

<section id="showcase">
<div class="container">
<h1>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
</h1>
</div>
</section>

<div class="container">
<section id="main">
<h1>Welcome</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</section>
<aside id="sidebar">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud </p>
</aside>
</div>

<footer id="main-footer">
<p>Copyright &copy; </p>
</footer>
</body>
</html>
Binary file added views/images/weather.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.