-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
73 lines (63 loc) · 2.19 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>YouTube Music</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header id="titlebar">
<div id="drag-region">
<div id="window-title">
<span>YouTube Music</span>
</div>
<div id="window-controls">
<div onclick="minimizeapp()" class="button" id="min-button">
<img class="icon" srcset="icons/min-w-10.png" draggable="false" />
</div>
<div class="button" onclick="openFullscreen()" id="max-button">
<img class="icon" srcset="icons/fullscreen1.png" draggable="false" />
</div>
<div onclick="closeFullscreen()" class="button" id="restore-button">
<img class="icon" srcset="icons/fullscreen2.png" draggable="false" />
</div>
<div onclick="closeapp()" class="button" id="close-button">
<img class="icon" srcset="icons/close-w-10.png 1x, icons/close-w-12.png 1.25x, icons/close-w-15.png 1.5x, icons/close-w-15.png 1.75x, icons/close-w-20.png 2x, icons/close-w-20.png 2.25x, icons/close-w-24.png 2.5x, icons/close-w-30.png 3x, icons/close-w-30.png 3.5x" draggable="false" />
</div>
</div>
</div>
</header>
<div id="main">
<webview src="https://music.youtube.com/" id="app"></webview>
<script>
const {electron, ipcRenderer} = require('electron');
const elem = document.documentElement;
/* View in fullscreen */
function openFullscreen() {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.webkitRequestFullscreen) { /* Safari */
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { /* IE11 */
elem.msRequestFullscreen();
}
}
/* Close fullscreen */
function closeFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitExitFullscreen) { /* Safari */
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) { /* IE11 */
document.msExitFullscreen();
}
}
function minimizeapp() {
ipcRenderer.send('minimize-app');
}
function closeapp() {
ipcRenderer.send('close-app');
}
</script>
</body>
</html>