-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
197 lines (174 loc) · 5.97 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
<html>
<head>
<title>Gitlab Meeting Simulator 2024</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Caveat:[email protected]&display=swap" rel="stylesheet">
<style>
body {
font-family: 'monospace';
margin: 0;
padding: 0;
background-color: #f0f0f0;
}
a {
color: black;
}
h3 {
font-family: 'Courier New', Courier, monospace;
}
header {
padding: 1em;
}
nav {
display: flex;
padding: .5em;
}
nav a, nav button {
margin: 0 .5em;
padding: .5em;
border: 1px solid black;
border-radius: 5px;
background-color: white;
cursor: pointer;
}
#video-container {
position: relative;
}
#video {
position: absolute;
margin: .6vw 0 0 1.2vw;
top: 0;
left: 0;
z-index: 1;
}
#canvas {
position: absolute;
margin: .6vw 0 0 1.2vw;
top: 0;
left: 0;
z-index: 2;
cursor: pointer;
}
#error {
position: absolute;
margin: .6vw 0 0 1.2vw;
top: 0;
left: 0;
z-index: 3;
color: rgb(203, 0, 0);
}
.stealth #testimonials, .stealth nav, .stealth header {
display: none;
}
#testimonials {
margin: 0 1.2vw;
}
#testimonials blockquote {
font-family: 'Times New Roman', Times, serif;
/* italic */
font-style: italic;
font-size: 1.2em;
margin: 1.2vw 0;
}
blockquote::after {
content: '”';
}
blockquote::before {
content: '“';
}
</style>
</head>
<body>
<header>
<h3>Gitlab Meeting Simulator 2024</h3>
<p>Pretend to work from Gitlab with Gitlab Meeting Simulator 2024.</p>
</header>
<nav>
<a href="https://twitter.com/pronounced_kyle/status/1757215139550605713?t=kcF4t6pRd0UtPYvkx4loDg" target="_blank">What?</a>
<button onclick="setName()">Set Name</button>
<button onclick="stealth()">Stealth</button>
</nav>
<div id="video-container">
<iframe width="1800" height="1012" src="https://www.youtube.com/embed/rOqgRiNMVqg?si=3SfTtbfCU52oR3TO&start=7?autoplay=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<!-- <iframe width="560" height="315" src="https://www.youtube.com/embed/lBVtvOpU80Q?si=0wwGwxJ21aeiREmw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> -->
<canvas onclick="setName()" id="canvas" width="586" height="328"></canvas>
<video id="video" width="586" height="328"></video>
<p id="error"></p>
</div>
<div id="testimonials">
<h2>Testimonials from YouTube</h2>
<blockquote>I play this when I need my family to leave me alone - so helpful</blockquote>
<blockquote>Im not ready to tell my parents that i resigned my job, so i was telling them im working from home and play this every morning so they would stop bothering me. This is a lifesaver!</blockquote>
<blockquote>I've watched this 30 times and I have no idea what Gitlab is.</blockquote>
</div>
<script>
let userName = 'John Smith';
function setName() {
userName = prompt('Enter your name');
}
function stealth() {
// add 'stealth' class to the body
document.body.classList.add('stealth');
}
// when the window is resized, resize the canvas
window.addEventListener('resize', resizeCanvas);
// resize the canvas when the page loads
resizeCanvas();
function resizeCanvas() {
// set everything to the width of the viewport
const canvas = document.getElementById('canvas');
const video = document.getElementById('video');
const clientWidth = document.documentElement.clientWidth;
const aspectRatio = 1800 / 1012;
const youtube = document.querySelector('iframe');
youtube.width = clientWidth;
youtube.height = clientWidth / aspectRatio;
canvas.width = clientWidth / 3 * .98;
canvas.height = clientWidth / aspectRatio / 3 * 0.98;
video.width = clientWidth / 3 * .98;
video.height = clientWidth / aspectRatio / 3 * 0.98;
}
// Get the users webcam stream and play it in the canvas
try {
const video = document.getElementById('video');
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
navigator.mediaDevices.getUserMedia({ video: true, facingMode: "user" })
.then((stream) => {
video.srcObject = stream;
video.play();
let delay = 1000 / 30;
setInterval(() => {
// copy the video feed to the canvas and crop it so it fits the size of the canvas without distoring the aspect ratio
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
// blur the image a little
ctx.filter = 'blur(1px)';
ctx.fillStyle = 'rgba(0, 0, 0, 0.5)';
ctx.fillRect(0, canvas.height - canvas.height / 8, canvas.width / 2, canvas.height / 8);
// in the bottom left corner of the canvas, draw the name 'Gitlab Employee #3438' in white
ctx.fillStyle = 'white';
// set fontsize by the width of the canvas
ctx.font = `${canvas.height / 14}px Arial`;
ctx.fillText(`${userName}`, canvas.width / 100, canvas.height * .96);
}, 1000 / 30);
})
.catch((err) => {
console.log('Error accessing the camera', err);
document.getElementById('error').innerText = 'Error accessing the camera';
});
} catch (err) {
document.getElementById('error').innerText = `${err}`;
}
const ctx = canvas.getContext('2d');
// fill the entire canvas with yellow
ctx.fillStyle = 'black';
ctx.fillRect(0, 0, canvas.width, canvas.height);
// In the center of the canvas draw "Camera off" in white
ctx.fillStyle = 'white';
// bold font
ctx.font = '24px Arial';
ctx.fillText('Camera off', canvas.width / 2 - 70, canvas.height / 2);
</script>
</body>
</html>