-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
125 lines (112 loc) · 5.12 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>m_yaw Calculator</title>
<!-- Enable responsiveness -->
<meta name=viewport content="width=device-width,initial-scale=1,user-scalable=no">
<!-- Bootstrap -->
<link rel="stylesheet" href="bootstrap.3-3-7.min.css">
<!-- custom styles -->
<style type="text/css">
#header,
#footer {
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<div id="app">
<div id="header">
<h1>m_yaw Calculator</h1>
<p class="text-info">
Stretching a resolution on a screen
</p>
</div>
<div>
<form method="POST" class="form-horizontal">
<div class="form-group">
<label class="control-label col-xs-3" for="input-old-myaw">Old m_yaw</label>
<div class="col-xs-9">
<input type="number" class="form-control" id="input-old-myaw" value="0.022">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3" for="input-old-width">Screen Width</label>
<div class="col-xs-9">
<input type="number" class="form-control" id="input-old-width" value="16">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3" for="input-old-height">Screen Height</label>
<div class="col-xs-9">
<input type="number" class="form-control" id="input-old-height" value="9">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3" for="input-new-width">Resolution Width</label>
<div class="col-xs-9">
<input type="number" class="form-control" id="input-new-width" value="4">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3" for="input-new-height">Resolution Height</label>
<div class="col-xs-9">
<input type="number" class="form-control" id="input-new-height" value="3">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-3" for="result">Result</label>
<div class="col-xs-6">
<input type="number" class="form-control" id="result" disabled="true">
</div>
<input type="submit" class="btn btn-primary pull-right col-xs-3" onclick="javascript:return calculate();">
</div>
</form>
</div>
</div>
<div id="disclaimer" class="text-warning">
<h4>Disclaimer</h4>
<p>
Changing your m_yaw will keep the relation between the distance you move your mouse and the amount of pixels your crosshair moves on the screen the same. Usually being used to a sensitivity means that your brain associates distances on your mousepad with distances on the screen, not with angles you turn ingame. So this calculator will help you keep your muscle memory when it comes to flicking to enemies that you see on the screen.<br>
However, it will change the distance you need to move your mouse when turning beyond the screen, because it changes the distance you need to move your mouse per degree ingame.<br>
You will have to choose between muscle memory on the screen itself or beyond the screen (I choose on the screen, since you need to avoid being shot in the side or back anyway).
</p>
</div>
<div id="footer" class="text-muted">
<small>
<span>
Copyright © 2016 <a href="https://github.com/sgade">Sören Gade</a> & <a href="https://github.com/ngruenefeld">Nils Grünefeld</a>
</span>
<span>
(<a href="https://github.com/ngruenefeld/m_yaw_calculator">Source</a>)
</span>
</small>
</div>
</div>
<script type="text/javascript">
(function(document, window) {
function inputNumberValue(id) {
var el = document.querySelector("#" + id);
return el.value;
}
function calculateNewM_yaw(oldM_Yaw, oldScreenWidth, oldScreenHeight, newScreenWidth, newScreenHeight) {
// ported and abbreviated from https://gist.github.com/ngruenefeld/e4f47c287cf8f75d182ae2f0cc1f7d6e
return oldM_Yaw * ( ( newScreenWidth / newScreenHeight ) / ( oldScreenWidth / oldScreenHeight ) );
}
window.calculate = function() {
var oldmyaw = inputNumberValue("input-old-myaw");
var oldWidth = inputNumberValue("input-old-width");
var oldHeight = inputNumberValue("input-old-height");
var newWidth = inputNumberValue("input-new-width");
var newHeight = inputNumberValue("input-new-height");
var newM_yaw = calculateNewM_yaw(oldmyaw, oldWidth, oldHeight, newWidth, newHeight);
document.querySelector("#result").value = newM_yaw;
return false;
};
})(document, window);
setTimeout(calculate, 0);
</script>
</body>
</html>