-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
84 lines (70 loc) · 3.09 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Let's go Justin! | Street Fighter | Evo Moment #37 | Daigo Parry</title>
<meta name="description" content="Most notably seen at Evo 2004's SF3 tournament, where the infamous Daigo (as Ken) parried and punished all 17 hits of Justin's (as Chun-Li) super art with only a pixel of health left. Justin has genuine PTSD from the experience">
<link rel="shortcut icon" href="assets/favicon.ico">
<link rel="icon" type="image/png" href="assets/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="assets/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="assets/favicon-192x192.png" sizes="192x192">
<link rel="apple-touch-icon" href="assets/apple-touch-icon.png">
<style>
body,
html {
padding: 0;
margin: 0;
background-color: black;
}
#github-link {
width: 2.0em;
height: 2.0em;
padding: 1em;
position: absolute;
right: 0px;
}
#video-player {
width: 100%;
height: auto;
object-fit: fill;
position: absolute;
visibility: hidden;
}
</style>
</head>
<body>
<a id="github-link" href="https://github.com/hackerwgf/LetsGoJustin">
<img width="100%" height="100%" alt="Github logo" src="assets/github-mark-white.png" />
</a>
<video id="video-player" poster="assets/daigo-vs-justin-evo-2004-720p.jpeg" controls playsinline>
<source src="assets/daigo-vs-justin-evo-2004-720p.mp4" type="video/mp4">
</video>
<script>
function computeVideoPlayerLayout() {
let player = document.getElementById("video-player");
let githubLinkHeight = document.getElementById("github-link").offsetHeight;
let contentHeight = window.innerHeight - githubLinkHeight;
let scale = 1280 / 720;
if (window.innerWidth / contentHeight > scale) {
playerHeight = contentHeight >= 720 ? 720 : contentHeight
playerWidth = 1280 * playerHeight / 720;
} else {
playerWidth = window.innerWidth >= 1280 ? 1280 : window.innerWidth
playerHeight = playerWidth * 720 / 1280;
}
player.style.width = playerWidth + "px";
player.style.height = playerHeight + "px";
let leftOffset = (window.innerWidth - playerWidth) / 2;
let topOffset = (contentHeight - playerHeight) / 2;
player.style.left = (leftOffset <= 0 ? 0 : leftOffset) + "px";
player.style.top = (topOffset <= 0 ? githubLinkHeight : githubLinkHeight + topOffset) + "px";
}
window.onload = (event) => {
computeVideoPlayerLayout();
document.getElementById("video-player").style.visibility = "visible";
}
window.onresize = (event) => computeVideoPlayerLayout();
</script>
</body>
</html>