updated messages bar

This commit is contained in:
Lain Iwakura 2025-06-16 03:16:06 +03:00
parent 70c510f388
commit 0894483bb1
No known key found for this signature in database
GPG Key ID: C7C18257F2ADC6F8
2 changed files with 134 additions and 21 deletions

View File

@ -102,7 +102,7 @@ try {
</div> </div>
<?php if (!empty($error)): ?> <?php if (!empty($error)): ?>
<div class="error" style="color:red; margin-bottom:10px;"> <?= htmlspecialchars($error) ?> </div> <div class="error"><?= htmlspecialchars($error) ?></div>
<?php endif; ?> <?php endif; ?>
<div class="messages-container" id="messages"> <div class="messages-container" id="messages">
@ -121,25 +121,29 @@ try {
<?php if (!empty($_SESSION['is_moderator'])): ?> <?php if (!empty($_SESSION['is_moderator'])): ?>
<form method="get" style="display:inline"> <form method="get" style="display:inline">
<input type="hidden" name="delete" value="<?= $msg['id'] ?>"> <input type="hidden" name="delete" value="<?= $msg['id'] ?>">
<button type="submit" style="color:#a00; background:none; border:none; cursor:pointer;">удалить</button> <button type="submit" class="delete-btn">удалить</button>
</form> </form>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</div>
<div class="form-container"> <div class="message-bar">
<form method="post"> <form method="post" class="message-form">
<div class="message-inputs">
<input type="text" name="username" placeholder="Your username" required maxlength="50" value="<?= isset($_SESSION['username']) ? htmlspecialchars($_SESSION['username']) : '' ?>"> <input type="text" name="username" placeholder="Your username" required maxlength="50" value="<?= isset($_SESSION['username']) ? htmlspecialchars($_SESSION['username']) : '' ?>">
<textarea name="message" placeholder="Your message" required></textarea> <textarea name="message" placeholder="Your message" required></textarea>
<textarea name="signature" placeholder="PGP signature (optional)"></textarea> </div>
<div class="message-options">
<textarea name="signature" placeholder="PGP signature (optional)" class="signature-input"></textarea>
<div class="checkbox-wrapper"> <div class="checkbox-wrapper">
<input type="checkbox" name="encrypted" id="encrypted"> <input type="checkbox" name="encrypted" id="encrypted">
<label for="encrypted">Message is encrypted</label> <label for="encrypted">Message is encrypted</label>
</div> </div>
<button type="submit">Send Message</button> <button type="submit" class="send-btn">Send</button>
</form>
</div> </div>
</form>
</div> </div>
<script> <script>

View File

@ -4,6 +4,7 @@ body {
padding: 0; padding: 0;
background: #fff; background: #fff;
color: #222; color: #222;
padding-bottom: 200px;
} }
.container { .container {
@ -17,6 +18,12 @@ body {
.header { .header {
margin-bottom: 18px; margin-bottom: 18px;
position: sticky;
top: 0;
background: #fff;
padding: 12px 0;
z-index: 100;
border-bottom: 1px solid #eee;
} }
.header h1 { .header h1 {
@ -27,10 +34,13 @@ body {
.header-buttons { .header-buttons {
margin-bottom: 8px; margin-bottom: 8px;
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
} }
.header-buttons a { .header-buttons a {
margin-right: 16px;
color: #222; color: #222;
text-decoration: underline; text-decoration: underline;
font-size: 1em; font-size: 1em;
@ -60,6 +70,9 @@ body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 2px; gap: 2px;
padding: 12px;
border-radius: 8px;
background: #f8f9fa;
} }
.username { .username {
@ -85,37 +98,133 @@ body {
margin-top: 2px; margin-top: 2px;
} }
.form-container { .message-bar {
margin-top: 12px; position: fixed;
padding-top: 12px; bottom: 0;
left: 0;
right: 0;
background: #fff;
padding: 12px;
border-top: 1px solid #eee;
box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}
.message-form {
max-width: 700px;
margin: 0 auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
} }
.message-inputs {
display: flex;
gap: 8px;
}
.message-inputs input[type="text"] {
width: 150px;
flex-shrink: 0;
}
.message-inputs textarea {
flex: 1;
min-height: 40px;
resize: none;
}
.message-options {
display: flex;
gap: 8px;
align-items: center;
flex-wrap: wrap;
}
.signature-input {
flex: 1;
min-height: 40px;
resize: none;
}
input[type="text"], textarea { input[type="text"], textarea {
width: 100%;
font-size: 1em; font-size: 1em;
padding: 6px; padding: 8px;
margin-bottom: 4px; border: 1px solid #ddd;
border: 1px solid #ccc; border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
} }
button { button {
width: fit-content;
font-size: 1em; font-size: 1em;
padding: 6px 16px; padding: 8px 16px;
background: #fff; background: #222;
color: #222; color: #fff;
border: 1px solid #ccc; border: none;
border-radius: 4px;
cursor: pointer; cursor: pointer;
} }
button:hover {
background: #444;
}
.checkbox-wrapper { .checkbox-wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 6px; gap: 6px;
} }
.delete-btn {
background: none;
color: #dc3545;
padding: 0;
font-size: 0.9em;
}
.delete-btn:hover {
background: none;
text-decoration: underline;
}
.error {
color: #dc3545;
margin-bottom: 10px;
padding: 8px;
background: #fff;
border-radius: 4px;
border: 1px solid #dc3545;
}
.api-info, .api-info pre, .modal, .modal-content, .close { display: none !important; } .api-info, .api-info pre, .modal, .modal-content, .close { display: none !important; }
@media (max-width: 600px) {
.message-inputs {
flex-direction: column;
}
.message-inputs input[type="text"] {
width: 100%;
}
.message-options {
flex-direction: column;
align-items: stretch;
}
.signature-input {
width: 100%;
}
.header-buttons {
flex-direction: column;
align-items: flex-start;
}
.container {
padding: 12px 8px 0 8px;
}
.message {
padding: 8px;
}
}