Add 2 files
Browse files- README.md +7 -5
- index.html +341 -19
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: a-counter
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: blue
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,341 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Pack Counter for 20 Large Boxes</title>
|
7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
8 |
+
<style>
|
9 |
+
:root {
|
10 |
+
--primary-color: #4a6fa5;
|
11 |
+
--secondary-color: #ff7e5f;
|
12 |
+
--light-color: #f8f9fa;
|
13 |
+
--dark-color: #343a40;
|
14 |
+
--success-color: #28a745;
|
15 |
+
}
|
16 |
+
|
17 |
+
* {
|
18 |
+
margin: 0;
|
19 |
+
padding: 0;
|
20 |
+
box-sizing: border-box;
|
21 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
22 |
+
}
|
23 |
+
|
24 |
+
body {
|
25 |
+
background-color: #f5f7fa;
|
26 |
+
color: var(--dark-color);
|
27 |
+
line-height: 1.6;
|
28 |
+
padding: 20px;
|
29 |
+
}
|
30 |
+
|
31 |
+
.container {
|
32 |
+
max-width: 800px;
|
33 |
+
margin: 0 auto;
|
34 |
+
background: white;
|
35 |
+
border-radius: 15px;
|
36 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
37 |
+
padding: 30px;
|
38 |
+
position: relative;
|
39 |
+
overflow: hidden;
|
40 |
+
}
|
41 |
+
|
42 |
+
.container::before {
|
43 |
+
content: '';
|
44 |
+
position: absolute;
|
45 |
+
top: 0;
|
46 |
+
left: 0;
|
47 |
+
width: 100%;
|
48 |
+
height: 10px;
|
49 |
+
background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
|
50 |
+
}
|
51 |
+
|
52 |
+
h1 {
|
53 |
+
text-align: center;
|
54 |
+
margin-bottom: 25px;
|
55 |
+
color: var(--primary-color);
|
56 |
+
position: relative;
|
57 |
+
padding-bottom: 15px;
|
58 |
+
}
|
59 |
+
|
60 |
+
h1::after {
|
61 |
+
content: '';
|
62 |
+
position: absolute;
|
63 |
+
bottom: 0;
|
64 |
+
left: 50%;
|
65 |
+
transform: translateX(-50%);
|
66 |
+
width: 100px;
|
67 |
+
height: 4px;
|
68 |
+
background: var(--secondary-color);
|
69 |
+
border-radius: 2px;
|
70 |
+
}
|
71 |
+
|
72 |
+
.description {
|
73 |
+
text-align: center;
|
74 |
+
margin-bottom: 30px;
|
75 |
+
color: #666;
|
76 |
+
font-size: 1.1em;
|
77 |
+
}
|
78 |
+
|
79 |
+
.counter-box {
|
80 |
+
display: flex;
|
81 |
+
flex-direction: column;
|
82 |
+
gap: 25px;
|
83 |
+
}
|
84 |
+
|
85 |
+
.input-group {
|
86 |
+
display: flex;
|
87 |
+
flex-direction: column;
|
88 |
+
gap: 8px;
|
89 |
+
}
|
90 |
+
|
91 |
+
label {
|
92 |
+
font-weight: 600;
|
93 |
+
color: var(--primary-color);
|
94 |
+
display: flex;
|
95 |
+
align-items: center;
|
96 |
+
gap: 8px;
|
97 |
+
}
|
98 |
+
|
99 |
+
input {
|
100 |
+
padding: 12px 15px;
|
101 |
+
border: 2px solid #ddd;
|
102 |
+
border-radius: 8px;
|
103 |
+
font-size: 16px;
|
104 |
+
transition: all 0.3s;
|
105 |
+
}
|
106 |
+
|
107 |
+
input:focus {
|
108 |
+
border-color: var(--primary-color);
|
109 |
+
outline: none;
|
110 |
+
box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
|
111 |
+
}
|
112 |
+
|
113 |
+
.button-group {
|
114 |
+
display: flex;
|
115 |
+
gap: 10px;
|
116 |
+
margin-top: 10px;
|
117 |
+
}
|
118 |
+
|
119 |
+
button {
|
120 |
+
padding: 12px 20px;
|
121 |
+
border: none;
|
122 |
+
border-radius: 8px;
|
123 |
+
font-size: 16px;
|
124 |
+
font-weight: 600;
|
125 |
+
cursor: pointer;
|
126 |
+
transition: all 0.3s;
|
127 |
+
display: flex;
|
128 |
+
align-items: center;
|
129 |
+
justify-content: center;
|
130 |
+
gap: 8px;
|
131 |
+
flex: 1;
|
132 |
+
}
|
133 |
+
|
134 |
+
.calculate-btn {
|
135 |
+
background-color: var(--primary-color);
|
136 |
+
color: white;
|
137 |
+
}
|
138 |
+
|
139 |
+
.reset-btn {
|
140 |
+
background-color: var(--dark-color);
|
141 |
+
color: white;
|
142 |
+
}
|
143 |
+
|
144 |
+
button:hover {
|
145 |
+
transform: translateY(-2px);
|
146 |
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
147 |
+
}
|
148 |
+
|
149 |
+
.result-container {
|
150 |
+
margin-top: 30px;
|
151 |
+
padding: 20px;
|
152 |
+
background-color: #f8f9fa;
|
153 |
+
border-radius: 10px;
|
154 |
+
border-left: 5px solid var(--primary-color);
|
155 |
+
display: none;
|
156 |
+
}
|
157 |
+
|
158 |
+
.result-title {
|
159 |
+
font-weight: 600;
|
160 |
+
margin-bottom: 10px;
|
161 |
+
color: var(--primary-color);
|
162 |
+
}
|
163 |
+
|
164 |
+
.result-value {
|
165 |
+
font-size: 24px;
|
166 |
+
font-weight: 700;
|
167 |
+
color: var(--success-color);
|
168 |
+
}
|
169 |
+
|
170 |
+
.info-box {
|
171 |
+
margin-top: 30px;
|
172 |
+
padding: 15px;
|
173 |
+
background-color: #e9f5ff;
|
174 |
+
border-radius: 10px;
|
175 |
+
border-left: 5px solid var(--primary-color);
|
176 |
+
}
|
177 |
+
|
178 |
+
.info-title {
|
179 |
+
font-weight: 600;
|
180 |
+
margin-bottom: 5px;
|
181 |
+
display: flex;
|
182 |
+
align-items: center;
|
183 |
+
gap: 8px;
|
184 |
+
color: var(--primary-color);
|
185 |
+
}
|
186 |
+
|
187 |
+
.pack-icon {
|
188 |
+
color: var(--secondary-color);
|
189 |
+
margin-right: 5px;
|
190 |
+
}
|
191 |
+
|
192 |
+
.box-icon {
|
193 |
+
color: var(--primary-color);
|
194 |
+
margin-right: 5px;
|
195 |
+
}
|
196 |
+
|
197 |
+
@media (max-width: 600px) {
|
198 |
+
.container {
|
199 |
+
padding: 20px;
|
200 |
+
}
|
201 |
+
|
202 |
+
.button-group {
|
203 |
+
flex-direction: column;
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
/* Animation */
|
208 |
+
@keyframes pulse {
|
209 |
+
0% { transform: scale(1); }
|
210 |
+
50% { transform: scale(1.05); }
|
211 |
+
100% { transform: scale(1); }
|
212 |
+
}
|
213 |
+
|
214 |
+
.pulse {
|
215 |
+
animation: pulse 1s infinite;
|
216 |
+
}
|
217 |
+
</style>
|
218 |
+
</head>
|
219 |
+
<body>
|
220 |
+
<div class="container">
|
221 |
+
<h1><i class="fas fa-box-open"></i> 20 Large Box Pack Counter</h1>
|
222 |
+
<p class="description">Calculate how many packs you need for your boxes or how many boxes you'll get from your packs.</p>
|
223 |
+
|
224 |
+
<div class="counter-box">
|
225 |
+
<div class="input-group">
|
226 |
+
<label for="boxes"><i class="fas fa-box box-icon"></i> Number of Boxes (20 Large)</label>
|
227 |
+
<input type="number" id="boxes" placeholder="Enter number of boxes" min="0" step="1">
|
228 |
+
</div>
|
229 |
+
|
230 |
+
<div class="input-group">
|
231 |
+
<label for="packs"><i class="fas fa-archive pack-icon"></i> Number of Packs</label>
|
232 |
+
<input type="number" id="packs" placeholder="Enter number of packs" min="0" step="1">
|
233 |
+
</div>
|
234 |
+
|
235 |
+
<div class="button-group">
|
236 |
+
<button class="calculate-btn" id="calculate">
|
237 |
+
<i class="fas fa-calculator"></i> Calculate
|
238 |
+
</button>
|
239 |
+
<button class="reset-btn" id="reset">
|
240 |
+
<i class="fas fa-redo"></i> Reset
|
241 |
+
</button>
|
242 |
+
</div>
|
243 |
+
</div>
|
244 |
+
|
245 |
+
<div class="result-container" id="resultContainer">
|
246 |
+
<div class="result-title">Calculation Result:</div>
|
247 |
+
<div class="result-value" id="resultValue"></div>
|
248 |
+
</div>
|
249 |
+
|
250 |
+
<div class="info-box">
|
251 |
+
<div class="info-title"><i class="fas fa-info-circle"></i> Packaging Information</div>
|
252 |
+
<p>
|
253 |
+
Each <strong>20 Large</strong> box contains <strong>12 packs</strong>.
|
254 |
+
Use this calculator to convert between boxes and packs.
|
255 |
+
<br><br>
|
256 |
+
<strong>Example:</strong> 5 boxes = 60 packs (5 × 12)
|
257 |
+
</p>
|
258 |
+
</div>
|
259 |
+
</div>
|
260 |
+
|
261 |
+
<script>
|
262 |
+
document.addEventListener('DOMContentLoaded', function() {
|
263 |
+
const boxesInput = document.getElementById('boxes');
|
264 |
+
const packsInput = document.getElementById('packs');
|
265 |
+
const calculateBtn = document.getElementById('calculate');
|
266 |
+
const resetBtn = document.getElementById('reset');
|
267 |
+
const resultContainer = document.getElementById('resultContainer');
|
268 |
+
const resultValue = document.getElementById('resultValue');
|
269 |
+
|
270 |
+
// Focus effects for inputs
|
271 |
+
[boxesInput, packsInput].forEach(input => {
|
272 |
+
input.addEventListener('focus', function() {
|
273 |
+
this.parentNode.querySelector('label').classList.add('pulse');
|
274 |
+
});
|
275 |
+
|
276 |
+
input.addEventListener('blur', function() {
|
277 |
+
this.parentNode.querySelector('label').classList.remove('pulse');
|
278 |
+
});
|
279 |
+
});
|
280 |
+
|
281 |
+
// Calculate function
|
282 |
+
calculateBtn.addEventListener('click', function() {
|
283 |
+
const boxes = parseFloat(boxesInput.value) || 0;
|
284 |
+
const packs = parseFloat(packsInput.value) || 0;
|
285 |
+
|
286 |
+
if (boxes === 0 && packs === 0) {
|
287 |
+
resultValue.textContent = 'Please enter either boxes or packs';
|
288 |
+
resultContainer.style.display = 'block';
|
289 |
+
return;
|
290 |
+
}
|
291 |
+
|
292 |
+
if (boxes > 0 && packs > 0) {
|
293 |
+
resultValue.innerHTML = `
|
294 |
+
<div>${boxes} boxes = <strong>${boxes * 12}</strong> packs</div>
|
295 |
+
<div style="margin-top: 8px;">${packs} packs = <strong>${Math.floor(packs / 12)}</strong> full boxes + <strong>${packs % 12}</strong> extra packs</div>
|
296 |
+
`;
|
297 |
+
} else if (boxes > 0) {
|
298 |
+
resultValue.textContent = `${boxes} boxes = ${boxes * 12} packs`;
|
299 |
+
} else {
|
300 |
+
const fullBoxes = Math.floor(packs / 12);
|
301 |
+
const remainder = packs % 12;
|
302 |
+
|
303 |
+
if (fullBoxes > 0 && remainder > 0) {
|
304 |
+
resultValue.textContent = `${packs} packs = ${fullBoxes} full boxes + ${remainder} extra packs`;
|
305 |
+
} else if (fullBoxes > 0) {
|
306 |
+
resultValue.textContent = `${packs} packs = ${fullBoxes} full boxes`;
|
307 |
+
} else {
|
308 |
+
resultValue.textContent = `${packs} packs is less than 1 full box`;
|
309 |
+
}
|
310 |
+
}
|
311 |
+
|
312 |
+
resultContainer.style.display = 'block';
|
313 |
+
|
314 |
+
// Add a little visual feedback
|
315 |
+
this.classList.add('pulse');
|
316 |
+
setTimeout(() => this.classList.remove('pulse'), 1000);
|
317 |
+
});
|
318 |
+
|
319 |
+
// Reset function
|
320 |
+
resetBtn.addEventListener('click', function() {
|
321 |
+
boxesInput.value = '';
|
322 |
+
packsInput.value = '';
|
323 |
+
resultContainer.style.display = 'none';
|
324 |
+
|
325 |
+
// Add a little visual feedback
|
326 |
+
this.classList.add('pulse');
|
327 |
+
setTimeout(() => this.classList.remove('pulse'), 1000);
|
328 |
+
});
|
329 |
+
|
330 |
+
// Calculate when pressing Enter in any input
|
331 |
+
[boxesInput, packsInput].forEach(input => {
|
332 |
+
input.addEventListener('keypress', function(e) {
|
333 |
+
if (e.key === 'Enter') {
|
334 |
+
calculateBtn.click();
|
335 |
+
}
|
336 |
+
});
|
337 |
+
});
|
338 |
+
});
|
339 |
+
</script>
|
340 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: absolute; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">This website has been generated by <a href="https://enzostvs-deepsite.hf.space" style="color: #fff;" target="_blank" >DeepSite</a> <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;"></p></body>
|
341 |
+
</html>
|