-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfacebook.html
529 lines (458 loc) · 16.1 KB
/
facebook.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<!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>Document</title>
<!-- <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> -->
<style>
body{
background-color: rgb(244, 244, 244) !important;
}
#form2 {
display: flex;
max-width: 580px ;
flex-direction: column;
margin: 80px auto 40px auto;
background-color: white;
padding: 20px;
border-radius: 15px;
box-shadow: 0 0 2px 0.5px rgb(212, 212, 212);
}
.newPost{
border-radius: 6px;
background-color: white;
box-shadow: 0 1px 1px 0.01px;
margin-bottom: 40px;
padding: 5px;
}
#newPosts{
width: 500px;
background-position: center;
background-size: cover;
margin: 50px auto;
}
.post{
border: none;
background-color: rgb(244, 244, 244) !important;
padding: 8px;
width: 500px;
border-radius: 25px;
}
#postButton{
padding: 6px 20px;
border-radius: 25px;
border: none;
background-color: #1778F2;
color: white;
margin-left: 35px;
font-size: 15px;
}
#postButton:hover{
transition: 0.1s;
font-size: 18px;
padding: 3px 15.5px;
}
#postButton:not(:hover){
transition: 0.1s;
font-size: 15px;
padding: 6px 20px;
}
#iconBeforePost{
position: relative;
bottom: 5px;
}
#post::placeholder{
position: relative;
left: 5px;
}
.imgPost{
max-width: 490px;
margin-top: 20px;
}
.userImg{
width:60px;
}
.userName{
font-size: 19px;
font-weight: bold;
position: relative;
bottom: 10px;
left: 14px;
}
.userTime{
position: relative;
top: 15px;
right: 30px;
}
.bodyPost{
display: flex;
flex-direction:column ;
margin-left: 15px;
margin-top: 20px;
}
#bodyPost{
width: 460px;
}
.fade {
animation: fadeInAnimation ease 1s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}
@keyframes fadeInAnimation {
0% {
opacity: 0;
}
40% {
opacity: 1;
}
100% {
opacity: 1;
}
}
.header{
display: flex;
justify-content: center;
margin: 0 auto;
justify-content: center;
align-items: center;
position: relative;
padding: 2px !important;
background-color: white !important;
box-shadow: 0 0 4px 0.6px rgb(179, 179, 179);
position: fixed !important;
z-index: 999;
width: 100%;
top: 0;
}
.headerLi{
display: flex;
margin: 0 auto;
margin-left: 420px;
}
.active{
border-bottom: 3px solid black;
}
.header img {
margin: 0 30px;
}
.writePost{
background-color: white;
}
#facebookImg{
z-index: 9999;
position: fixed;
top:0;
width: 140px;
}
#image{
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: -1;
/* justify-content: space-between; */
}
#image + label {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 1.10em;
font-weight: 500;
color: rgb(145, 145, 145);
padding: 6px 20px;
border-radius: 15px;
/* display: inline-block; */
cursor: pointer; /* "hand" cursor */
}
#image:focus + label,
#image +label:hover{
background-color: rgb(244, 244, 244);
}
#imageIcon{
margin: 0 10px 0 0;
}
#video{
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: -1;
/* justify-content: space-between; */
}
#video + label {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 1.10em;
font-weight: 500;
color: rgb(145, 145, 145);
padding: 6px 20px;
border-radius: 15px;
/* display: inline-block; */
cursor: pointer; /* "hand" cursor */
}
#video:focus + label,
#video +label:hover{
background-color: rgb(244, 244, 244);
}
#videoIcon{
margin: 0 10px 0 0;
}
.divDown{
display: flex;
justify-content: space-around;
margin: 0 35px;
}
#facebookSearch{
padding: 8px;
border-radius: 25px;
border: none;
background-color: rgb(244, 244, 244);
width: 250px;
position: relative;
right: 20px;
}
#facebookSearch::placeholder{
color: gray;
position: relative;
left: 35px;
}
#searchIcon{
position: relative;
left: 45px;
top: 12px;
z-index: 5;
}
.sideBar{
position: fixed;
bottom: 140px;
max-width: 200px;
display: flex;
flex-direction: column;
margin-bottom: 10px;
padding: 20px;
}
.sideBar div {
padding: 8px 5px;
border-radius: 10px;
width: 240px;
display: flex;
align-items: center;
margin-top: 4px;
}
.sideBar div img {
margin-right: 8px;
}
.sideBar div:hover {
background-color: rgb(221, 221, 221);
cursor: pointer;
}
.sideBarContacts{
position: fixed;
left: 81%;
bottom: 140px;
max-width: 200px;
display: flex;
flex-direction: column;
margin-bottom: 10px;
padding: 20px;
float: right;
}
.sideBarContacts div {
padding: 8px 5px;
border-radius: 6px;
width: 220px;
display: flex;
align-items: center;
margin-top: 4px;
}
.sideBarContacts .divInContacts img {
margin-right: 8px;
border-radius: 50% !important;
}
.sideBarContacts .divInContacts:hover {
background-color: rgb(230, 230, 230);
cursor: pointer;
}
#divContactTop {
opacity: 65%;
margin-bottom: -10px;
}
#divContactTop > p {
font-weight: 600;
}
#divContactTop > img {
position: relative;
left: 30px;
bottom: 6px;
opacity: 65%;
}
#divContactTop > img:hover {
cursor: pointer;
}
#viewMoreIcon{
border-radius: 50%;
background-color: rgb(218, 218, 218);
padding: 7.5px;
}
</style>
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
</head>
<body>
<img id="facebookImg" src="https://static.xx.fbcdn.net/rsrc.php/y8/r/dF5SId3UHWd.svg" alt="">
<nav class="navbar navbar-expand-lg header">
<div class="container-fluid ">
` <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent ">
<ul class="navbar-nav me-auto mb-2 mb-lg-0 headerLi">
<li class="nav-item">
<a class="nav-link active" onmouseenter="enterHome()" onmouseout="outHome()" aria-current="page" href="#"><img onmouseenter="enterHome()" onmouseout="outHome()" id="home"src="https://i.ibb.co/QmP2ByG/1946488.png" width="25px" alt=""></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><img src="https://i.ibb.co/2SLCRKC/2791441.png" width="25px" alt=""></a>
</li>
<li class="nav-item">
<a class="nav-link" onmouseenter="enterEcommerce()" onmouseout="outEcommerce()" href="#"><img onmouseenter="enterEcommerce()" onmouseout="outEcommerce()" id="ecommerce"src="https://i.ibb.co/3cskgTm/1332655.png" width="25px" alt=""></a>
</li>
<li class="nav-item">
<a class="nav-link" onmouseenter="enterGroup()" onmouseout="outGroup()" href="#"><img id="group" onmouseenter="enterGroup()" onmouseout="outGroup()" src="https://i.ibb.co/VpKBmNK/681443.png" width="25px" alt=""></a>
</li>
</ul>
</div>
</div>
<li class="nav-item navbar-nav">
<img id="searchIcon" src="https://i.ibb.co/ss1QqFY/622669.png" width="18px" height="18px" alt="">
<input onfocus="focusSearch()" type="search" id="facebookSearch" placeholder="Search in facebook:">
</li>
</nav>
<div class="writePost">
</div>
<form class="writePost" action="#" id="form2" enctype="multipart/form-data">
<!-- <input type="text" id="name" placeholder="Name:"/> -->
<div>
<img id="iconBeforePost" src="https://www.e-shop.co.il/images/galleries/24_673.jpg" width="60" alt="">
<input type="text" id="bodyPost" class="post" placeholder="How's going Harel?:" onblur="document.getElementById('lblText').innerHTML=this.value.replace(/\n/gi,'<br/>')" />
</div>
<div class="divDown">
<input type="file" name="image" id="image">
<label for="image"><img id="imageIcon" src="https://i.ibb.co/pftpmGF/3792702.png" width="30px" alt=""> <span> Choose a file</span> </label>
<input type="file" name="video" id="video">
<label for="video"><img id="videoIcon" src="https://i.ibb.co/WVmhSb5/3172569.png" width="30px" alt=""> <span> Go live</span> </label>
<button id="postButton" on onclick="postForm(event)">Publish</button>
</div>
</form>
<div id="newPosts">
</div>
<div class="sideBar">
<div> <img src="https://www.e-shop.co.il/images/galleries/24_673.jpg" width="25px" alt=""><span style="font-weight: 500"> Harel Sarag</span></div>
<div> <img src="https://i.ibb.co/H4xXz7G/4577369.png" width="25px" alt=""><span style="font-weight: 400">Friends</span></div>
<div> <img src="https://i.ibb.co/8XdrhpS/5338104.png" width="25px" alt=""><span style="font-weight: 400">Saved</span></div>
<div><img src="https://i.ibb.co/JvwqkSy/5328050.png" width="25px" alt=""> <span style="font-weight: 400"> Groups</span></div>
<div> <img src="https://i.ibb.co/GQv0ZbS/6387839.png" width="25px" alt=""><span style="font-weight: 500">Marketplace</span></div>
<div> <img src="https://i.ibb.co/QNRyL8v/5323720.png" width="25px" alt=""><span style="font-weight: 500">Watch</span></div>
<div><img src="https://i.ibb.co/hm7rmf1/3237535.png" width="25px" alt=""> <span style="font-weight: 400"> Events</span></div>
</div>
<div class="sideBarContacts">
<div id="divContactTop">
<p>Contacts</p>
<img src="https://i.ibb.co/ss1QqFY/622669.png" width="18px" alt="">
</div>
<div class="divInContacts"> <img src="https://scontent.fsdv1-2.fna.fbcdn.net/v/t1.6435-9/121965128_5237960516229913_5627691003554564000_n.jpg?_nc_cat=104&ccb=1-7&_nc_sid=09cbfe&_nc_ohc=ZkLhbewy5DcAX8F_Q6k&_nc_ht=scontent.fsdv1-2.fna&oh=00_AT-RKbHPijUgE_-8wspig3SBQWtovxGqQ49IBFZI82gXyw&oe=6325BFF1" width="25px" alt=""><span style="font-weight: 400">Yarin Zafrani</span></div>
<div class="divInContacts"> <img src="https://scontent.fsdv1-2.fna.fbcdn.net/v/t1.6435-9/71850281_2553591861346653_2280599416240865280_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=09cbfe&_nc_ohc=tmcQ_5TJ08oAX9vtb-q&_nc_ht=scontent.fsdv1-2.fna&oh=00_AT_VW5oMbSV-_VrG5C5ZNUa3Q2mU7xo-c_fxU5hfYWBgkg&oe=632323B1" width="25px" alt=""><span style="font-weight: 400">Ofek Sarag</span></div>
<div class="divInContacts"><img src="https://scontent.fsdv1-2.fna.fbcdn.net/v/t1.6435-9/69050270_2858648447496023_7848574763709497344_n.jpg?_nc_cat=109&ccb=1-7&_nc_sid=09cbfe&_nc_ohc=e8aaf5rJor0AX9-HlaZ&_nc_ht=scontent.fsdv1-2.fna&oh=00_AT9OLQGlYgN8-qXvMea0b5RlSdyuDpF1UZIjRUadUDXdFQ&oe=6326EAE2" width="25px" alt=""> <span style="font-weight: 400"> Niv Kohavi</span></div>
<div class="divInContacts"> <img src="https://scontent.fsdv1-2.fna.fbcdn.net/v/t1.6435-9/69509324_2427524844000321_1366760053599633408_n.jpg?_nc_cat=102&ccb=1-7&_nc_sid=09cbfe&_nc_aid=0&_nc_ohc=UREwl3YRfYwAX_mqcS2&_nc_ht=scontent.fsdv1-2.fna&oh=00_AT9yXJ_ypUh4KRPDVi88jLlqOh_ReQ_vGstqQu_HxRzbHw&oe=63236565" width="25px" alt=""><span style="font-weight: 400">Ido Mizrachi</span></div>
<div class="divInContacts"> <img src="https://scontent.fsdv1-2.fna.fbcdn.net/v/t39.30808-6/290054395_10217141020277343_8502031014614901455_n.jpg?stp=cp1_dst-jpg&_nc_cat=108&ccb=1-7&_nc_sid=09cbfe&_nc_ohc=PcJ8ypsgzgwAX9-yat4&_nc_ht=scontent.fsdv1-2.fna&oh=00_AT-EAwgqmMB0InwKp4wEYk1rVPVTpYmNTaORuodGgclbAA&oe=6303FA3A" width="25px" alt=""><span style="font-weight: 400">Gal Or</span></div>
<div class="divInContacts"><img id="viewMoreIcon" src="https://i.ibb.co/HYQqNpX/60781.png" width="25px" alt=""> <span style="font-weight: 400"> More</span></div>
</div>
<!-- <script defer>
$(`#viewMoreIcon`).on(`click`, () => {
$(`#facebookSearch`).trigger("click");
})
</script> -->
<script>
function focusSearch(){
document.querySelector("#searchIcon").style.display = "none";
}
document.querySelector("#facebookSearch").addEventListener('focusout', (event) => {
document.querySelector("#searchIcon").style.display = "block";});
function enterHome(){
document.querySelector("#home").src = "https://i.ibb.co/RzbVZWB/1946436.png";
}
function outHome(){
document.querySelector("#home").src = "https://i.ibb.co/QmP2ByG/1946488.png";
}
function enterEcommerce(){
document.querySelector("#ecommerce").src = "https://i.ibb.co/kMyLHwD/3514491.png";
}
function outEcommerce(){
document.querySelector("#ecommerce").src = "https://i.ibb.co/3cskgTm/1332655.png";
}
function enterGroup(){
document.querySelector("#group").src = "https://i.ibb.co/HNb7s1C/681494.png";
}
function outGroup(){
document.querySelector("#group").src = "https://i.ibb.co/VpKBmNK/681443.png";
}
</script>
<script>
document.querySelector("#name").value = "Harel";
function postForm(e){
e.preventDefault();
fetch("https://jsonplaceholder.typicode.com/posts",{
method: 'POST',
body: JSON.stringify({
title: "Harel" ,
// title: document.querySelector("#name").value ,
body: document.querySelector(".post").value,
bodyPost: document.querySelector("#bodyPost").value,
userId: 1,
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
},
}
)
.then((resualt) => resualt.json())
.then((val) => {
let newPost = document.createElement("div");
newPost.setAttribute("class", "newPost fade")
let img = document.createElement("img")
img.setAttribute("class", "userImg")
img.src = "https://www.e-shop.co.il/images/galleries/24_673.jpg";
let userName = document.createElement("span")
userName.setAttribute("class", "userName")
userName.append(val.title)
let time = document.createElement("span")
time.setAttribute("class", "userTime")
const d = new Date("July 21, 1983 01:15:00");
let hours = new Date().getHours();
let min = new Date().getMinutes()
time.append(`${hours}:${min}`)
let body = document.createElement("div");
body.setAttribute("class", "bodyPost");
body.innerHTML = (val.bodyPost.replaceAll("\n","<br/>"));
let imgCheck = document.createElement("img");
imgCheck.setAttribute("class", "imgPost");
const image_input = document.querySelector("#image");
image_input.addEventListener("change", function() {
const reader = new FileReader();
reader.addEventListener("load", () => {
const uploaded_image = reader.result;
imgCheck.src = uploaded_image;
});
reader.readAsDataURL(this.files[0]);
});
newPost.append(img, userName,time, body, imgCheck)
document.querySelector("#newPosts").append(newPost);
})
}
</script>
</body>
</html>