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
48 changes: 45 additions & 3 deletions data.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
let data = [
{
image: "https://images.unsplash.com/photo-1596550190729-1d9225e788dd?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=967&q=80",
name: "Kaleb Burd",
handle: "@kburd",
message: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque dignissim mollis sem, vel dignissim sem tempor eleifend. Vivamus et elit dapibus, porttitor nulla sed, blandit ex. -Kaleb",
message: "Tweeting my life away -Kaleb",
time: "1:40 PM",
date: "16 Mar 20",
retweets: 6054,
likes: 27700
likes: 27.7 + 'K'
},
{
image: "https://images.unsplash.com/photo-1596550190729-1d9225e788dd?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=967&q=80",
name: "Vlad Putin",
handle: "@noBotHere",
message: "Howdy all.....",
Expand All @@ -18,6 +20,7 @@ let data = [
likes: 27
},
{
image: "https://images.unsplash.com/photo-1596550190729-1d9225e788dd?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=967&q=80",
name: "Jack Dorsey",
handle: "@daBoss",
message: "Twiter is the best social media on the internet, Zuckerberg is inferior",
Expand All @@ -27,6 +30,7 @@ let data = [
likes: 27
},
{
image: "https://images.unsplash.com/photo-1596550190729-1d9225e788dd?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=967&q=80",
name: "Leon Jenkins",
handle: "@leyawn",
message: "Cool place.... looks uninhaited....",
Expand All @@ -36,6 +40,7 @@ let data = [
likes: 27334
},
{
image: "https://images.unsplash.com/photo-1596550190729-1d9225e788dd?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=967&q=80",
name: "Mark Zuck",
handle: "@zuckman",
message: "This is hot garbage",
Expand All @@ -44,4 +49,41 @@ let data = [
retweets: 0,
likes: 0
}
]
]


for (let i = 0; i < data.length; i++) {
let image = data[i].image;
let name = data[i].name;
let handle = data[i].handle;
let message = data[i].message;
let time = data[i].time;
let date = data[i].date;
let retweets = data[i].retweets;
let likes = data[i].likes;
let tweet = document.createElement('div');
tweet.classList.add('tweet');name
tweet.innerHTML =
`<div class="tweet__bio">
<img src=${image} class="tweet__bio__picture"></div>
<div class="tweet__bio__name">
<p>${name}</p>
<p class="at-name">${handle}</p>
</div>
</div>
<div class="tweet__content">
${message}
</div>
<div class="tweet__time-stamp">
<p class="at-name">${time} &#9679;</p>
<p class="at-name">${date} &#9679;</p>
<p class="blue-link">Twitter for iPhone</p>
</div>
<div class="tweet__social">
<p> <strong>${retweets}</strong> <div class="at-name">Retweets</div></p>
<p><strong>${likes}</strong> <div class="at-name">Likes</div></p>
</div>`


document.getElementById('post').appendChild(tweet);
}
43 changes: 43 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>

<link rel="stylesheet" href="style.css">

</head>
<body>
<div>

<h1>Twitter</h1>

<div id="post">

</div>


<div class="tweet">

</div>


</div>














<script src ="data.js"></script>
</body>
</html>
83 changes: 83 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
* {
box-sizing: border-box;
margin:0;
padding:0;
}


h1 {
text-align: center;
color: blue;
}

.tweet {
padding: 1rem;
width: 598px;
height: 262px;
display: flex;
flex-direction: column;
margin: auto;
border: 2px solid black;
margin-bottom: 1.25rem;
}

.tweet__bio {
margin-bottom: 1rem;
display: flex;
}

.tweet__bio__picture {
height: 75px;
width:75px;
border-radius: 50%;
background-color: grey;
}

.tweet__content {
justify-content: center;
font-size: 1.25rem;
margin-top: 50px;
}

.tweet__time-stamp {
display: flex;


align-items: flex-end;
border-bottom: 1px solid rgba(0,0,0,.3);
padding-bottom: .5rem;
margin-top:1rem;
}

.tweet__time-stamp p {
margin-right: 1rem;
}

.tweet__social {
display: flex;

margin-top: 1rem;
align-items: center;
padding-bottom: 1rem;
}

.tweet__social p {
margin-right: 1rem;
}

.tweet__bio__name {
justify-content: center;
display: flex;
flex-direction: column;
margin-left:3rem;
margin-top: -70px;
margin-left: 90px;
}

.blue-link{
color: blue;
}

.at-name{
color: #8d8686c4;
}