diff --git a/static/filterWeapons.js b/static/filterWeapons.js index f6d1f39..f18bafd 100644 --- a/static/filterWeapons.js +++ b/static/filterWeapons.js @@ -573,7 +573,7 @@ form.addEventListener('submit', e => { mag_size: parseFloat(data.get('magazin')), reload_time: parseFloat(data.get('reload-time')), damage_multiplier: parseFloat(data.get('multiplier')), - guntype: data.getAll('gun-type') + guntype: data.get('gun-type') ? [data.get('gun-type')] : [] }; // 2) Add it local diff --git a/static/style.css b/static/style.css index 0ea1a53..1efd321 100644 --- a/static/style.css +++ b/static/style.css @@ -1,5 +1,5 @@ *, *::before, *::after { - box-sizing: border-box; + box-sizing: border-box; } input[type="text"] { @@ -453,41 +453,153 @@ body.menu-open { } .select-wrapper { - width: 100%; - margin-bottom: 20px; + width: 100%; + margin-bottom: 20px; } .select-wrapper > input[type="text"], .select-wrapper > select { - width: 100%; - padding: 8px 12px; - font-size: 16px; - border: 1px solid #ccc; - border-radius: 8px; - background-color: #f9f9f9; - appearance: none; - -webkit-appearance: none; - -moz-appearance: none; - transition: border-color 0.3s, box-shadow 0.3s; + width: 100%; + padding: 8px 12px; + font-size: 16px; + border: 1px solid #ccc; + border-radius: 8px; + background-color: #f9f9f9; + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + transition: border-color 0.3s, box-shadow 0.3s; } .select-wrapper > select { - background-image: url("data:image/svg+xml;utf8,\ + background-image: url("data:image/svg+xml;utf8,\ \ \ "); - background-repeat: no-repeat; - background-position: right 12px center; - background-size: 1em; + background-repeat: no-repeat; + background-position: right 12px center; + background-size: 1em; } .select-wrapper > input[type="text"]:focus, .select-wrapper > select:focus { - outline: none; - border-color: darkred; - box-shadow: 0 0 5px rgba(139, 0, 0, 0.5); + outline: none; + border-color: darkred; + box-shadow: 0 0 5px rgba(139, 0, 0, 0.5); } .select-wrapper > input[type="text"]::placeholder { - color: #888; + color: #888; +} + +#weapon-form { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + padding: 40px 0; + background: rgba(0, 0, 0, 0.5); + justify-content: center; + align-items: center; + z-index: 2500; +} + +/* When JS opens it, we set display:flex */ +#weapon-form.show { + display: flex; +} + +/* The white “card” in the center */ +#weapon-form > div { + background: #fff; + padding: 24px; + border-radius: 8px; + width: 90%; + max-width: 480px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); + position: relative; +} + +/* Header inside the card */ +#weapon-form h2 { + margin-top: 0; + color: #222; + font-size: 1.75rem; + text-align: center; +} + +/* All form inputs stretch full width */ +#weapon-form form input[type="text"], +#weapon-form form input[type="number"], +#weapon-form form select { + width: 100%; + padding: 8px 12px; + margin-top: 4px; + margin-bottom: 16px; + border: 1px solid #ccc; + border-radius: 6px; + font-size: 1rem; + background: #fafafa; + transition: border-color 0.2s ease; +} + +/* Multi-select box a bit taller */ +#weapon-form form select[multiple] { + min-height: 120px; +} + +/* On focus, highlight */ +#weapon-form form input:focus, +#weapon-form form select:focus { + outline: none; + border-color: darkred; + box-shadow: 0 0 4px rgba(139, 0, 0, 0.4); +} + +/* Buttons in the modal */ +#weapon-form form button { + padding: 10px 20px; + border: none; + border-radius: 6px; + font-size: 1rem; + cursor: pointer; + margin-right: 8px; +} + +/* Confirm (Create) */ +#weapon-form form button[type="submit"] { + background-color: darkred; + color: #fff; +} + +#weapon-form form button[type="submit"]:hover { + background-color: red; +} + +/* Cancel */ +#weapon-form form button#weapon-cancel { + background-color: #666; + color: #fff; +} + +#weapon-form form button#weapon-cancel:hover { + background-color: #444; +} + +/* The “Create New Weapon” opener button */ +#weapon-create { + margin: 0 0 20px; + padding: 10px 16px; + background-color: darkred; + border: none; + border-radius: 6px; + color: white; + font-size: 1rem; + cursor: pointer; +} + +#weapon-create:hover { + background-color: red; } \ No newline at end of file diff --git a/templates/calculator.html b/templates/calculator.html index 7fff01a..bbc65b3 100644 --- a/templates/calculator.html +++ b/templates/calculator.html @@ -25,13 +25,15 @@
- - -
- - +
+ + +
+ + +
@@ -67,16 +69,18 @@

-

+
+ @@ -97,14 +101,16 @@
- - - +
+ + +
+ + +

- -

Operative Specific Modifiers