diff --git a/static/filterWeapons.js b/static/filterWeapons.js
index 7f9b77f..7cced4a 100644
--- a/static/filterWeapons.js
+++ b/static/filterWeapons.js
@@ -587,6 +587,54 @@ modal.addEventListener('click', e => {
}
});
+document.getElementById('copy-stats').addEventListener('click', async () => {
+ const statsTable = document.querySelector('#weapon-stats table tr + tr');
+ if (!statsTable) {
+ showCopyMessage('No weapon selected to copy.', 'error');
+ return;
+ }
+ const cells = Array.from(statsTable.querySelectorAll('td')).map(td => td.innerText.trim());
+ const [ name, dmg, rpm, mag, reload, dps, dpm, avgDps ] = cells;
+ const globalMods = Array.from(
+ document.querySelectorAll('#modifiers label input:checked')
+ ).map(cb => cb.parentNode.textContent.trim());
+ const opMods = Array.from(
+ document.querySelectorAll('#operative-modifiers label input:checked')
+ ).map(cb => cb.parentNode.textContent.trim());
+ const allMods = globalMods.concat(opMods);
+ const modsString = allMods.length
+ ? allMods.join(', ')
+ : 'None';
+ const payload = [
+ `Weapon: ${name}`,
+ `Damage: ${dmg}`,
+ `RPM: ${rpm}`,
+ `Mag Size: ${mag}`,
+ `Reload Time: ${reload}`,
+ `DPS: ${dps}`,
+ `DPM: ${dpm}`,
+ `Average DPS: ${avgDps}`,
+ `Modifiers used for this calculation: ${modsString}`
+ ].join('\n');
+ try {
+ await navigator.clipboard.writeText(payload);
+ showCopyMessage('✅ Stats copied to clipboard!', 'success');
+ } catch (err) {
+ console.error(err);
+ showCopyMessage('Failed to copy.', 'error');
+ }
+});
+
+function showCopyMessage(text, type) {
+ const msg = document.getElementById('copy-message');
+ msg.textContent = text;
+ msg.className = type;
+ setTimeout(() => {
+ msg.textContent = '';
+ msg.className = '';
+ }, 3000);
+}
+
// Initialize
fetchWeaponsData();
diff --git a/static/style.css b/static/style.css
index ed4ec88..afc752e 100644
--- a/static/style.css
+++ b/static/style.css
@@ -596,4 +596,53 @@ body.menu-open {
#weapon-create:hover {
background-color: red;
+}
+
+#copy-stats {
+ background: darkred;
+ color: #fff;
+ border: none;
+ border-radius: 6px;
+ padding: 10px 16px;
+ font-size: 1rem;
+ cursor: pointer;
+ transition: background 0.2s;
+}
+#copy-stats:hover {
+ background: red;
+}
+
+#copy-message {
+ margin-top: 8px;
+ font-size: 0.95rem;
+ min-height: 1.2em;
+}
+
+#copy-message.success {
+ color: green;
+}
+
+#copy-message.error {
+ color: crimson;
+}
+
+.checkbox-group {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 12px;
+ margin-bottom: 16px;
+ border: none;
+ padding: 0;
+}
+.checkbox-group legend {
+ font-weight: bold;
+ margin-bottom: 8px;
+}
+.checkbox-group label {
+ display: flex;
+ align-items: center;
+ font-size: 0.95em;
+}
+.checkbox-group input {
+ margin-right: 6px;
}
\ No newline at end of file
diff --git a/templates/calculator.html b/templates/calculator.html
index b7fa2a6..a23b897 100644
--- a/templates/calculator.html
+++ b/templates/calculator.html
@@ -61,31 +61,28 @@
-