-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
275 lines (252 loc) · 8.79 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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ArcGIS Credit Cost Estimator</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<style>
/* Global Styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Roboto', sans-serif;
background-color: #f0f4f8;
color: #333;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
margin: 0;
}
header {
background-color: white;
color: #0D5B90;
padding: 10px 20px;
width: 100%;
text-align: center;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
header h1 {
font-weight: 400;
font-size: 2rem;
}
.subtext {
margin: 20px 0;
font-size: 1.2rem;
color: #555;
text-align: center;
padding: 0 20px;
}
.container {
width: 90%;
max-width: 1200px;
margin: 20px auto;
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: center;
}
.card {
background-color: white;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
padding: 20px;
flex: 1 1 calc(33% - 20px);
min-width: 300px;
text-align: center;
height: 350px;
display: flex;
flex-direction: column;
justify-content: space-between;
transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
transform: translateY(-5px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.card h3 {
color: #0D5B90;
font-size: 1.2rem;
margin-bottom: 10px;
}
.card p {
font-size: 0.9rem;
color: #666;
margin-bottom: 15px;
}
.card input[type="number"] {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
margin-bottom: 15px;
font-size: 1rem;
}
.drop-area {
border: 2px dashed #0D5B90;
border-radius: 8px;
padding: 20px;
background-color: #f9f9f9;
color: #555;
text-align: center;
transition: background-color 0.3s ease, border-color 0.3s ease;
cursor: pointer;
}
.drop-area:hover {
background-color: #e0eaff;
}
.drop-area.dragover {
background-color: #cce5ff;
border-color: #0a69b8;
}
.result {
margin-top: 10px;
font-size: 1rem;
font-weight: 600;
color: #333;
}
button {
background-color: #0D5B90;
color: white;
border: none;
border-radius: 5px;
padding: 15px 25px;
font-size: 1.2rem;
cursor: pointer;
transition: background-color 0.2s ease, transform 0.2s ease;
}
button:hover {
background-color: #083b61;
transform: scale(1.05);
}
footer {
background-color: #0D5B90;
color: white;
text-align: center;
padding: 15px 0;
width: 100%;
margin-top: auto;
}
footer a {
color: white;
text-decoration: none;
font-weight: bold;
}
footer a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<header>
<h1>ArcGIS Credit Cost Estimator</h1>
</header>
<div class="subtext">
Quickly calculate the estimated hosting costs for feature data, imagery, and files.
</div>
<div class="container">
<!-- Feature Hosting Section -->
<div class="card">
<h3>Feature Hosting (MB)</h3>
<p>Enter the size of your feature data in MB to calculate hosting costs.</p>
<input type="number" id="featureSize" placeholder="Enter file size in MB">
<button onclick="calculateFeatureCost()">Calculate Cost</button>
<div id="featureResult" class="result"></div>
</div>
<!-- Tiled Imagery Hosting Section -->
<div class="card">
<h3>Tiled Imagery Hosting (GB)</h3>
<p>Enter the size of your tiled imagery in GB to calculate hosting costs.</p>
<input type="number" id="imagerySize" placeholder="Enter file size in GB">
<button onclick="calculateImageryCost()">Calculate Cost</button>
<div id="imageryResult" class="result"></div>
</div>
<!-- File Upload Section with Drag-and-Drop -->
<div class="card">
<h3>Upload a File</h3>
<p>Drag and drop GIS files here to estimate hosting costs. Supported: <strong>.tif, .gdb, .csv, .xls, .xlsx, .shp, .geojson, .kml, .kmz</strong>.</p>
<div class="drop-area" id="dropArea">
Drag & Drop files here or click to browse.
</div>
<input type="file" id="fileUpload" accept=".tif,.gdb,.csv,.xls,.xlsx,.shp,.geojson,.kml,.kmz" style="display: none;">
<div id="fileResult" class="result"></div>
</div>
</div>
<button class="reset-btn" onclick="resetAll()">Clear/Reset All</button>
<footer>
<p>
<a href="https://github.com/cmesserich-br/arcgis-online-credit-calculator" target="_blank">
Chris Messerich - Blue Raster
</a>
</p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.browser.min.js"></script>
<script>
const dropArea = document.getElementById('dropArea');
const fileInput = document.getElementById('fileUpload');
const fileResult = document.getElementById('fileResult');
function calculateFeatureCost() {
const sizeMB = document.getElementById('featureSize').value;
if (!sizeMB || sizeMB <= 0) {
alert("Please enter a valid size in MB for feature hosting.");
return;
}
const cost = (sizeMB / 10) * 2.4;
document.getElementById('featureResult').textContent = `Cost: ${cost.toFixed(2)} credits/month`;
}
function calculateImageryCost() {
const sizeGB = document.getElementById('imagerySize').value;
if (!sizeGB || sizeGB <= 0) {
alert("Please enter a valid size in GB for tiled imagery hosting.");
return;
}
const cost = sizeGB * 1.2;
document.getElementById('imageryResult').textContent = `Cost: ${cost.toFixed(2)} credits/month`;
}
dropArea.addEventListener('dragover', (e) => {
e.preventDefault();
dropArea.classList.add('dragover');
});
dropArea.addEventListener('dragleave', () => {
dropArea.classList.remove('dragover');
});
dropArea.addEventListener('drop', (e) => {
e.preventDefault();
dropArea.classList.remove('dragover');
handleFile(e.dataTransfer.files[0]);
});
dropArea.addEventListener('click', () => {
fileInput.click();
});
fileInput.addEventListener('change', (e) => {
handleFile(e.target.files[0]);
});
function handleFile(file) {
if (!file) return;
// Trigger confetti
confetti({
particleCount: 200,
spread: 90,
startVelocity: 50,
origin: { y: 0.6 },
colors: ['#0D5B90', '#FFFFFF', '#B0B0B0'],
});
const fileSizeMB = file.size / (1024 * 1024); // Convert bytes to MB
const cost = (fileSizeMB / 10) * 2.4; // Example calculation
fileResult.textContent = `File: ${file.name} | Size: ${fileSizeMB.toFixed(2)} MB | Cost: ${cost.toFixed(2)} credits/month`;
}
function resetAll() {
document.getElementById('featureSize').value = '';
document.getElementById('imagerySize').value = '';
fileInput.value = '';
document.getElementById('featureResult').textContent = '';
document.getElementById('imageryResult').textContent = '';
fileResult.textContent = '';
}
</script>
</body>
</html>