-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeedback.html
More file actions
133 lines (115 loc) · 3.56 KB
/
feedback.html
File metadata and controls
133 lines (115 loc) · 3.56 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forum</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f0f0f0;
}
header {
background-color: #333;
color: white;
padding: 10px;
text-align: center;
}
main {
margin: 20px;
}
.post-container {
background-color: white;
padding: 20px;
margin-bottom: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
textarea {
width: 100%;
padding: 10px;
box-sizing: border-box;
margin-bottom: 10px;
}
button {
padding: 10px;
background-color: #333;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
.comments-container {
margin-top: 20px;
}
.comment {
background-color: #f9f9f9;
padding: 10px;
border-radius: 4px;
margin-bottom: 10px;
}
.heading{
text-decoration: underline;
font-weight: bold;
margin-bottom: 1px;
}
.source{
margin-top:1px;
text-decoration:underline;
}
.rows{
display:flex;
flex-direction: row;
height: 80%;
align-items: center;
}
.cols{
flex-basis: 50%;
margin-top: 10px;
margin-bottom: 10px;
margin-right: 10%;
}
</style>
</head>
<body>
<header>
<h1>Forum</h1>
</header>
<main>
<div class="post-container">
<div class="row">
<div class="cols">
<h2 class="heading"> A SITUATION</h2>
<h6 class="source"> posted by:A J Rahman on 9/12/2023</h6>
<p> A man who got shot comes to me for treatment,what do i do?.Do i attend to his wounds and then call the police or call the police and then attend to his wounds?</p>
</div>
<div class="comments-container" id="commentsContainer">
<!-- Comments will be dynamically added here -->
</div>
<textarea id="commentContent" placeholder="Write your comment..."></textarea>
<button onclick="submitComment()">Submit Comment</button>
</div>
<div class="cols2">
</div>
</main>
<script>
function submitComment() {
const commentContent = document.getElementById('commentContent').value;
// Simulating a backend API call to add a comment
addComment(commentContent);
// Clear the textarea after submitting the comment
document.getElementById('commentContent').value = '';
}
function addComment(content) {
// Simulating a backend storage mechanism
const commentsContainer = document.getElementById('commentsContainer');
const commentDiv = document.createElement('div');
commentDiv.className = 'comment';
commentDiv.innerHTML = `<p>User: ${content}</p>`;
commentsContainer.appendChild(commentDiv);
}
</script>
</body>
</html>