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

@ -61,4 +61,15 @@ html {
.result { .result {
font-size: 2vw; 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 <div class="error <?php echo ($data["error"] ?? "") ? "" : "invisible"; ?>">
if ($data["error"] ?? false) { <?php echo $data["error"] ?? "no error"; ?>
?> </div>
<div class="error">
<?php echo $data["error"]; ?>
</div>
<?php
}
?>
<form action="/manage" method="POST" hx-post="/manage" hx-swap="innerHTML" hx-target=".center-panel"> <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://"> <input type="text" name="url" value="<?php echo htmlspecialchars($data["url"] ?? ""); ?>" placeholder="https://">