feat: Formatting for error messages

This commit is contained in:
overflowerror 2023-12-03 14:00:09 +01:00
parent 099c85ef7b
commit 358447514f
2 changed files with 14 additions and 9 deletions

View file

@ -62,3 +62,14 @@ html {
.result {
font-size: 2vw;
}
.error {
border: 1px solid red;
color: red;
padding: 0.2vw;
font-size: 1.3vw;
}
.invisible {
opacity: 0;
}

View file

@ -1,12 +1,6 @@
<?php
if ($data["error"] ?? false) {
?>
<div class="error">
<?php echo $data["error"]; ?>
<div class="error <?php echo ($data["error"] ?? "") ? "" : "invisible"; ?>">
<?php echo $data["error"] ?? "no error"; ?>
</div>
<?php
}
?>
<form action="/manage" method="POST" hx-post="/manage" hx-swap="innerHTML" hx-target=".center-panel">
<input type="text" name="url" value="<?php echo htmlspecialchars($data["url"] ?? ""); ?>" placeholder="https://">