-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
207 lines (194 loc) · 6.02 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- displays site properly based on user's device -->
<link
rel="icon"
type="image/png"
sizes="32x32"
href="./assets/images/favicon-32x32.png"
/>
<link rel="stylesheet" href="css/main.css" />
<title>Notifications page</title>
<!-- Feel free to remove these styles or customise in your own stylesheet 👍 -->
<style>
.attribution {
font-size: 11px;
text-align: center;
padding: 3rem 0;
}
.attribution a {
color: hsl(228, 45%, 44%);
}
</style>
</head>
<body>
<main>
<div class="container">
<div class="wrapper">
<div class="header">
<h1 data-count="3">Notifications</h1>
<button id="marked-all">Mark all as read</button>
</div>
<div class="notification">
<div>
<img
src="assets/images/avatar-mark-webber.webp"
alt="mark webber"
/>
</div>
<div>
<p>
<a href="#" class="notification__link notification__link-name"
>Mark Webber</a
>
reacted to your recent post
<a href="#" class="notification__link"
>My first tournament today!</a
>
</p>
<div>1m ago</div>
</div>
</div>
<div class="notification">
<div>
<img
src="assets/images/avatar-angela-gray.webp"
alt="angela gray"
/>
</div>
<div>
<p>
<a href="#" class="notification__link notification__link-name"
>Angela Gray</a
>
followed you
</p>
<div>5m ago</div>
</div>
</div>
<div class="notification">
<div>
<img
src="assets/images/avatar-jacob-thompson.webp"
alt="jacob thompson"
/>
</div>
<div>
<p>
<a href="#" class="notification__link notification__link-name"
>Jacob Thompson</a
>
has joined your group
<a href="#" class="notification__link">Chess Club</a>
</p>
<div>1 day ago</div>
</div>
</div>
<div class="notification read">
<div>
<img
src="assets/images/avatar-rizky-hasanuddin.webp"
alt="rizky hasanuddin"
/>
</div>
<div>
<p>
<a href="#" class="notification__link notification__link-name"
>Rizky Hasanuddin</a
>
sent you a private message
</p>
<div>5 days ago</div>
<a href="#" class="notification__message">
Hello, thanks for setting up the Chess Club. I've been a member
for a few weeks now and I'm already having lots of fun and
improving my game.
</a>
</div>
</div>
<div class="notification read">
<div>
<img
src="assets/images/avatar-kimberly-smith.webp"
alt="kimberly smith"
/>
</div>
<div>
<p>
<a href="#" class="notification__link notification__link-name"
>Kimberly Smith</a
>
commented on your picture
</p>
<div>1 week ago</div>
</div>
<div class="picture__wrapper">
<img
src="assets/images/image-chess.webp"
alt="image of a person playing chess"
/>
</div>
</div>
<div class="notification read">
<div>
<img
src="assets/images/avatar-nathan-peterson.webp"
alt="nathan peterson"
/>
</div>
<div>
<p>
<a href="#" class="notification__link notification__link-name"
>Nathan Peterson</a
>
reacted to your recent post
<a href="#" class="notification__link"
>5 end-game strategies to increase your win rate</a
>
</p>
<div>2 weeks ago</div>
</div>
</div>
<div class="notification read">
<div>
<img src="assets/images/avatar-anna-kim.webp" alt="ana kim" />
</div>
<div>
<p>
<a href="#" class="notification__link notification__link-name"
>Anna Kim</a
>
left the group
<a href="#" class="notification__link">Chess Club</a>
</p>
<div>2 weeks ago</div>
</div>
</div>
</div>
<div class="attribution">
Challenge by
<a href="https://www.frontendmentor.io?ref=challenge" target="_blank"
>Frontend Mentor</a
>. Coded by <a href="#">John Denver Bidong</a>.
</div>
</div>
</main>
<script>
const button = document.getElementById("marked-all");
const notifNumber = document.querySelector("[data-count]");
button.addEventListener("click", function (e) {
const unreadNotif = document.querySelectorAll(
`.notification:not(.notification.read)`
);
if ([...unreadNotif].length === 0) return;
notifNumber.dataset.count = 0;
unreadNotif.forEach((notif) => {
notif.classList.add("read");
});
});
</script>
</body>
</html>