-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
255 lines (241 loc) · 14.2 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
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Drill Hole Calculator</title>
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#4CAF50">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="stylesheet" href="styles.css">
<!-- OpenGraph Meta Tags -->
<meta property="og:title" content="Drill Hole Calculator">
<meta property="og:description" content="Calculate dip and dip direction from alpha and beta measurements in drill holes. A free, offline-capable Progressive Web App for geologists.">
<meta property="og:image" content="https://dhcalc.com/dhcalc_screenshot.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:url" content="https://dhcalc.com/">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Drill Hole Calculator">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Drill Hole Calculator">
<meta name="twitter:description" content="Calculate dip and dip direction from alpha and beta measurements in drill holes. A free, offline-capable Progressive Web App for geologists.">
<meta name="twitter:image" content="https://dhcalc.com/dhcalc_screenshot.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
</head>
<body>
<div class="container">
<div class="header">
<h1 class="app-title">Drill Hole Calculator</h1>
<div id="drillHoleInfoSummary" class="hidden">
<span id="holeIdSummary"></span>
<span id="holeDipSummary"></span>
<span id="holeAzimuthSummary"></span>
</div>
<div class="header-buttons">
<button id="drillHoleInfoToggle" class="icon-button"><i class="fas fa-chevron-down"></i></button>
<button id="settingsButton" class="icon-button"><i class="fas fa-cog"></i></button>
</div>
</div>
<div id="drillHoleInfo" class="collapsible">
<div class="input-group" id="holeIdGroup">
<label for="holeId">Hole ID:</label>
<input type="text" id="holeId">
</div>
<div class="input-group hidden" id="holeIdSelectGroup">
<label for="holeIdSelect">Hole ID:</label>
<select id="holeIdSelect">
<option value="">Select Hole ID</option>
</select>
</div>
<div class="input-group angle-input">
<label for="holeDip">Hole Dip (°):</label>
<input type="number" id="holeDip" min="-90" max="90" step="0.1" value="0" class="angle-number">
<input type="range" id="holeDipSlider" min="-90" max="90" step="0.1" value="0" class="angle-slider">
</div>
<div class="input-group angle-input">
<label for="holeAzimuth">Hole Azimuth (°):</label>
<input type="number" id="holeAzimuth" min="0" max="360" step="0.1" value="0" class="angle-number">
<input type="range" id="holeAzimuthSlider" min="0" max="360" step="0.1" value="0" class="angle-slider">
</div>
</div>
<div id="app">
<div class="input-section">
<h2>Measurement</h2>
<div class="input-group">
<label for="depth">Depth (m):</label>
<input type="number" id="depth" min="0" step="0.01" value="0">
</div>
<div class="depth-buttons">
<button class="depth-button" data-amount="-10">-10m</button>
<button class="depth-button" data-amount="-1">-1m</button>
<button class="depth-button" data-amount="-0.1">-0.1m</button>
<button class="depth-button" data-amount="0.1">+0.1m</button>
<button class="depth-button" data-amount="1">+1m</button>
<button class="depth-button" data-amount="10">+10m</button>
</div>
<div class="type-selector"></div>
<div class="generation-selector"></div>
<div class="custom-type-selectors"></div>
<div id="preview"></div>
<div class="input-group angle-input">
<label for="alpha">Alpha (°):</label>
<input type="number" id="alpha" min="0" max="90" step="1" value="0" class="angle-number">
<input type="range" id="alphaSlider" min="0" max="90" step="1" value="0" class="angle-slider">
</div>
<div class="input-group angle-input">
<label for="beta">Beta (°):</label>
<input type="number" id="beta" min="0" max="360" step="1" value="0" class="angle-number">
<input type="range" id="betaSlider" min="0" max="360" step="1" value="0" class="angle-slider">
</div>
<textarea id="comment" placeholder="Add a comment..."></textarea>
<div class="button-group">
<button id="addMeasurement" class="primary-button">Add Measurement</button>
<button id="undoMeasurement" class="secondary-button" disabled><i class="fas fa-undo"></i> Undo</button>
</div>
</div>
<div class="results-section">
<h2>Results</h2>
<table id="resultsTable">
<thead>
<tr>
<!-- Header columns will be dynamically generated -->
</tr>
</thead>
<tbody>
<!-- Table body will be dynamically populated -->
</tbody>
</table>
</div>
<div class="action-buttons">
<button id="copyResults">Copy Results</button>
<button id="saveAsCSV">Save as CSV</button>
<button id="clearMeasurements">Clear Measurements</button>
</div>
</div>
<div id="settingsPage" class="hidden">
<div class="settings-header">
<button id="backToMain" class="icon-button"><i class="fas fa-arrow-left"></i></button>
<h2>Settings</h2>
</div>
<div class="settings-content">
<section class="settings-section">
<h3>General Settings</h3>
<div class="settings-grid">
<div class="setting-group">
<label for="darkMode">Dark Mode:</label>
<input type="checkbox" id="darkMode">
<p class="setting-description">Enable dark mode for a more comfortable viewing experience in low-light conditions.</p>
</div>
<div class="setting-group">
<label for="hapticFeedback">Haptic Feedback:</label>
<input type="checkbox" id="hapticFeedback">
<p class="setting-description">Enable vibration feedback for button presses and other interactions (if supported by your device).</p>
</div>
<div class="setting-group">
<label for="undoEnabled">Undo Button:</label>
<input type="checkbox" id="undoEnabled">
<p class="setting-description">Enable or disable the undo button functionality.</p>
</div>
<div class="setting-group">
<label for="includeHeaderInExport">Include Header in Export:</label>
<input type="checkbox" id="includeHeaderInExport">
<p class="setting-description">Include header row when exporting or copying results.</p>
</div>
<div class="setting-group">
<label for="strikeMode">Strike Mode:</label>
<select id="strikeMode">
<option value="negative">-90° (default)</option>
<option value="positive">+90°</option>
</select>
<p class="setting-description">Choose the strike mode for measurements. -90° is the default, but some geologists prefer +90°.</p>
</div>
</div>
</section>
<section class="settings-section">
<h3>Survey Import Settings</h3>
<div class="setting-group">
<label for="surveyImportEnabled">Enable Survey Import:</label>
<input type="checkbox" id="surveyImportEnabled">
<p class="setting-description">Enable survey import functionality for drill hole data. This allows you to import survey data from a CSV file to automatically populate hole information.</p>
</div>
<div class="survey-import-settings" style="display: none;">
<h4>CSV Import</h4>
<input type="file" id="surveyImportInput" accept=".csv">
<p class="setting-description">Select a CSV file containing your survey data. The file should include columns for Hole ID, Depth, Azimuth, and Dip.</p>
<h4>Survey Import Field Mapping</h4>
<p class="setting-description">Map the columns in your CSV file to the required fields. Select the appropriate column for each field:</p>
<div class="field-mapping">
<div>
<label for="surveyImportHoleIdField">Hole ID Field:</label>
<select id="surveyImportHoleIdField"></select>
</div>
<div>
<label for="surveyImportDepthField">Depth Field:</label>
<select id="surveyImportDepthField"></select>
</div>
<div>
<label for="surveyImportAzimuthField">Azimuth Field:</label>
<select id="surveyImportAzimuthField"></select>
</div>
<div>
<label for="surveyImportDipField">Dip Field:</label>
<select id="surveyImportDipField"></select>
</div>
</div>
<p class="setting-description">Note: Invalid rows in the CSV will be automatically skipped during import.</p>
</div>
</section>
<section class="settings-section">
<h3>Measurement Types</h3>
<div class="setting-group">
<div id="measurementTypes"></div>
<button id="addMeasurementType">Add Measurement Type</button>
<p class="setting-description">Manage the types of measurements you can record (e.g., Foliation, Lineation). Add custom measurement types as needed.</p>
</div>
</section>
<section class="settings-section">
<h3>Generation Types</h3>
<div class="setting-group">
<div id="generationTypes"></div>
<button id="addGenerationType">Add Generation Type</button>
<p class="setting-description">Manage generation types to classify measurements (e.g., S1, S2 for different foliation generations).</p>
</div>
</section>
<section class="settings-section">
<h3>Custom Types</h3>
<div class="setting-group">
<div id="customTypes"></div>
<button id="addCustomType">Add Custom Type</button>
<p class="setting-description">Create and manage custom classification types for your measurements to suit your specific project needs.</p>
</div>
</section>
<section class="settings-section">
<h3>Reset Application</h3>
<div class="setting-group">
<button id="resetApp" class="danger-button">Reset All Settings and Data</button>
<p class="setting-description">Warning: This will clear all your settings, custom types, and stored measurements. Use with caution!</p>
</div>
</section>
<div class="setting-group data-storage-info">
<i class="fas fa-info-circle"></i>
<p>All data and settings are saved locally on your device. No information is stored in the cloud or on external servers.</p>
</div>
</div>
</div>
<div id="copyStatus"></div>
<div id="error"></div>
</div>
<footer>
<span>Done by Janne v.15</span>
<div class="social-links">
<a href="https://www.linkedin.com/in/kinnujan/" target="_blank" rel="noopener noreferrer"><i class="fab fa-linkedin"></i></a>
<a href="https://github.com/kinnujan/drillhole-calculator/" target="_blank" rel="noopener noreferrer"><i class="fab fa-github"></i></a>
<a href="https://twitter.com/kinnujan" target="_blank" rel="noopener noreferrer"><i class="fab fa-twitter"></i></a>
</div>
</footer>
<script type="module" src="main.js"></script>
</body>
</html>