-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
78 lines (68 loc) · 1.88 KB
/
script.js
File metadata and controls
78 lines (68 loc) · 1.88 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
// List of allowed phrases
const allowedPhrases = [
"Billy Herrington",
"Danny Lee",
"Van Darkholme",
"Boss of this gym",
"Professional Muscular Pants Wrestling",
"House of Detention",
"Bad Gay Porn Acting 4",
"Deep Dark Fantasies",
"Mark Wolff",
"Ricardo Milos",
"Aka-san",
"FunnyCraftTeam",
"GachiGASM",
"Another victim",
"Fisting is 300$",
"Swallow my cum",
"Fucking slaves",
"Fuck you, Leatherman",
"Boy next door",
"Stick your finger in my ass",
"I am taking that ass"
];
// Current phrase index (cycles through the list)
let currentPhraseIndex = 0;
// DOM elements
const searchInput = document.getElementById("main__search-input");
// Function to replace input text with characters from the current phrase
function replaceInputWithPhrase(inputText) {
const currentPhrase = allowedPhrases[currentPhraseIndex];
let result = "";
for (let i = 0; i < inputText.length; i++) {
if (i >= currentPhrase.length) {
break;
}
result += currentPhrase[i] || "";
}
searchInput.value = result;
}
// Input event listener
searchInput.addEventListener("input", function () {
replaceInputWithPhrase(searchInput.value);
});
// Enter key event listener
searchInput.addEventListener('keydown', function (event) {
if (event.key === 'Enter') {
const query = searchInput.value;
if (query) {
// Trigger search button click to play sound and redirect via sound.js
document.getElementById('main__search-button').click();
}
}
});
// Function to cycle through phrases
function cyclePhrases() {
currentPhraseIndex = (currentPhraseIndex + 1) % allowedPhrases.length;
}
// Change phrase if the input is cleared
searchInput.addEventListener('input', function () {
if (searchInput.value === "") {
cyclePhrases();
}
});
// Auto-focus search input on page load
window.addEventListener('load', function () {
searchInput.focus();
});