-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
141 lines (118 loc) · 7.78 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Comment-Widget</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css"/>
<script src="jquery.js"></script>
<script src="main.js" ></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- fevicon -->
<link rel="icon" href="src/img/chat.svg" type="image/gif" sizes="16x16">
</head>
<body onload="show_div();">
<!----------------------------------------- Heading --------------------------------->
<header class="header">
<span style="font-size:30px;cursor:pointer" onclick="openNav()">☰</span>
<div class="top-heading"><h3>Comments</h3><img style="vertical-align:bottom;min-height:28px;max-height:28px;min-width:28px;max-width:28px;" src="src/img/chat.svg" alt="comment-img"></div>
<div class="corner-menu">
<div class="login-div">
<img style="background-color:rgb(201, 215, 245);border-radius:50%;" class="img" src="https://robohash.org/345" alt="photo">
<p style="font-size:15px;margin-right:5px;font-family: 'Roboto Mono', monospace;" id="fetch-username-after-login">Guest</p>
</div>
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a id="a_signup" style="display:none;" onclick="closeNav();document.getElementById('modal-wrapper-2').style.display='block';">Signup</a>
<a id="a_login" style="display:none;" onclick="closeNav();document.getElementById('modal-wrapper').style.display='block';">Login</a>
<a id="a_signout" style="display:none;" onclick="closeNav();signout();">SignOut</a>
<a id="a_reset" onclick="localStorage.clear();location.reload();">Reset Everything</a>
</div>
</div>
</header>
<hr style="display: block;width:100%;height: 1px;border: 0;border-top: 1px solid #ccc;padding: 0px;">
<!----------------------------------------- Comment-box for guest --------------------------------->
<div id="new-message" class="new-message">
<div class="message-box">
<textarea id="comments" class="input-field" name="comment" onclick="writeAcomment();" placeholder="Enter your comment here..."></textarea>
</div>
<div class="submit-button">
<button onclick="writeAcomment();" style="width: 8rem;margin-top:1em;margin-left:2em;" class="btn" class="button_other">Add a Comment</button>
</div>
</div>
<!----------------------------------------- Sample - comment --------------------------------->
<div id="comment-boxes">
<div id="comment-box-id" class="comment-box-class">
<div class="photo">
<img class="img" src="https://robohash.org/ssdf" alt="photo">
</div>
<div class="information">
<div class="row1">
<div class="name"><strong class="comment-name-class" id="fetch-name">Rhythm</strong></div>
<div class="time_ago" id="fetch-time">5 min ago</div>
</div>
<i class="row2" class="comment-message-class" id="fetch-message">This has been very useful for my research. Thanks as well!</i>
<div class="row3">
<div class="reply"><button id="r" class="r" class="reply" style="border:none;" onclick="canuserreply();reply_clicked(this.id);" class="button">Reply</button></div>
<div class="vote">
<div id="fetch-like">
<i id="a" class="fa fa-thumbs-up like fetch-like-count" onclick="like(this.id);">0</i>
</div>
<div id="fetch-dislike">
<i id="b" class="fa fa-thumbs-down dislike fetch-dislike-count" onclick="dislike(this.id);">0</i>
</div>
</div>
<div class="posted_ago">1/Jan/1970</div>
</div>
</div>
</div>
</div>
<!----------------------------------------- Login-form --------------------------------->
<div id="modal-wrapper" class="modal">
<form onsubmit="return false;" class="modal-content animate">
<div class="imgcontainer">
<span onclick="document.getElementById('modal-wrapper').style.display='none'" class="close" title="Close PopUp">×</span>
<img class="avatar" src="https://robohash.org/196.png" alt="Avatar" class="avatar">
<h2 style="text-align:center">Login</h2>
</div>
<div class="container">
<input id="log-usr" autocomplete="off" type="text" placeholder="Enter Username" name="uname" required>
<input id="log-psw" autocomplete="off" type="password" placeholder="Enter Password" name="psw" required>
<button class="button_other" type="submit" onclick="login();">Login</button>
<button style="margin:2em;" onclick="document.getElementById('modal-wrapper-2').style.display='block';document.getElementById('modal-wrapper').style.display='none'" class="btn">New Signup here</button>
</div>
</form>
</div>
<!----------------------------------------- signup-form --------------------------------->
<div id="modal-wrapper-2" class="modal">
<form onsubmit="return false;" class="modal-content animate">
<div class="imgcontainer">
<span onclick="document.getElementById('modal-wrapper-2').style.display='none'" class="close" title="Close PopUp">×</span>
<img src="https://robohash.org/196.png" alt="Avatar" class="avatar">
<h2 style="text-align:center">Sign Up here</h2>
</div>
<div class="container">
<input id="sign-usr" autocomplete="off" type="text" placeholder="Enter Username" name="uname" required>
<input id="sign-psw" autocomplete="off" type="password" placeholder="Enter Password" name="psw" required>
<button class="button_other" onclick="signup();" type="submit">Sign Up</button>
<button style="margin:2em;" class="btn" type="submit" onclick="document.getElementById('modal-wrapper-2').style.display='none';document.getElementById('modal-wrapper').style.display='block'">Already a member Login</button>
</div>
</form>
</div>
<!----------------------------------------- Something after signup -------------------------->
<!------------------------------- message box popup open after login ----------------------------->
<div id="message-box-popup" class="modal">
<form onsubmit="return false;" class="modal-content animate" style="height: 60%;">
<div class="imgcontainer">
<span style=" position: absolute;top: 0px;right: 0px;" onclick="document.getElementById('message-box-popup').style.display='none'" class="close" title="Close PopUp">×</span>
<h3 class="message-head">Enter your comment here</h3>
</div>
<div class="container" style="height: auto;margin-right: auto;margin-left: auto;">
<textarea autocomplete="off" id="message-box-comments" class="input-field" name="comment" placeholder="Enter your comment here..." style="width: 85%;height: 30vh;"></textarea>
<button onclick="Add_comment();" style="width: 8rem;margin-left:2em;margin-top:1em;" class="btn">Add a comment</button>
</div>
</form>
</div>
</body>
</html>