forked from joereddington/reasdiary
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex3.html
More file actions
106 lines (98 loc) · 4.1 KB
/
index3.html
File metadata and controls
106 lines (98 loc) · 4.1 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Madlad2329's Profile</title>
<link rel="stylesheet" href="profile.css">
</head>
<body>
<nav class="navigation">
<div class="nav-container">
<a href="#" class="logo">PhotoShare</a>
<div class="nav-actions">
<a href="photologin.html" class="nav-button">Login</a>
</div>
</div>
</nav>
<div class="container">
<header class="profile-header">
<img src="images/profile3.png" alt="Rea's profile picture" class="profile-pic">
<div class="profile-info">
<h1>Madlad2329</h1>
<div class="profile-stats">
<span class="stat"><strong>3</strong> posts</span>
<span class="stat"><strong>42</strong> followers</span>
<span class="stat"><strong>99</strong> following</span>
</div>
<button class="follow-button">Follow</button>
<div class="bio">
I'm NOT telling you!
</div>
</div>
</header>
<main class="photo-grid">
<div class="photo-item" data-caption="Stupid Buses! The 5 is always out of service! I have to walk 40 minutes home now! ">
<img src="images/bus.png" alt="It's a picture of a bus in Glasgow">
<div class="photo-overlay">❤️ 1</div>
</div>
<div class="photo-item" data-caption="Finally got my Octo 9 - it's over for you slugs Skibbi">
<img src="images/control.png" alt="Training session">
<div class="photo-overlay">❤️ 9</div>
</div>
<div class="photo-item" data-caption="Some smug scum tagging in our streets, you'd better watch yerself!!!!111!">
<img src="images/wall.png" alt="A wall">
<div class="photo-overlay">❤️ 23</div>
</div>
</main>
</div>
<!-- Modal -->
<div class="modal">
<span class="close-modal">×</span>
<div class="modal-content">
<div class="modal-image">
<img src="" alt="Modal image">
</div>
<div class="modal-details">
<div class="modal-header">
<img src="images/profile3.png" alt="Profile picture" class="modal-profile-pic">
<span class="modal-username">Madlad2329</span>
</div>
<p class="modal-caption"></p>
<div class="modal-stats">
<span class="modal-likes"></span>
</div>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const modal = document.querySelector('.modal');
const modalImage = modal.querySelector('.modal-image img');
const modalCaption = modal.querySelector('.modal-caption');
const modalLikes = modal.querySelector('.modal-likes');
const closeModal = modal.querySelector('.close-modal');
document.querySelectorAll('.photo-item').forEach(item => {
item.addEventListener('click', () => {
const img = item.querySelector('img');
const likes = item.querySelector('.photo-overlay').textContent;
const caption = item.dataset.caption;
modalImage.src = img.src;
modalImage.alt = img.alt;
modalCaption.textContent = caption;
modalLikes.textContent = likes;
modal.classList.add('active');
});
});
closeModal.addEventListener('click', () => {
modal.classList.remove('active');
});
modal.addEventListener('click', (e) => {
if (e.target === modal) {
modal.classList.remove('active');
}
});
});
</script>
</body>
</html>