-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
136 lines (127 loc) · 6.5 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
<!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>Chat - iCodeThis.com</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;1,100;1,200&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<link href="styles.css" rel="stylesheet" media="all" type="text/css">
</head>
<body>
<br>
<div id="main">
<div class="activity"></div>
<br>
<div id="arrow"></div>
<div class="content hidden">
<div class="clean">You have no new notifications!</div>
<div class="user" style="display: none;">
<div>
<img src="https://pbs.twimg.com/profile_images/1633847644966772737/m8yU9m0A_400x400.jpg" width="70" alt="">
</div>
<div>
<h2>iCodeThis.com <span>liked your code</span></h2>
<p style="color:#5eb806">just now</p>
<div class="close"></div>
</div>
</div>
<div class="user">
<div>
<img src="https://pbs.twimg.com/profile_images/1607804678472859650/1r9CwGYz_400x400.jpg" width="70" alt="">
</div>
<div>
<h2>Cora Jenkins <span>followed you.</span></h2>
<p>2 hours ago</p>
<div class="close"></div>
</div>
</div>
<div class="user">
<div>
<img src="https://pbs.twimg.com/profile_images/1558156268841455618/YRQXaP3k_400x400.jpg" width="70" alt="">
</div>
<div>
<h2>Emily Ross <span>added a comment.</span></h2>
<p>2 hours ago</p>
<div class="close"></div>
</div>
</div>
<div class="user">
<div>
<img src="https://pbs.twimg.com/profile_images/1626691866300239875/xAvTU3OE_400x400.jpg" width="70" alt="">
</div>
<div>
<h2>Ora Larson <span>liked your comment</span></h2>
<p>2 hours ago</p>
<div class="close"></div>
</div>
</div>
<div class="user">
<div>
<img src="https://pbs.twimg.com/profile_images/1619785307955552256/oRT-lbNW_400x400.jpg" width="70" alt="">
</div>
<div>
<h2>Jeanette Norris <span>followed you.</span></h2>
<p>2 hours ago</p>
<div class="close"></div>
</div>
</div>
<script>
const activityDiv = document.querySelector('.activity');
const contentDiv = document.querySelector('.content');
const arrowDiv = document.getElementById('arrow');
activityDiv.addEventListener('click', () => {
contentDiv.style.display = 'block';
arrowDiv.style.display = 'block';
document.querySelector('.activity').style.animation = 'none';
setTimeout(function(){
var divs = document.getElementsByClassName('user');
for (var i = 0; i < 1; i++) {
divs[i].style.display = 'flex';
divs[i].style.background = '#edf3fc';
}
}, 2500);
});
const buttons = document.querySelectorAll('.close');
buttons.forEach(button => {
button.addEventListener('click', () => {
const parentNode = button.closest('.user');
const parentClass = 'user';
if (parentNode.classList.contains(parentClass)) {
parentNode.style.height = `${parentNode.offsetHeight}px`;
parentNode.style.transitionProperty = 'height, margin, padding';
parentNode.style.transitionDuration = '0.5s';
parentNode.style.overflow = 'hidden';
parentNode.style.height = 0;
parentNode.style.paddingTop = 0;
parentNode.style.paddingBottom = 0;
parentNode.style.marginTop = 0;
parentNode.style.marginBottom = 0;
parentNode.style.opacity = 0;
setTimeout(() => {
parentNode.style.display = 'none';
parentNode.remove();
}, 500);
const userDivs = document.querySelectorAll('.user').length - 1;
if(userDivs === 0) {
document.querySelector('.clean').style.display = 'block';
document.querySelector('.activity').style.animation = 'none';
document.querySelector('button').remove();
}
else {
document.querySelector('.clean').style.display = 'none';
//document.querySelector('.activity').style.animation = 'dingding 0.9s linear infinite';
}
}
});
});
</script>
<br>
<button>View All</button>
</div>
</div>
</body>
</html>