generated from nighthawkcoders/Nighthawk-Pages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
annoucements.md
72 lines (71 loc) · 1.81 KB
/
annoucements.md
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
---
layout: base
title: Announcements
---
<html lang="en">
<style>
body {
background-color: #333;
color: #fff;
font-family: Arial, sans-serif;
}
.container {
max-width: 600px;
margin: 10px auto;
padding: 20px;
background-color: #153e8f;
border-radius: 8px;
}
h1 {
text-align: center;
}
.announcement-form {
display: flex;
margin-top: 20px;
}
input[type="text"] {
flex: 1;
padding: 10px;
border: none;
border-radius: 4px;
margin-right: 10px;
background-color: #ADD8E6;
color: #fff;
}
button {
padding: 10px 20px;
border: none;
border-radius: 4px;
background-color: #007bff;
color: #fff;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
</style>
<body>
<div class="container">
<h1>Announcements</h1>
<div id="announcements"></div>
<div class="announcement-form">
<input type="text" id="announcementText" placeholder="Write your announcement...">
<button onclick="postAnnouncement()">Post</button>
</div>
</div>
<script src="script.js"></script>
</body>
<script>
function postAnnouncement() {
var announcementText = document.getElementById('announcementText').value;
if (announcementText.trim() !== '') {
var announcementsDiv = document.getElementById('announcements');
var announcementElement = document.createElement('div');
announcementElement.className = 'announcement';
announcementElement.innerText = announcementText;
announcementsDiv.appendChild(announcementElement);
document.getElementById('announcementText').value = '';
}
}
</script>
</html>