-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase-converter.html
More file actions
101 lines (90 loc) · 4.47 KB
/
Copy pathbase-converter.html
File metadata and controls
101 lines (90 loc) · 4.47 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Universal Base Converter</title>
<link rel="stylesheet" href="assets/css/base-converter.css">
</head>
<body>
<div class="container">
<header>
<a class="back-btn" href="index.html" aria-label="Back to home" title="Back to home">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4">
<path stroke-linecap="round" stroke-linejoin="round" d="M15 18l-6-6 6-6" />
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12h12" />
</svg>
</a>
<div>
<h1>Universal Base Converter</h1>
<p class="subtitle">Integer bases 2 to 36</p>
</div>
<div class="status-line" id="statusLine">
<span class="status-dot"></span>
<span id="statusText">Ready</span>
</div>
</header>
<div class="workspace">
<div class="input-group">
<label for="inputValue">
<span>Input</span>
<span id="inputBaseDisplay">Base 10</span>
</label>
<div class="input-wrapper">
<input type="text" id="inputValue" placeholder="0" autocomplete="off">
<select id="inputBase" aria-label="Input base">
<!-- Options populated by JS -->
</select>
</div>
<div class="base-shortcuts" data-target="inputBase" aria-label="Input base presets">
<button class="preset-btn" type="button" data-base="2">BIN</button>
<button class="preset-btn" type="button" data-base="8">OCT</button>
<button class="preset-btn" type="button" data-base="10">DEC</button>
<button class="preset-btn" type="button" data-base="16">HEX</button>
</div>
</div>
<div class="swap-container">
<button class="swap-btn" id="swapBtn" type="button" title="Swap Input and Output"
aria-label="Swap input and output bases">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"
stroke-width="2.5">
<path stroke-linecap="round" stroke-linejoin="round"
d="M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4" />
</svg>
</button>
</div>
<div class="input-group">
<label for="outputValue">
<span>Output</span>
<span id="outputBaseDisplay">Base 2</span>
</label>
<div class="input-wrapper">
<div class="output-wrapper">
<input type="text" id="outputValue" class="output-field" readonly placeholder="0">
<button class="copy-btn" id="copyBtn" type="button" title="Copy output"
aria-label="Copy output">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round"
d="M8 8h10v12H8z M6 16H4V4h12v2" />
</svg>
</button>
</div>
<select id="outputBase" aria-label="Output base">
<!-- Options populated by JS -->
</select>
</div>
<div class="base-shortcuts" data-target="outputBase" aria-label="Output base presets">
<button class="preset-btn" type="button" data-base="2">BIN</button>
<button class="preset-btn" type="button" data-base="8">OCT</button>
<button class="preset-btn" type="button" data-base="10">DEC</button>
<button class="preset-btn" type="button" data-base="16">HEX</button>
</div>
</div>
</div>
</div>
<!-- Toast Notification -->
<div id="toast" class="toast">Copied to clipboard!</div>
<script src="assets/js/base-converter.js"></script>
</body>
</html>