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

Css style #17

Open
wants to merge 6 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# twitter
# twitter
DATABASE_URL = postgres://jopfbvotzylhye:cd9d1347c5c1bcf467f7f8525b8878d5656266dd32176b4461c585dc28a7314b@ec2-107-22-167-179.compute-1.amazonaws.com:5432/ddo2f7ukgcdbsu
Binary file added background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions database/db_connection.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const {Pool} = require('pg');
require('env2')('./config.env');

if (!process.env.DATABASE_URL) {
const DB_URL = process.env.DATABASE_URL; // || 'postgres://kefah:kefah@localhost:5432/twitter';
if (!DB_URL) {
throw new Error('No DATABASE_URL provided');
}

const pool = new Pool({ connectionString: process.env.DATABASE_URL });
const pool = new Pool({ connectionString: DB_URL });

module.exports = pool;
Binary file added favicon.ico
Binary file not shown.
158 changes: 155 additions & 3 deletions public/css/style.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,161 @@
*{
* {
padding: 0;
margin: 0;
}
.container{

.container {
width: 100%;
max-width: 1200px;
max-width: 1200px;*/
margin: 0 auto;
}

.maincontent{
background-color: red;
}
/******** BODY IMAGE ***************/

body{
background: url(../background.jpg) no-repeat -300px -800px;
}

/******** END BODY IMAGE **************/
/************ START HEADER CSS **************/
header {
height:70px;
background:#fff;
border:1px solid #CCC;
}

a {
text-decoration: none;

}
.branding img {
float: left;
width: 50px;
height: 50px;
padding: 10px;
padding-left: 50px;
padding-right: 1px;
}

.branding h3 {
position: relative;
top: 18px;
left: 10px;
color: #1da1f2;
text-decoration: none;
padding-top: 8px;
}

#userNav h3{

float: right;
top: 18px;
left: 10px;
color: #1da1f2;
text-decoration: none;
margin-right: 50px;
margin-bottom: 15px;

}
/************ END HEADER CSS ************/
/******** START LOGIN FORM CSS ********/

#loginSection{
float: right;
background-color: yellow;
padding: 15px;
width: 300;
margin-right: 200px;
margin-top: 50px;
max-height: 500px;

}

form#loginForm button{
height: 32px;
background:#FFFFFF;
/*border:5px;*/
border-color: #1da1f2;
padding-left: 20px;
padding-right: 20px;
color: #1da1f2;
float: right;
border-radius: 20px;
font-weight: bold;
}

form#loginForm button:hover{
background-color: #eaf5fd;
}

/*#newsletter form {
float: right;
margin-top: 15px;
}*/
section#loginSection form input, section#signupSection form input {
width: 90%;
padding: 5px;
margin-bottom: 5px;

}

h3#loginh3{
font-family: monospace ,sans-serif;
margin-bottom: 5px;
}

/******** END LOGIN FORM CSS ********/

/********* START SIGNUP FORM CSS *****/

#signupSection{
float: left;
padding: 15px;
width: 350px;
max-height: 500px;
margin-left: 150px;
margin-right: 50px;
margin-top: 50px;
border: 3px;
}

form#signupForm button{
height: 32px;
background:#1da1f2;
border:0;
padding-left: 20px;
padding-right: 20px;
color: #ffffff;
float: right;
border-radius: 20px;
font-weight: bold;
}

/*#newsletter form {
float: right;
margin-top: 15px;
}*/

h3#signuph3{
font-family: monospace ,sans-serif;
margin-bottom: 10px;
}

form#signupForm button:hover{
background-color: #006dbf;
}

hr{
color: #f4f6f9;
margin-bottom: 5px;
}
/********* END SIGNUP FORM CSS *******/

section#loginSection, section#signupSection{
max-height: 500px;
max-width: 400px;
padding: 20px;
position: relative;
}
25 changes: 22 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,54 @@
<meta name="description" content="Twitter">
<meta name="viewport" content="initial-scale=1">
<link rel="stylesheet" href="css/style.css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title>Twitter</title>

</head>
<body>
<header>
<nav>
<div class="container">
<a class="logo" href="#">
Twitter
<div class="branding">
<img src="../twitterlogo.png" alt="logo" />
<h3>Twitter</h3>
</div>

</a>
<div id="userNav">

<h3>User name:</h3>
</div>
</div>
</nav>
</header>
<div class="mainContent">
<section id="Forms">
<div class="Forms">
<section id="loginSection">
<h3 id="loginh3">Login ... </h3>
<form id="loginForm" action="/login" method="post">
<div class="loginname">
<input type="text" name="username" value="" placeholder="User Name ...." required>
</div>
<div class="loginpassword">
<input type="text" name="password" value="" placeholder="Password ...." required>
</div>
<div class="loginbutton">
<button type="button" name="button">Login ...</button>
</div>
</form>
</section>
<section id="signupSection">
<h3 id="signuph3">New to Twitter? <span style="color:#66757f">Sign up</span></h3>
<hr>
<form id="signupForm" action="/signup" method="post">
<input type="text" name="username" value="" placeholder="User Name ...." required>
<input type="text" name="password" value="" placeholder="Password ...." required>
<button type="button" name="button">Sign up for Twitter</button>
</form>
</section>
</div>
</section>
<script type="text/javascript" src="js/request.js"></script>
<script type="text/javascript" src="js/index_dom.js"></script>
</body>
Expand Down
48 changes: 0 additions & 48 deletions tests/be_test.js
Original file line number Diff line number Diff line change
@@ -1,48 +0,0 @@
const getData = require('./queries/generic');

function test (query, cb) {
let obj = {};
// const query = `SELECT teams.id AS team_id, teams.name AS team_name , teams.description AS team_description
// , memebers.name AS member_name ,
// projects.id AS project_id , projects.title AS project_name , projects.state AS project_state FROM teams_members
// INNER JOIN memebers ON memebers.id = teams_members.member_id
// INNER JOIN teams ON teams.id = teams_members.team_id
// INNER JOIN projects ON projects.team_id = teams.id;`;
// const query =
getData(query, (err, res) => {
if (err) {
cb(err);
} else {
cb(null, res);
}
});
}

test('SELECT DISTINCT id , name , description FROM teams', (err, res) => {
if (err) {
console.log(err);
} else {
let ids = res.map((obj) => {
return {id: obj.id, name: obj.name, description: obj.description};
});
ids.map((team) => {
team.projects = [];
team.members = [];
test(`SELECT id , title , description , state FROM projects WHERE team_id=${team.id}`, (err, projectsRes) => {
if (err) {
console.log('in projects query', err);
} else {
team.projects = projectsRes;
test(`SELECT member_id , memebers.name FROM teams_members INNER JOIN memebers ON memebers.id = teams_members.member_id WHERE team_id=${team.id}`, (err, membersRes) => {
if (err) {
console.log('member query error', err);
} else {
team.members = membersRes;
console.log(team);
}
});
}
});
});
}
});
29 changes: 0 additions & 29 deletions tests/db.test.js
Original file line number Diff line number Diff line change
@@ -1,29 +0,0 @@
const connection = require('../database/db_connection.js');
const test = require('tape');

test('Testing database connection', (t) => {
const sql = '';
connection.query(sql, (err, res) => {
if (err) {
t.notOk(!err, err);
t.end();
} else {
t.equal(res != null, true, 'Should not be empty');
t.end();
}
});
});

test('Testing queries on the database', (t) => {
const sql = 'SELECT * FROM users';
connection.query(sql, (err, res) => {
if (err) {
t.notOk(!err, err);
t.end();
} else {
t.equal(res.rows.length, 2, 'Should not be empty');
t.end();
connection.end();
}
});
});
Binary file added twitterlogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.