-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
202 lines (197 loc) · 8.32 KB
/
index.html
File metadata and controls
202 lines (197 loc) · 8.32 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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>unSure Calculator</title>
<!-- Performance: preconnect + defer loading for Tailwind CDN -->
<link rel="preconnect" href="https://cdn.tailwindcss.com" />
<link rel="preload" as="script" href="https://cdn.tailwindcss.com" />
<script src="https://cdn.tailwindcss.com" defer></script>
<!-- Performance: font preconnect + non-blocking load -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="preload"
as="style"
href="https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital,wght@0,400;1,400&family=Manrope:wght@400;600;700&display=swap"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital,wght@0,400;1,400&family=Manrope:wght@400;600;700&display=swap"
media="print"
onload="this.media='all'"
/>
<noscript>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital,wght@0,400;1,400&family=Manrope:wght@400;600;700&display=swap"
/>
</noscript>
<style>
body {
font-family: 'Manrope', 'Inter', 'system-ui', 'Segoe UI', Arial, sans-serif;
background: linear-gradient(135deg, #f7e7ce 0%, #fff6f0 100%);
letter-spacing: 0.01em;
}
.ft-card {
background: linear-gradient(135deg, #fff6f0 60%, #f7e7ce 100%);
border: 2px solid #bfa36f;
border-radius: 18px;
box-shadow: 0 6px 32px 0 rgba(80, 60, 30, 0.10), 0 1.5px 6px 0 rgba(191, 163, 111, 0.12);
padding: 3.2rem 2.3rem 2.5rem 2.3rem;
max-width: 540px;
margin: 0 auto;
}
h1 {
font-family: 'DM Serif Display', serif;
font-size: 2.7rem;
font-weight: 400;
color: #bfa36f;
margin-bottom: 2.3rem;
text-align: center;
letter-spacing: 0.01em;
text-shadow: 0 2px 8px #fff6f0, 0 1px 0 #bfa36f;
}
label {
font-family: 'Manrope', 'Inter', 'system-ui', Arial, sans-serif;
font-size: 1.08rem;
color: #bfa36f;
font-weight: 700;
margin-bottom: 0.7rem;
display: block;
letter-spacing: 0.01em;
}
input[type="text"] {
width: 100%;
padding: 1.15rem 1.5rem;
border: 2px solid #bfa36f;
border-radius: 10px;
background: #fff6f0;
font-size: 1.18rem;
color: #3a2c13;
transition: border 0.22s, box-shadow 0.22s;
font-family: 'Manrope', 'Inter', 'system-ui', Arial, sans-serif;
box-sizing: border-box;
box-shadow: 0 1.5px 6px 0 rgba(191, 163, 111, 0.08);
}
input[type="text"]:focus {
outline: none;
border-color: #e0b973;
box-shadow: 0 0 0 2px #f2e6d9, 0 1.5px 6px 0 #e0b97333;
}
button {
width: 100%;
padding: 1.15rem 0;
background: linear-gradient(90deg, #bfa36f 70%, #e0b973 100%);
color: #fff6f0;
font-family: 'Manrope', 'Inter', 'system-ui', Arial, sans-serif;
font-weight: 700;
font-size: 1.22rem;
border: none;
border-radius: 10px;
cursor: pointer;
transition: background 0.18s, box-shadow 0.18s, color 0.18s;
box-shadow: 0 2px 16px 0 #bfa36f22, 0 1.5px 6px 0 #bfa36f33;
letter-spacing: 0.01em;
margin-bottom: 0.3rem;
}
button:hover, button:focus {
background: linear-gradient(90deg, #e0b973 0%, #bfa36f 100%);
color: #3a2c13;
box-shadow: 0 4px 24px 0 #bfa36f33, 0 2px 8px 0 #e0b97344;
}
#result-container {
font-family: 'JetBrains Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
background: linear-gradient(135deg, #fff6f0 80%, #f7e7ce 100%);
border: 2px solid #bfa36f;
border-radius: 10px;
padding: 1.5rem 1.2rem 1.2rem 1.2rem;
margin-top: 2.1rem;
min-height: 4em;
overflow-x: auto;
color: #3a2c13;
box-shadow: 0 2px 16px 0 #bfa36f1a, 0 1.5px 6px 0 #bfa36f22;
}
.histogram-line {
display: flex;
align-items: baseline;
}
.histogram-label {
width: 8ch;
text-align: right;
padding-right: 0.5em;
flex-shrink: 0;
color: #6D7175;
}
.histogram-separator {
padding-right: 0.5em;
flex-shrink: 0;
}
.histogram-bar {
flex-grow: 1;
white-space: nowrap;
overflow: hidden;
color: #bfa36f;
border-radius: 3px;
}
#result-summary div {
font-size: 1.11rem;
color: #3a2c13;
font-family: 'Manrope', 'Inter', 'system-ui', Arial, sans-serif;
}
.text-xs {
color: #bfa36f;
text-align: center;
font-size: 0.97rem;
font-family: 'Manrope', 'Inter', 'system-ui', Arial, sans-serif;
}
</style>
</head>
<body
class="bg-gray-100 text-gray-800 min-h-screen flex items-center justify-center p-4"
>
<div class="bg-white p-4 rounded-lg shadow-md w-full max-w-4xl">
<h1
class="text-3xl font-bold mb-6 text-center tracking-wide text-gray-700 cursor-pointer"
>
unSure Calculator
</h1>
<div class="mb-6 flex items-center gap-3">
<input
type="text"
id="expression"
placeholder="example: 7~10 * 17~23"
class="flex-grow border-2 border-[#bfa36f] rounded-l-xl bg-[#fff6f0] text-lg leading-relaxed tracking-wider font-medium focus:outline-none focus:border-[#e0b973] focus:ring-2 focus:ring-[#e0b973] transition duration-150 ease-in-out shadow-sm"
/>
<button
id="calculateBtn"
class="px-4 py-4 bg-[#e0b973] hover:bg-[#bfa36f] text-[#3a2c13] font-bold text-xl rounded-r-xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#e0b973] transition duration-150 ease-in-out shadow-md"
style="max-width: 50px"
>
=
</button>
</div>
<div class="mt-6">
<div
id="result-container"
class="bg-gray-50 p-4 rounded-md text-sm leading-relaxed tracking-wider border border-gray-200 min-h-[4em] overflow-x-auto hidden"
>
<div id="result-summary"></div>
<div id="result-histogram"></div>
</div>
</div>
<p class="text-xs text-gray-500 mt-4 text-center">
Use '~' for ranges. Example: <code>4.1~4.3 * 10</code>
<br>
<span id="rate-status">Loading daily FX rates...</span>
Example: <code>120usd + 50eur to pln</code>
</p>
<p class="text-xs text-gray-500 mt-3 text-center">
Source on <a href="https://github.com/PythonicNinja/unsure-calc" class="text-[#bfa36f] underline hover:text-[#e0b973]">GitHub</a>
</p>
</div>
<script src="./core/calc-core.js"></script>
<script src="main.js" defer></script>
</body>
</html>