/
popup.html
38 lines (38 loc) · 1.69 KB
/
popup.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Percentage Calculator</title>
<link rel="stylesheet" type="text/css" href="popup.css" />
</head>
<body>
<div class="header">
<h1>Percentage Calculator</h1>
</div>
<div id="calculator">
<select id="operation" onchange="toggleInputZ()">
<option value="percentOf">What is X% of Y?</option>
<option value="percentFrom">X is what percent of Y?</option>
<option value="percentChange">What is the percentage increase/decrease from X to Y?</option>
<option value="originalValue">Original value before a X% increase/decrease from</option>
<option value="percentDifference">Percentage difference between X and Y</option>
<option value="compoundPercent">Value after Y% increase/decrease applied Z times to X</option>
<option value="reversePercentage">Calculate whole value when X represents Y% of it</option>
</select>
<input type="number" id="valueX" placeholder="Enter value for X" />
<input type="number" id="valueY" placeholder="Enter value for Y" />
<input type="number" id="valueZ" placeholder="Enter value for Z (if needed)" style="display: none" />
<button id="calculate" disabled>Calculate</button>
<div id="result">
<span id="resultText">Select an operation and enter values to start!</span><span id="numericResult"></span>
<div id="resultButton" class="tooltip">
<button id="copyToClipboard" style="display: none">
📋
<span class="tooltiptext">Copy to clipboard</span>
</button>
</div>
</div>
</div>
<script src="popup.js"></script>
</body>
</html>