Skip to content
Closed

Home #2066

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const express = require('express');
const app = express();
app.use(express.static('public'));

app.get("/", (request, response) => response.sendFile(__dirname + '/views/home.html'));
app.get("/about", (request, response) => response.sendFile(__dirname + '/views/about.html'));
app.get("/works", (request, response) => response.sendFile(__dirname + '/views/works.html'));
app.get("/gallery", (request, response) => response.sendFile(__dirname + '/views/photo-gallery.html'));

app.listen(3000, () => console.log('My first app listening on port 3000! '));
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "lab-express-basic-site",
"version": "1.0.0",
"description": "![logo_ironhack_blue 7](https://user-images.githubusercontent.com/23629340/40541063-a07a0a8a-601a-11e8-91b5-2f13e4e6b441.png)",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/VINIRR99/lab-express-basic-site.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/VINIRR99/lab-express-basic-site/issues"
},
"homepage": "https://github.com/VINIRR99/lab-express-basic-site#readme",
"dependencies": {
"express": "^4.17.3"
}
}
Binary file added public/images/image1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions public/scripts/navbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const navbar = document.createElement("nav");
navbar.innerHTML = `
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/works">Works</a></li>
<li><a href="/gallery">Gallery</a></li>
</ul>
</nav>
`;

const navSpace = document.createElement("div");
navSpace.setAttribute("style", "height: 26px;");

const body = document.body;
body.prepend(navSpace);
body.prepend(navbar);
Empty file added public/stylesheets/about.css
Empty file.
20 changes: 20 additions & 0 deletions public/stylesheets/home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
section {
height: 589px;
background-image: url("/images/image1.webp");
background-repeat: no-repeat;
background-size: 100% 589px;
display: flex;
justify-content: center;
}

div {
text-align: center;
}

h1 {
color: red;
}

h3 {
color: blue
}
31 changes: 31 additions & 0 deletions public/stylesheets/navbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
body {
margin: 25px 0 0;
}

nav {
width: 100%;
background-color: #c4c4c4;
border-bottom: 1px solid gray;
display: flex;
align-items: center;
position: fixed;
}

nav ul {
width: 100%;
display: flex;
justify-content: space-around;
}

nav li {
display: inline;
}

nav a {
text-decoration: none;
color: black;
}

nav a:hover {
color: red;
}
Empty file.
Empty file added public/stylesheets/works.css
Empty file.
13 changes: 13 additions & 0 deletions views/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Zé Ramalho</title>
<link rel="stylesheet" href="/stylesheets/navbar.css" />
<link rel="stylesheet" href="/stylesheets/about.css" />
</head>
<body>
<div>About</div>
<script src="/scripts/navbar.js"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions views/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Zé Ramalho</title>
<link rel="stylesheet" href="/stylesheets/navbar.css" />
<link rel="stylesheet" href="/stylesheets/home.css" />
</head>
<body>
<section>
<div>
<h1>Welcome to the Zé Ramalho fan page</h1>
<h3>Here you can discover more information about one of the best brazilian musicians ever!</h3>
</div>
</section>
<script src="/scripts/navbar.js"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions views/photo-gallery.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Zé Ramalho</title>
<link rel="stylesheet" href="/stylesheets/navbar.css" />
<link rel="stylesheet" href="/stylesheets/photo-gallery.css" />
</head>
<body>
<div>Gallery</div>
<script src="/scripts/navbar.js"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions views/works.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Zé Ramalho</title>
<link rel="stylesheet" href="/stylesheets/navbar.css" />
<link rel="stylesheet" href="/stylesheets/works.css" />
</head>
<body>
<div>Works</div>
<script src="/scripts/navbar.js"></script>
</body>
</html>