Refactored weapon forms and enhanced styling.

This commit is contained in:
IM23a-spirgif
2025-05-19 22:31:10 +02:00
parent 0f0137c2e9
commit 2217cfbdb8
3 changed files with 158 additions and 40 deletions
+133 -21
View File
@@ -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,\
<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23666' viewBox='0 0 24 24'>\
<path d='M7 10l5 5 5-5z'/>\
</svg>");
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;
}