-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsensmagic.html
168 lines (131 loc) · 6.01 KB
/
sensmagic.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mouse Sensitivity Calculators</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin-top: 50px;
background-color: black;
color: white;
}
input {
padding: 8px;
margin: 5px;
}
button {
padding: 10px;
margin-top: 10px;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
background-color: green;
color: white;
}
.tab-button {
transition: background-color 0.3s ease;
}
.tab-button.CS {
background-color: red;
color: white;
}
.tab-button.Valorant {
background-color: red;
color: white;
}
.tab-button.Windows {
background-color: red;
color: white;
}
.tab-button.active {
background-color: green;
}
</style>
</head>
<body>
<h2>DPI Calculator</h2>
<label for="sensitivity">Your Sensitivity:</label>
<input type="number" id="sensitivity" placeholder="Enter your sensitivity" step="0.01">
<label for="currentDPI">Your Current DPI:</label>
<input type="number" id="currentDPI" placeholder="Enter your current DPI">
<label for="desiredDPI">Desired DPI:</label>
<input type="number" id="desiredDPI" placeholder="Enter the DPI you want to achieve">
<button onclick="calculateDPI()">Calculate DPI</button>
<p id="resultDPI"></p>
<hr>
<h2>Minimum Sensitivity Calculator</h2>
<button class="tab-button CS active" onclick="changeTab('CS')">CS</button>
<button class="tab-button Valorant" onclick="changeTab('Valorant')">Valorant</button>
<label for="dpi">Enter DPI:</label>
<input type="number" id="dpi" placeholder="Enter DPI">
<label for="sensitivity2">Enter Sensitivity:</label>
<input type="number" step="any" id="sensitivity2" placeholder="Enter Sensitivity">
<button onclick="calculateSensitivity()">Calculate Sensitivity</button>
<p id="resultSensitivity"></p>
<hr>
<h2>Sens Multiplier Calculator for RawAccel</h2>
<label for="inputNumber">Enter number:</label>
<input type="text" id="inputNumber" placeholder="Enter a number">
<button onclick="calculateCustomSensitivity()">Calculate Custom Sensitivity</button>
<p id="resultCustomSensitivity"></p>
<hr>
<h2>Windows/RawAccel Calculator</h2>
<label for="currentDPIWindows">Current DPI:</label>
<input type="number" id="currentDPIWindows" placeholder="Enter current DPI">
<label for="desiredDPIWindows">Desired DPI:</label>
<input type="number" id="desiredDPIWindows" placeholder="Enter desired DPI">
<button onclick="calculateMultiplierWindows()">Calculate Multiplier</button>
<p id="resultWindows">Result will appear here</p>
<script>
var activeTab = 'CS';
function calculateDPI() {
var sensitivity = parseFloat(document.getElementById("sensitivity").value);
var currentDPI = parseInt(document.getElementById("currentDPI").value);
var desiredDPI = parseInt(document.getElementById("desiredDPI").value);
var newSensitivity = sensitivity / (desiredDPI / currentDPI);
document.getElementById("resultDPI").innerHTML = "Your new sensitivity should be: " + newSensitivity;
}
function calculateSensitivity() {
var dpiInput = document.getElementById('dpi').value;
var sensitivityInput = document.getElementById('sensitivity2').value;
if (dpiInput && sensitivityInput) {
var constant = parseFloat(sensitivityInput) * parseFloat(dpiInput);
var resultSensitivity = (activeTab === 'CS') ? constant / 0.0001 : constant / 0.001;
document.getElementById('resultSensitivity').innerHTML = "Required Sensitivity for " + ((activeTab === 'CS') ? '0.0001' : '0.001') + " DPI: " + resultSensitivity;
} else {
document.getElementById('resultSensitivity').innerHTML = "Please enter both DPI and Sensitivity values.";
}
}
function calculateCustomSensitivity() {
var inputNumber = document.getElementById('inputNumber').value;
if (!isNaN(inputNumber)) {
var customSensitivity = inputNumber * 0.001;
document.getElementById('resultCustomSensitivity').innerHTML = 'Result: ' + customSensitivity + 'sens';
} else {
document.getElementById('resultCustomSensitivity').innerHTML = 'Enter a valid number';
}
}
function calculateMultiplierWindows() {
var currentDPIWindows = parseFloat(document.getElementById("currentDPIWindows").value);
var desiredDPIWindows = parseFloat(document.getElementById("desiredDPIWindows").value);
if (!isNaN(currentDPIWindows) && !isNaN(desiredDPIWindows)) {
var multiplierWindows = currentDPIWindows / desiredDPIWindows;
document.getElementById("resultWindows").textContent = `DPI Multiplier: ${multiplierWindows}`;
} else {
document.getElementById("resultWindows").textContent = "Please enter valid DPI values.";
}
}
function changeTab(tabName) {
if (activeTab !== tabName) {
document.querySelector('.tab-button.' + activeTab).classList.remove('active');
document.querySelector('.tab-button.' + tabName).classList.add('active');
activeTab = tabName;
}
}
</script>
</body>
</html>