-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
267 lines (238 loc) · 8.76 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
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nazeef-Tube</title>
<link href="https://fonts.googleapis.com/css2?family=Aref+Ruqaa&display=swap" rel="stylesheet">
<link rel="icon" href="icon-nazeef.ico" type="image/x-icon">
<style>
body {
background-image: url('background-image.jpg');
background-size: cover;
font-family: 'Aref Ruqaa', Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.content-container {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.search-container {
padding: 5px;
background-color: rgba(173, 216, 230, 0.5);
border-radius: 20px;
box-shadow: 0 0 40px rgba(173, 216, 230, 0.7);
margin-bottom: 20px;
}
input[type="text"] {
width: 550px;
height: 40px;
padding: 10px;
border: none;
border-radius: 20px;
outline: none;
box-shadow: 0 0 10px rgba(173, 216, 230, 0.7);
font-size: 25px;
color: black;
vertical-align: middle;
font-family: 'Aref Ruqaa', Arial, sans-serif;
background-color: transparent; /* Set the background to transparent */
}
input[type="text"]:focus {
border: 2px solid #000000;
}
button {
padding: 10px 20px;
border: 2px solid #030303;
border-radius: 15px;
background-color: transparent;
color: #000000;
cursor: pointer;
font-size: 30px;
outline: none;
height: 50px;
vertical-align: middle;
font-family: 'Aref Ruqaa', Arial, sans-serif;
line-height: 15px; /* Add this line */
}
.channel-container {
text-align: center;
}
.channel-list-container {
background-color: black;
border-radius: 10px;
padding: 5px;
text-align: justify;
margin-bottom: 20px;
width: 650px; /* Set the width of the channel list */
max-height: 200px; /* Set the maximum height for the scroll bar */
overflow-y: auto; /* Add vertical scroll bar when content exceeds the max height */
display: flex;
flex-direction: column;
align-items: center; /* Center align horizontally */
margin: 0 auto; /* Center horizontally */
}
.channel-list-container::-webkit-scrollbar {
width: 10px; /* Width of the scrollbar */
}
.channel-list-container::-webkit-scrollbar-thumb {
background-color: #2c3032; /* Color of the scrollbar thumb */
border-radius: 5px; /* Rounded corners for the thumb */
}
.channel-box {
background-color: #2c3032; /* Set the background color of the channel box */
border-radius: 10px;
padding: 10px;
margin-bottom: 10px;
}
.channel-name {
color: white;
font-family: 'Aref Ruqaa', Arial, sans-serif;
text-decoration: none;
display: block;
width: 550px; /* Set the width to match the container */
background-color: #2c3032; /* Set the background color */
border-radius: 5px; /* Add rounded corners */
margin: 5px 0; /* Add some vertical margin for spacing */
}
.add-channel {
display: flex;
align-items: center;
color: white;
font-size: 20px;
cursor: pointer;
margin-top: 10px;
}
.add-icon {
margin-right: 5px;
}
.add-popup {
display: none;
position: absolute;
background-color: white;
border-radius: 10px;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
flex-direction: column; /* Stack items vertically */
align-items: flex-start; /* Align items to the start of the column */
}
.add-popup.show {
display: block;
}
</style>
</head>
<body>
<div class="content-container">
<div class="search-container">
<input type="text" id="searchInput" placeholder="ماذا تريد؟">
<button id="searchButton">ابحث</button>
</div>
<div class="channel-container">
<div class="channel-list-container">
<ul id="channelList">
<!-- Add more channels here -->
</ul>
<div class="add-channel" id="addChannelButton">
<span class="add-icon">+</span> أضف المزيد
</div>
<div class="add-popup" id="addChannelPopup">
<input type="text" id="newChannelName" placeholder="اسم القناة">
<input type="text" id="newChannelURL" placeholder="رابط القناة">
<button id="saveChannelButton">أضف القناة</button>
</div>
</div>
</div>
</div>
<script>
const searchInput = document.getElementById('searchInput');
const searchButton = document.getElementById('searchButton');
const channelList = document.getElementById('channelList');
const addChannelButton = document.getElementById('addChannelButton');
const addChannelPopup = document.getElementById('addChannelPopup');
const newChannelNameInput = document.getElementById('newChannelName');
const newChannelURLInput = document.getElementById('newChannelURL');
const saveChannelButton = document.getElementById('saveChannelButton');
searchButton.addEventListener('click', redirectToSearch);
searchInput.addEventListener('keydown', (event) => {
if (event.key === 'Enter') {
redirectToSearch();
}
});
function redirectToSearch() {
const searchQuery = searchInput.value;
if (searchQuery) {
window.open(`https://www.youtube.com/results?search_query=${searchQuery}`);
}
}
addChannelButton.addEventListener('click', () => {
addChannelPopup.classList.toggle('show');
});
saveChannelButton.addEventListener('click', () => {
const newChannelName = newChannelNameInput.value;
const newChannelURL = newChannelURLInput.value;
if (newChannelName && newChannelURL) {
const newChannelLink = document.createElement('a');
newChannelLink.className = 'channel-name';
newChannelLink.href = newChannelURL;
newChannelLink.textContent = newChannelName;
const newChannelItem = document.createElement('li');
newChannelItem.className = 'channel-box';
newChannelItem.appendChild(newChannelLink);
channelList.appendChild(newChannelItem);
newChannelNameInput.value = '';
newChannelURLInput.value = '';
addChannelPopup.classList.remove('show');
// Save the channel to local storage
saveChannelToLocalStorage(newChannelName, newChannelURL);
}
});
function saveChannelToLocalStorage(name, url) {
const savedChannels = getSavedChannelsFromLocalStorage();
savedChannels.push({ name, url });
localStorage.setItem('channels', JSON.stringify(savedChannels));
}
function getSavedChannelsFromLocalStorage() {
const savedChannelsJSON = localStorage.getItem('channels');
return savedChannelsJSON ? JSON.parse(savedChannelsJSON) : [];
}
function loadSavedChannels() {
const savedChannels = getSavedChannelsFromLocalStorage();
savedChannels.forEach(channel => {
const newChannelLink = document.createElement('a');
newChannelLink.className = 'channel-name';
newChannelLink.href = channel.url;
newChannelLink.textContent = channel.name;
const newChannelItem = document.createElement('li');
newChannelItem.className = 'channel-box';
newChannelItem.appendChild(newChannelLink);
channelList.appendChild(newChannelItem);
});
}
// Load saved channels on page load
loadSavedChannels();
// Function to update the visibility of the channel list container
function updateChannelListContainerVisibility() {
const currentDay = new Date().getDay(); // 0 (Sunday) to 6 (Saturday)
const currentHour = new Date().getHours(); // 0 to 23
// Get the channel list container element
const channelListContainer = document.querySelector('.channel-list-container');
// Check if it's Friday and the time is between 1pm and 6pm
if (currentDay === 5 && (currentHour >= 13 && currentHour <= 18)) {
channelListContainer.style.display = 'block';
} else {
channelListContainer.style.display = 'none';
}
}
// Call the function initially to set the visibility
updateChannelListContainerVisibility();
// Update the visibility every minute
setInterval(updateChannelListContainerVisibility, 60000);
</script>
</body>
</html>