-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvnc.html
More file actions
110 lines (96 loc) · 3.17 KB
/
vnc.html
File metadata and controls
110 lines (96 loc) · 3.17 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>vnc connekter</title>
<link rel="stylesheet" href="https://unpkg.com/xp.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/novnc-core@1.4.0/core/rfb.css">
<style>
body {
background-image: url('./img/bliss-winxp.jpg');
background-size: cover;
background-position: center;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
font-family: "Tahoma", sans-serif;
}
.window {
width: 800px;
height: 600px;
display: flex;
flex-direction: column;
box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
}
.window-body {
flex: 1;
padding: 10px;
display: flex;
flex-direction: column;
gap: 10px;
}
#vnc-container {
flex: 1;
border: 1px solid #000;
}
.xp-button {
background: #e0e0e0;
border: 1px solid #808080;
padding: 3px 10px;
cursor: pointer;
font-weight: bold;
}
.xp-button:active {
background: #c0c0c0;
border-top: 1px solid #404040;
border-left: 1px solid #404040;
}
input {
padding: 4px 6px;
font-size: 14px;
width: 100%;
box-sizing: border-box;
}
label {
font-weight: bold;
}
</style>
</head>
<body>
<div class="window">
<div class="title-bar">
<div class="title-bar-text">vnc.exe</div>
<div class="title-bar-controls">
<button aria-label="Minimize"></button>
<button aria-label="Maximize"></button>
<button aria-label="Close" onclick="window.location.href='index.html'"></button>
</div>
</div>
<div class="window-body">
<label for="vncHost">vnc server url:</label>
<input type="text" id="vncHost" placeholder="wss://relay.widgetry.org">
<label for="vncPassword">passwd (optional):</label>
<input type="password" id="vncPassword" placeholder="VNC password">
<div id="vnc-container"></div>
<button class="xp-button" id="connectBtn">connekt (likely doesnt work)</button>
</div>
</div>
<script>
import RFB from 'https://cdn.jsdelivr.net/npm/@novnc/novnc@1.4.0/core/rfb.js';
let rfb = null;
document.getElementById('connectBtn').onclick = () => {
if (rfb) { rfb.disconnect(); rfb = null; }
const host = document.getElementById('vncHost').value;
const password = document.getElementById('vncPassword').value;
rfb = new RFB(document.getElementById('vnc-container'), host, {
credentials: { password: password }
});
rfb.viewOnly = false;
rfb.scaleViewport = true;
rfb.background = '#000';
};
</script>
</body>
</html>