forked from ishan-open/frontend-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
166 lines (130 loc) · 4.88 KB
/
index.html
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Project Name</title>
<link rel="stylesheet" href="./index.css" />
</head>
<body class="center">
<div id="root">
</div>
<script src="https://unpkg.com/react@17/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
<!-- <div class="username-container">
<div class="img">
<img class="username-img" src="./img/person-icon.png" alt="">
</div>
<div class="username">
<h3 class="name">Name</h3>
<h4 class="username-set">@Username</h4>
</div>
</div>
<div class="tweet">
<p class="tweet-p">Your tweet here!</p>
</div>
<div class="time">
</div>
<div class="arrow">
<img class="arrow-icon" src="./img/arrow.png" alt="">
</div>
<div class="icons-container">
<div class="comment">
<img class="comment-icon" src="./img/Vector.png" alt="">
<h4>44</h4>
</div>
<div class="retweet">
<img class="retweet-icon" src="./img/retweet.png" alt="">
<h3>3</h3>
</div>
<div class="like">
<img class="like-icon" src="./img/heart.png" alt="">
<h3>3,500</h3>
</div>
<div class="share">
<img class="share-icon" src="./img/share.png" alt="">
</div>
</div>
</div> -->
<script>
// function div(children) {
// return React.createElement(
// 'div',
// { 'className': 'cool' },
// React.createElement('h1', { 'data-all': 'cool' }, 'hello world'),
// );
// }
const img = React.createElement('img', { className: 'username-img', src: './img/person-icon.png' })
const divImg = React.createElement('div', { className: 'img' }, img)
const name = React.createElement('h3', { children: 'Name', className: 'name' })
const usernameSet = React.createElement('h4', { children: '@Username', className: 'username-set' })
const username = React.createElement('div', { className: 'username' }, name, usernameSet)
const usernameContainer = React.createElement('div', { className: 'username-container' }, divImg, username);
const p = React.createElement('p', { children: 'Your tweet here!', className: 'tweet-p' })
const tweet = React.createElement('div', { className: 'tweet' }, p);
let now = new Date();
let hour = now.toLocaleTimeString();
let day = now.getUTCDate();
let month = now.getUTCMonth();
let year = now.getUTCFullYear()
switch (month) {
case 0:
month = 'Jan';
break;
case 1:
month = 'Feb';
break;
case 2:
month = 'Mar';
break;
case 3:
month = 'Apr';
break;
case 4:
month = 'May';
break;
case 5:
month = 'Jun';
break;
case 6:
month = 'Jul';
break;
case 7:
month = 'Aug';
break;
case 8:
month = 'Sep';
break;
case 9:
month = 'Oct';
break;
case 10:
month = 'Nov';
break;
case 11:
month = 'Dec';
break;
}
let str = hour + " . " + month + " " + day + " " + year;
const time = React.createElement('div', { children: str, className: 'time' });
const arrowIcon = React.createElement('img', { className: 'arrow-icon', src: './img/arrow.png' })
const arrow = React.createElement('div', { className: 'arrow' }, arrowIcon);
const h4 = React.createElement('h3', { children: '44' });
const commentIcon = React.createElement('img', { className: 'comment-icon', src: './img/Vector.png' })
const comment = React.createElement('div', { className: 'comment' }, commentIcon, h4);
const h3 = React.createElement('h3', { children: '3' });
const retweetIcon = React.createElement('img', { className: 'retweet-icon', src: './img/retweet.png' })
const retweet = React.createElement('div', { className: 'retweet' }, retweetIcon, h3);
const h31 = React.createElement('h3', { children: '3500' });
const likeIcon = React.createElement('img', { className: 'like-icon', src: './img/heart.png' })
const like = React.createElement('div', { className: 'like' }, likeIcon, h31);
const shareIcon = React.createElement('img', { className: 'share-icon', src: './img/share.png' })
const share = React.createElement('div', { className: 'like' }, shareIcon);
const iconsContainer = React.createElement('div', { className: 'icons-container' }, comment, retweet, like, share);
const container = React.createElement('div', { className: 'container' }, usernameContainer, tweet, time, arrow, iconsContainer);
const root = document.getElementById('root');
ReactDOM.render(container, root);
</script>
</body>
</html>