mirror of
https://github.com/bvanroll/little_people_firebase.git
synced 2025-08-30 04:12:40 +00:00
testing
This commit is contained in:
BIN
public/avatars/example.png
Normal file
BIN
public/avatars/example.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.0 KiB |
54
public/css/main.css
Normal file
54
public/css/main.css
Normal file
@@ -0,0 +1,54 @@
|
||||
body {
|
||||
padding: 2em;
|
||||
}
|
||||
.header {
|
||||
font-size: 4em;
|
||||
}
|
||||
.card {margin-bottom: 7em;
|
||||
width: 80%;
|
||||
overflow: hidden; /* will contain if #first is longer than #second */
|
||||
border: 1px;
|
||||
border-style: outset;
|
||||
padding: .3em;
|
||||
}
|
||||
.pfp {width: 40%; max-width: 45%; float:left; height: 20em;margin: 2em;}
|
||||
.person {max-width: 45%;overflow: hidden; max-height: 29em;margin: 2em;}
|
||||
.bio {padding: .3em; margin: .5em}
|
||||
.name {
|
||||
font-size: 2em;
|
||||
}
|
||||
.picture {
|
||||
max-width: 80%;
|
||||
}
|
||||
.bio-item {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
.item-content {
|
||||
font-size: 1em;
|
||||
}
|
||||
@media only screen and (max-width: 600px) {
|
||||
.header {
|
||||
text-align: center;
|
||||
}
|
||||
.card {
|
||||
padding: 0em;
|
||||
width: 90%;
|
||||
}
|
||||
.pfp {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
margin: 0;
|
||||
height: auto;
|
||||
float: none;
|
||||
}
|
||||
.picture {
|
||||
max-width: 100%;
|
||||
}
|
||||
.person {
|
||||
max-width: 90%;
|
||||
width: 90%;
|
||||
margin: 0;
|
||||
padding: 1em;
|
||||
float: none;
|
||||
}
|
||||
}
|
@@ -17,56 +17,20 @@
|
||||
<script defer src="/__/firebase/init.js?useEmulator=true"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
padding: 2em;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="css/main.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Fake People</h1>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<h1 class="header">Fake People</h1>
|
||||
<div class="container" style="padding-top: 1em; padding-left: 3em" id="people">
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var statusItem = document.querySelector("p#status");
|
||||
var peopleList = document.querySelector("#people");
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
try {
|
||||
let app = firebase.app();
|
||||
let features = [
|
||||
'database',
|
||||
'storage'
|
||||
].filter(feature => typeof app[feature] === 'function');
|
||||
<script src="js/main.js">
|
||||
|
||||
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
var database = firebase.database();
|
||||
var rootRef = database.ref('/');
|
||||
console.log(peopleList)
|
||||
rootRef.once('value', function(snapshot){
|
||||
snapshot.forEach(function(d) {
|
||||
var v = d.val();
|
||||
peopleList.innerHTML += `<div style="margin-bottom: 7em">
|
||||
<h3 class="card-header">${v.firstName} ${v.lastName}</h3>
|
||||
<h4>Gender:</h4>
|
||||
<p>${v.gender}</p>
|
||||
<h4>Age:</h4>
|
||||
<p>${v.age}</p>
|
||||
<h4>Current Country of Residence:</h4>
|
||||
<p>${v.country}</p>
|
||||
<h4>Job:</h4>
|
||||
<p>${v.job}</p>
|
||||
<h4>Bio:</h4>
|
||||
<p>${v.bio}</p>
|
||||
</div>`;
|
||||
console.log(d.val());
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user