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

Styles #68

Open
wants to merge 2 commits into
base: main
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db.sqlite
Binary file not shown.
5 changes: 1 addition & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/capdfrawy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/joe-taylor..jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions public/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
body,
html {
height: 100%;
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}

* {
box-sizing: border-box;
}


body {
/* The image used */
background-image: url("joe-taylor..jpg");



/* Full height */
height: 100%;

/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}

.bg-image {

/* Add the blur effect */
filter: blur(2.2px);
-webkit-filter: blur(2.2px);
}

/* Position text in the middle of the page/image */
.bg-text {
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0, 0.4); /* Black w/opacity/see-through */
color: white;
font-weight: bold;
border: 3px solid #f1f1f1;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
width: 80%;
padding: 20px;
text-align: center;
}

.nav-bar {
display: inline-block;
padding: 8px;
align: center;
}

li {
display: inline;
}

header {
background-color: #eee6e6;
}

main {
background-color: #e9dfdf;
}
6 changes: 6 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const express = require('express');
const cookieParser = require('cookie-parser');
const bodyParser = express.urlencoded({ extended: false });

//server handles requests to style.css and responds with the file contents

const server = express();
const cookies = cookieParser(process.env.COOKIE_SECRET); //process.env.COOKIE_SECRET

Expand All @@ -11,6 +13,10 @@ const { getSignUp, postSignUp } = require('./routes/sign-up');
const { getSignin, postSignin } = require('./routes/sign-in');
const { postLogOut } = require('./routes/log-out')


const staticHandler = express.static("public");

server.use(staticHandler);
server.use(cookies); //pass cookieParser to all reoutes with req object
server.use(sessions); //calls next inside session()

Expand Down
2 changes: 1 addition & 1 deletion src/templates/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function userCredentialsForm(path,errors = {}, values = {}) {
<label for="email">email</label>
<input type="email" id="email" name="email" required
value="${values.email ? sanitize(values.email) : ""}">
${validation(errors.email)}>
${validation(errors.email)}
</div>
<div class="form-div">
<label for="password">password</label>
Expand Down
3 changes: 2 additions & 1 deletion src/templates/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ function html(title, nav, content) {
${content}
</main>
</div>
<div class="bg-image"></div>
</div>
</body>
</html>
`;
}
function navBar(session) {

return /*html*/ `<ul>
<li><a href='/'>Home</a>
<div>
Expand Down