-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
203 lines (180 loc) · 5.41 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Spotdlrobot Lyrics</title>
<meta name="keywords" content="programmer, developer, aliilapro, coder, spotify, deezer, youtube, lyrics, lyric">
<meta name="description" content="This project was produced by the spotdlrobot robot, which aims to make the lyrics of the song easier and faster to
access. Hoping that everyone can easily access the content...">
<meta property="og:title" content="Spotdlrobot Lyrics">
<meta property="og:type" content="website">
<meta property="og:description" content="This project was produced by the spotdlrobot robot, which aims to make the lyrics of the song easier and faster to
access. Hoping that everyone can easily access the content...">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<style>
* {
box-sizing: border-box;
}
body {
background-color: black;
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}
form {
margin-top: 20px;
display: flex;
justify-content: center;
align-items: center;
}
h1 {
color: #33ff00;
text-align: center;
font-family: monospace;
font-size: 3em;
}
p {
color: #eeeaea;
text-align: center;
font-family: monospace;
font-size: 2em;
padding: 0 10%;
margin: 1em 0;
}
input[type=text] {
padding: 10px;
border: none;
border-radius: 5px 0 0 5px;
width: 60%;
font-size: 16px;
}
button[type=submit] {
background-color: #4CAF50;
color: white;
padding: 10px;
border: none;
border-radius: 0 5px 5px 0;
cursor: pointer;
font-size: 16px;
}
button[type=submit]:hover {
background-color: #45a049;
}
#results {
padding: 5px;
margin: 30px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
ul {
list-style-type: none;
padding: 0;
margin: 0;
width: 100%;
max-width: 800px;
}
.open-button {
background-color: #bd5361;
color: white;
padding: 5px;
margin: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
}
.open-button:hover {
background-color: #45a049;
}
.topnav {
overflow: hidden;
background-color: black;
}
.topnav #donate {
float: right;
}
.topnav a {
float: left;
display: block;
color: #33ff00;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
font-family: monospace;
}
.topnav a:hover {
background-color: #9c999a;
color: #080808;
}
.topnav a.active {
background-color: #f5034b;
color: white;
}
@media only screen and (max-width: 600px) {
.topnav a {
float: none;
display: block;
text-align: left;
}
}
</style>
</head>
<body>
<div class="topnav">
<a class="active" href="#home">Home</a>
<a href="https://t.me/+dWK1tVb37MAyYjc0">Telegram Channel DB</a>
<a href="https://t.me/spotdlrobot">Robot</a>
<a id="line-count"></a>
</div>
<h1>Spotdlrobot->Lyrics</h1>
<p>This project was produced by the spotdlrobot robot, which aims to make the lyrics of the song easier and faster to
access. Hoping that everyone can easily access the content...</p>
<form onsubmit="searchText(); return false;">
<input type="text" placeholder="Search for lyrics..." name="search" id="search">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
<div id="results"></div>
<script>
async function searchText() {
const search = document.querySelector('#search').value.toLowerCase();
const searchWords = search.split(' ');
const response = await fetch('db.txt');
const text = await response.text();
const results = text.split('\n').filter(line => {
return searchWords.every(word => line.toLowerCase().includes(word));
});
const resultsContainer = document.querySelector('#results');
resultsContainer.innerHTML = '';
if (results.length === 0) {
resultsContainer.innerHTML = '<p>No results found.</p>';
} else {
const ul = document.createElement('ul');
results.forEach((result) => {
const li = document.createElement('button');
const regex = new RegExp(search, 'gi');
const formattedResult = `${result.replace(regex, match => `<strong>${match}</strong>`)} `;
li.innerHTML = formattedResult;
li.classList.add('open-button');
li.addEventListener('click', () => {
window.open('https://aliilapro.github.io/lyrics/ly/' + result, '_blank');
});
ul.appendChild(li);
});
resultsContainer.appendChild(ul);
}
}
async function countLines() {
const response = await fetch('db.txt');
const text = await response.text();
const lineCount = text.split('\n').length;
const lineCountElement = document.querySelector('#line-count');
lineCountElement.innerHTML = `Total Lyrics: ${lineCount}`;
}
countLines();
</script>
</body>
</html>