-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwatch.php
More file actions
245 lines (213 loc) · 6.99 KB
/
Copy pathwatch.php
File metadata and controls
245 lines (213 loc) · 6.99 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
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<?php
session_start();
if (!isset($_SESSION['username'])) {
header("Location: login.html");
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Attack on Titan - Watch Episodes</title>
<link rel="stylesheet" href="styles_ap.css" />
<style>
body {
font-family: Arial, sans-serif;
background-color: #121212;
color: white;
margin: 0;
padding: 0;
}
header, footer {
text-align: center;
padding: 1rem;
background-color: #1e1e1e;
}
main {
padding: 20px;
}
.season-episodes {
display: none;
margin-top: 20px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
}
.video-box {
background-color: #1f1f1f;
padding: 10px;
border-radius: 8px;
cursor: pointer;
position: relative;
}
.video-box h3 {
font-size: 16px;
margin: 5px 0;
}
.video-box video {
width: 100%;
border-radius: 5px;
max-height: 180px;
}
.now-watching {
position: absolute;
top: 8px;
left: 8px;
background-color: crimson;
padding: 3px 6px;
border-radius: 5px;
font-size: 12px;
}
.video-popup {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0,0,0,0.9);
display: none;
align-items: center;
justify-content: center;
flex-direction: column;
z-index: 1000;
}
.video-popup video {
width: 90%;
max-width: 1000px;
height: auto;
margin-bottom: 20px;
}
.video-popup button {
padding: 10px 20px;
background: crimson;
color: white;
border: none;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
}
select {
padding: 10px;
font-size: 16px;
margin-bottom: 20px;
width: 100%;
}
a {
display: block;
margin-top: 20px;
color: #66bfff;
text-align: center;
}
@media screen and (max-width: 600px) {
.video-box video {
max-height: 120px;
}
.video-popup video {
width: 100%;
}
}
</style>
</head>
<body>
<header>
<h1>Attack on Titan - Watch Episodes</h1>
</header>
<main>
<label for="seasonSelect"><strong>Select Season:</strong></label>
<select id="seasonSelect">
<option value="">-- Select Season --</option>
<option value="season1">Season 1</option>
<option value="season2">Season 2</option>
<option value="season3">Season 3</option>
<option value="season4">Season 4 (Final)</option>
</select>
<?php
$videoLinks = [
1 => ["https://www.w3schools.com/html/mov_bbb.mp4", "https://www.w3schools.com/html/movie.mp4", "https://www.w3schools.com/html/mov_bbb.mp4", "https://www.w3schools.com/html/movie.mp4", "https://www.w3schools.com/html/mov_bbb.mp4"],
2 => ["https://www.w3schools.com/html/movie.mp4", "https://www.w3schools.com/html/mov_bbb.mp4", "https://www.w3schools.com/html/movie.mp4", "https://www.w3schools.com/html/mov_bbb.mp4", "https://www.w3schools.com/html/movie.mp4"],
3 => ["https://www.w3schools.com/html/mov_bbb.mp4", "https://www.w3schools.com/html/movie.mp4", "https://www.w3schools.com/html/mov_bbb.mp4", "https://www.w3schools.com/html/movie.mp4", "https://www.w3schools.com/html/mov_bbb.mp4"],
4 => ["https://www.w3schools.com/html/movie.mp4", "https://www.w3schools.com/html/mov_bbb.mp4", "https://www.w3schools.com/html/movie.mp4", "https://www.w3schools.com/html/mov_bbb.mp4", "https://www.w3schools.com/html/movie.mp4"]
];
for ($season = 1; $season <= 4; $season++) {
echo "<div id='season$season' class='season-episodes'>";
foreach ($videoLinks[$season] as $index => $video) {
$episode = $index + 1;
echo "
<div class='video-box' onclick=\"openPlayer('$video', 'Attack on Titan', $episode, 'now-watching-$season-$episode')\">
<div class='now-watching' id='now-watching-$season-$episode' style='display:none;'>Now Watching</div>
<h3>Season $season - Episode $episode</h3>
<video muted>
<source src='$video' type='video/mp4'>
</video>
</div>";
}
echo "</div>";
}
?>
<a href="index.php">⬅ Back to Anime Showcase</a>
</main>
<div id="videoPopup" class="video-popup" style="display:none;">
<video id="fullscreenVideo" controls></video>
<button onclick="closePlayer()">Close</button>
</div>
<footer>
<p>© 2025 Anime Showcase. All rights reserved.</p>
</footer>
<script>
const seasonSelect = document.getElementById('seasonSelect');
const seasonSections = document.querySelectorAll('.season-episodes');
const videoPopup = document.getElementById('videoPopup');
const fullscreenVideo = document.getElementById('fullscreenVideo');
window.addEventListener('DOMContentLoaded', () => {
seasonSections.forEach(section => section.style.display = 'none');
// Optional: Auto-load last watched season
fetch('get_last_progress.php')
.then(res => res.json())
.then(data => {
const season = data.last_season;
if (season) {
const id = `season${season}`;
seasonSelect.value = id;
document.getElementById(id).style.display = 'grid';
}
}).catch(err => console.log("No last progress data"));
});
seasonSelect.addEventListener('change', () => {
seasonSections.forEach(section => section.style.display = 'none');
const selected = seasonSelect.value;
if (selected) {
document.getElementById(selected).style.display = 'grid';
}
});
function openPlayer(src, animeName, episodeNumber, labelId) {
fullscreenVideo.src = src;
fullscreenVideo.play();
videoPopup.style.display = 'flex';
document.querySelectorAll('.now-watching').forEach(label => label.style.display = 'none');
document.getElementById(labelId).style.display = 'inline-block';
saveProgress(animeName, episodeNumber);
}
function closePlayer() {
fullscreenVideo.pause();
fullscreenVideo.src = "";
videoPopup.style.display = 'none';
}
function saveProgress(animeName, episodeNumber) {
fetch('save_progress.php', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: `anime_name=${encodeURIComponent(animeName)}&episode_number=${encodeURIComponent(episodeNumber)}`
}).then(res => res.json())
.then(data => {
if (data.status === 'success') {
console.log('Progress saved!');
} else {
console.error('Save failed:', data.message);
}
});
}
</script>
</body>
</html>