forked from code-differently/Twitter-Clone-Lab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.js
More file actions
89 lines (85 loc) · 3.02 KB
/
data.js
File metadata and controls
89 lines (85 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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: "Tweeting my life away -Kaleb",
time: "1:40 PM",
date: "16 Mar 20",
retweets: 6054,
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.....",
time: "4:51 PM",
date: "22 Jun 20",
retweets: 4,
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",
time: "4:51 PM",
date: "22 Jun 20",
retweets: 4,
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....",
time: "1:00 AM",
date: "1 May 89",
retweets: 123,
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",
time: "3:59 PM",
date: "24 Dec 19",
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} ●</p>
<p class="at-name">${date} ●</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);
}