This repository has been archived by the owner on Nov 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
104 lines (83 loc) · 3.51 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
<html>
<head>
<!-- Primary Meta Tags -->
<title>Rickroll Cast</title>
<meta name="title" content="Rickroll Cast - Prank the whole house">
<meta name="description" content="Rickroll any Google Cast enabled device, or even every device on your Wi-Fi.">
<meta name="viewport" content="width=device-width, initial-scale=.85">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://vanceagher.github.io/rickrollcast">
<meta property="og:title" content="Rickroll Cast - Prank the whole house">
<meta property="og:description" content="Rickroll any Google Cast enabled device, or even every device on your Wi-Fi.">
<meta property="og:image" content="https://github.com/Vanceagher/rickrollcast/blob/main/logo.jpg?raw=true">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://vanceagher.github.io/rickrollcast">
<meta property="twitter:title" content="Rickroll Cast - Prank the whole house">
<meta property="twitter:description" content="Rickroll any Google Cast enabled device, or even every device on your Wi-Fi.">
<meta property="twitter:image" content="https://github.com/Vanceagher/rickrollcast/blob/main/logo.jpg?raw=true">
<link rel="shortcut icon" type="image/jpg" href="https://raw.githubusercontent.com/Vanceagher/rickrollcast/main/favicon.ico"/>
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css2?family=Nunito&display=swap" rel="stylesheet">
<script src="https://castjs.io/cast.min.js"></script>
</head>
<div class="center">
<button id="cast">📢 RICKROLL 'EM</button>
<div class="slidecontainer">
<input type="range" min="0" step="0.001" max="1" value=".1" class="slider" id="myRange">
<h1>VOLUME</h1>
<p>Value: <span id="demo"></span></p>
</div>
<button id="pause">🤐 GAG RICK</button>
<br>
<button id="resume">😀 UNGAG RICK</button>
<br>
<button id="spare">😵 KILL RICK</button>
</div>
<script>
// Create new Castjs instance
const cjs = new Castjs();
// Wait for user interaction
document.getElementById('cast').addEventListener('click', function() {
navigator.vibrate([5]);
// Check if casting is available
if (cjs.available) {
// Initiate new cast session
var metadata = {
title: 'Get Rickrolled!',
description: "It's actually a pretty good song."
}
cjs.cast('https://rickrollcast.netlify.app/rickroll.mp4', metadata);
}
});
setInterval(function(){
var slider = document.getElementById("myRange");
var output = document.getElementById("demo");
output.innerHTML = slider.value;
var volumeraw = slider.value
var volumeslide = Math.round(100*volumeraw)/100;
output.innerHTML = volumeslide;
const cjs = new Castjs();
cjs.volume(volumeslide);
}, 100);
document.getElementById("pause").addEventListener("click", function() {
cjs.pause();
navigator.vibrate([5]);
});
document.getElementById("resume").addEventListener("click", function() {
cjs.play();
navigator.vibrate([5]);
});
document.getElementById("spare").addEventListener("click", function() {
navigator.vibrate([5]);
cjs.disconnect();
document.getElementById("spare").style.background = "#ba344d";
document.getElementById("spare").style.color = "#1c1c28";
setTimeout(function(){
document.getElementById("spare").style.background = "#1c1c28";
document.getElementById("spare").style.color = "#fff";
}, 3000);
});
</script>
</html>