-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
152 lines (147 loc) · 4.46 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
<!DOCTYPE html>
<!-- ========================================================================
INDEX.HTML: page principale serveur Joystick
* Charge joy.js ( gestion gamepad et diffusion Websockt)
* Affiche des infos sur le fonctionnement actuelle
* Affiche un joystick virtuel (AXIS T833: pad PT, pad Z, boutons presets/next/prev)
Activé par main.js (application Electron)
Peut fonctionner directement sous chrome sans le Websocket
(Electron est un .exe avec Chromium+Node.js)
======================================================================== -->
<html>
<head>
<title>JoyStick Electron!</title>
<style>
body {
background: #444;
color:#AAA;
overflow:hidden;
}
* { margin:0px;}
div {font-size: 10px;}
.buttonPreset {
font-size: 11px;
box-sizing: border-box;
width:24%;
margin:0px;
border:solid 2px #0A0;
}
div#title {
font-size: 16px;
text-align: center;
}
/*=========== Vecteurs =======*/
svg {
background:#666;
fill:url(#gradient);
border:solid 2px #0E0;
cursor: pointer;
}
.mark {
stroke: #AA0;
stroke-width:2;
}
circle#xypos,circle#zpos {
stroke: #FFF;
stroke-width:2;
}
line.arrow {
stroke: #FAA;
stroke-width:3;
}
</style>
</head>
<body
onload="init();"
onunload="unload()"
onmousemove="mooveall(event)">
<div style="user-select: none;" >
<div>
<input type="button" value="P1" onclick="button(0);" class="buttonPreset">
<input type="button" value="P2" onclick="button(1);" class="buttonPreset">
<input type="button" value="P3" onclick="button(2);" class="buttonPreset">
<input type="button" value="P4" onclick="button(3);" class="buttonPreset">
<br>
<input type="button" value="Prev" onclick="button(4);" style="float:left;" class="buttonPreset">
<input type="button" value="Suiv" onclick="button(5);" style="float:right" class="buttonPreset">
</div>
<br><br>
<div style="position:absolute">
<svg style="position:relative;left:3%;top:10px;width:30px;height:150px;"
onmousedown="zoommousepush();zoommousemove(event);"
onmouseup="zoommouserelease(event);"
onmousemove="zoommousemove(event);"
id="cvzoom"
>
<defs>
<linearGradient id="gradient"
x1="0%" y1="0%"
x2="0%" y2="100%"
spreadMethod="pad">
<stop offset="10%" stop-color="#00AAAA" stop-opacity="1"/>
<stop offset="90%" stop-color="#006666" stop-opacity="1"/>
</linearGradient>
</defs>
<rect x='0' y='0' width='100%' height="100%" style="fill:url(#gradient);"/>
<line x1="0" y1="50%" x2="100%" y2="50%" class="mark"/>
<circle cx="50%" cy="50%" r="4" id="zpos"/>
</svg>
<svg style="position:relative;left:10%;top:10px;width:150px;height:150px;"
onmousedown="mousepush();mousemove(event);"
onmouseup="mouserelease(event);"
onmousemove="mousemove(event);"
id="cvxz"
>
<defs>
<linearGradient id="gradient"
x1="0%" y1="0%"
x2="0%" y2="100%"
spreadMethod="pad">
<stop offset="10%" stop-color="#00AAAA" stop-opacity="1"/>
<stop offset="90%" stop-color="#006666" stop-opacity="1"/>
</linearGradient>
<marker id="triangle"
viewBox="0 0 4 4" refX="4" refY="2"
markerUnits="strokeWidth"
markerWidth="4" markerHeight="4"
orient="auto"
style="stroke: #FAA;fill: #FAA">
<path d="M 0 0 L 4 2 L 0 4 z" />
</marker>
</defs>
<rect x='0' y='0' width='100%' height="100%" style="fill:url(#gradient);"/>
<line x1="0" y1="50%" x2="100%" y2="50%" class="mark"/>
<line x1="50%" y1="0%" x2="50%" y2="100%" class="mark"/>
<circle cx="50%" cy="50%" r="10" fill-opacity="0.0" class="mark"/>
<circle cx="-50%" cy="-50%" r="3" id="xypos"/>
<line x1="50%" y1="50%" x2="50%" y2="50%" class="arrow" marker-end="url(#triangle)" id="arrowxy"/>
</svg>
</div>
<br><br> <br><br> <br><br>
<br><br> <br><br> <br><br>
<br><br> <br><br>
<div id="title">...</div>
<input type='button' onclick="togleDebug(this);"
value='Debug'
style='border:solid;background:#AAA;'>
<!--
<input type='button' onclick='ipc.send("showConfig");'
value='Config'
style='border:solid;background:#AAA;'>
-->
<div style="visibility:hidden" id="debug">
<h3 id="stitle"></h3>
<div id="b1"></div>
<div id="a1" class="n"></div><div id="a2" class="n"></div><div id="a3" class="n"></div>
<br>
<div id="ws"></div>
<div id="ws2"></div>
</div>
</div>
<script>
var ipc = require('ipc');
function showconfig() { ips.send("showConfig"); }
</script>
<script src="joy.js"></script>
</body>
</html>