-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
138 lines (91 loc) · 5.13 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport" />
<title>Rain with music</title>
<link rel="stylesheet" href="style.css">
<link rel="icon" href="favicon.ico">
<script src="index.js"></script>
<link rel="canonical" href="https://rain-yt.vercel.app/" />
<link rel="manifest" href="/manifest.webmanifest">
</head>
<body>
<!--remove -->
<script>
if (navigator.serviceWorker) {
navigator.serviceWorker.register (
'/sw.js',
{scope: '/'}
)
}
</script>
<!--remove -->
<section>
<div class="iframeContainer">
<div class="search">
<a href="" id=lnk></a> <br>
<input type='text' id='userInput' class='form-control' value='' placeholder="Enter video or playlist link or ID" />
<input type='button' id='myBtn' class='btn-outline-secondary' onclick='changeText2()' value='Go!' />
</div>
<iframe id="mainframe" class="iframeContent" src="https://www.youtube.com/embed/videoseries?si=vpMvKSHRp4MlEmcr&list=PLjE24dapzlxRl42ELixBrgrIkxo56krTq&autoplay=1&showinfo=0&loop=1&rel=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<!-- -->
<script type="text/javascript">
const rndInt0 = Math.floor(Math.random() * 200) + 1;
url0 = "https://www.youtube.com/embed/?list=PLjE24dapzlxRl42ELixBrgrIkxo56krTq&index=" + rndInt0.toString() + "&autoplay=1&showinfo=0&loop=1&rel=0";
document.getElementById("mainframe").src=url0;
</script>
<!-- -->
<h1 class="credit">Rain effect <a href="https://github.com/SardineFish/raindrop-fx/tree/master" target="_blank">credits</a></h1>
</div>
<div id="root">
<canvas id="canvas"></canvas>
</div>
<script src="script.js"></script>
<script type="text/javascript">
function changeText2() {
const rndInt = Math.floor(Math.random() * 200) + 1;
var userInput = document.getElementById('userInput').value;
var lnk = document.getElementById('lnk');
//
var url
if (!userInput.length){
url = "https://www.youtube.com/embed/?list=PLjE24dapzlxRl42ELixBrgrIkxo56krTq&index=" + rndInt.toString() + "&autoplay=1&showinfo=0&loop=1&rel=0";
// url = "https://www.youtube.com/embed/videoseries?si=vpMvKSHRp4MlEmcr&list=PLjE24dapzlxRl42ELixBrgrIkxo56krTq&autoplay=1&showinfo=0&loop=1&rel=0";
}
else if (userInput.length === 11) {
url = "https://www.youtube.com/embed/"+ userInput +"?si=CB4a528bXk0qmyPT"+"&autoplay=1&showinfo=0&loop=1&rel=0";
}
else if (userInput.length > 34) {
if ( userInput.split('=').length === 2 ) {
url = "https://www.youtube.com/embed/"+ userInput.split('=').at(-1) +"?si=CB4a528bXk0qmyPT"+"&autoplay=1&showinfo=0&loop=1&rel=0";
}
else {
url = "https://www.youtube.com/embed/?list=" + userInput.split('=').at(-1) + "&index=" + rndInt.toString() + "&autoplay=1&showinfo=0&loop=1&rel=0";
// url= "https://www.youtube.com/embed/videoseries?si=vpMvKSHRp4MlEmcr&list="+userInput.split('=').at(-1)+"&autoplay=1&showinfo=0&loop=1&rel=0" ;
}
}
else {
url = "https://www.youtube.com/embed/?list=" + userInput + "&index=" + rndInt.toString() + "&autoplay=1&showinfo=0&loop=1&rel=0";
// url= "https://www.youtube.com/embed/videoseries?si=vpMvKSHRp4MlEmcr&list="+userInput+"&autoplay=1&showinfo=0&loop=1&rel=0" ;
}
//
// var url= "https://www.youtube.com/embed/videoseries?si=vpMvKSHRp4MlEmcr&list="+userInput+"&autoplay=1&showinfo=0&loop=1&rel=0" ;
document.getElementById("mainframe").src=url;
}
var input = document.getElementById("userInput");
input.addEventListener("keyup", function(event) {
if (event.keyCode === 13) {
event.preventDefault();
document.getElementById("myBtn").click();
}
});
var input = document.querySelectorAll('input');
for(i=0; i<input.length; i++){
input[i].setAttribute('size',input[i].getAttribute('placeholder').length);
}
</script>
</section>
</body>
</html>