Skip to content
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
46 changes: 46 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.bigBox{
border: 1px solid black;
margin: 5px;
padding: 5px;
}

.date{

color: green;
display: inline;

}
.hideBody{
color:red;
display: none;
}



.flip {
font-size: 16px;
padding: 10px;
text-align: center;
background-color: #4CAF50;
color: white;
border: solid 1px #a6d8a8;
margin: auto;
}


.sender{

margin: 5px;
color:red;
}

.subject{

margin: 5px;
color:purple;
}
.bodyMessage{
display: inline-block;
margin: 5px;
color:black;
}
65 changes: 58 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,69 @@
<!DOCTYPE html>
<html>
<head>
<script src="js/mail-generator.js"></script>
<link href="css/style.css" rel="stylesheet" media="screen">
<script>
window.onload = function(){
// ALL OF YOUR JAVASCRIPT CODE SHOULD GO HERE.
// We have to use window.onload so your JavaScript doesn't execute until the page has loaded and all HTML has been downloaded to your browser

};
// We have to use window.onload so your JavaScript doesn't execute until the page has loaded and all HTML has been downloaded to </html>your browser

count.innerHTML = "There are " + geemails.length + " messages in the mailbox!";


for(var i = 0; i<geemails.length; i++){


var wrapper = document.createElement('div');
wrapper.className = 'bigBox';
list.appendChild(wrapper)

var mailBox = document.createElement('div');
mailBox.className = 'date';
mailBox.innerHTML = "Date: " + geemails[i].date;
mailBox.addEventListener('click',showMessage)
wrapper.appendChild(mailBox);

var senderBox = document.createElement('p');
senderBox.className = 'sender';
senderBox.innerHTML = "Sender Name: " +geemails[i].sender;
mailBox.appendChild(senderBox);

var subjectBox = document.createElement('p');
subjectBox.className = 'subject';
subjectBox.innerHTML = "Subject: " +geemails[i].subject;
mailBox.appendChild(subjectBox);

var bodyBox = document.createElement('p');
bodyBox.className = 'bodyMessage';
bodyBox.innerHTML = "Message Body: " + "<br><br>" +geemails[i].body;
mailBox.appendChild(bodyBox);



}

function showMessage() {
var x = this.querySelector('.hideBody');
if (x.style.display === 'block') {
x.style.display = 'none';
} else {
x.style.display = 'block';
}
}
};


</script>
</head>

<body>
<div class="container" id="main">
Build Me!
</div>
<h1>Eugene's Coding Challenge</h1>
<div><p id="count"></p></div>


<div class="hideBody" id="list"> show message</div>


</body>
</html>
</html>