Skip to content

Commit

Permalink
styling
Browse files Browse the repository at this point in the history
  • Loading branch information
strau-s committed Apr 16, 2020
1 parent 05b8952 commit 915882e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 40 deletions.
22 changes: 8 additions & 14 deletions popup.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script src="background.js"></script>
<script src="pouchdb-7.1.1.js"></script>
<script src="pouchdb.find.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="background.js"></script>
<script src="pouchdb-7.1.1.js"></script>
<script src="pouchdb.find.js"></script>
</head>
<body>
<div>
<button id='addpage'>Add this page</button>
<div id='articles'></div>
<p>Username:</p>
<input id="username-field"></input>
</div>
<button id="login">Log in</button>


<div>
<h2>What your friends are talking about:</h2>
<div id="articles"></div>
</div>
</body>
<script src="popup.js"></script>
<!-- <script src="contentScript.js"></script> -->

</html>
35 changes: 16 additions & 19 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,24 @@ let x = db
});
})
.then(function (data) {
data.forEach((doc) => {
data.docs.forEach((doc) => {
console.log(doc);
const a = document.createElement('a');
a.innerHTML = doc.title;
a.target = '_blank';
a.href = doc.url
document.getElementById('articles').appendChild(a)
})}).catch(error => {
console.log(error)
a.href = doc.url;
console.log(a);
const articles = document.getElementById('articles');
articles.appendChild(a);
const span = document.createElement('span');
span.innerHTML = ` - ${doc.name}`;
a.insertAdjacentElement('afterend', span);
const br = document.createElement('br');
articles.appendChild(br);
});
})
.catch((error) => {
console.log(error);
});

const date = new Date();
Expand Down Expand Up @@ -45,17 +56,3 @@ addPage.onclick = function (element) {
else throw err;
});
};

const login = document.getElementById('login');

login.onclick = function(element) {
console.log(window.document);
let username = document.getElementById('username-field').value;
console.log(username);
const docs = new User(username, "1");
console.log(JSON.stringify(docs));
db.put(docs, function(err, result) {
if (!err) console.log('added');
else throw(err);
})
}
29 changes: 22 additions & 7 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
button {
/* height: 30px; */
/* width: 30px; */
outline: none;
}
/* height: 30px; */
/* width: 30px; */
outline: none;
}

body {

}
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #fcfaf2;
width: 300px;
}
h2 {
letter-spacing: 2px;
}
a {
color: #4d5139;
font-size: 1.6em;
margin-top: 40px;
}
span {
color: #4d5139;
font-size: 1.6em;
margin-top: 40px;
}

0 comments on commit 915882e

Please sign in to comment.