willy.club/views/pages/willychat/index.php
2023-01-22 10:47:36 +01:00

75 lines
2.0 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WillyChat</title>
</head>
<body>
<style>
html, body {
height: 100%;
}
body {
margin: 0;
display: flex;
flex-flow: column;
color: white;
}
body .messages {
flex: 1 1 auto;
display: flex;
}
.messages {
border: 0;
}
iframe {
width: 100%;
height: 100%;
}
input {
color: #fff;
width: 100%;
background: rgba(0, 0, 0, 0.75);
padding: .75rem;
padding-left: 0;
padding-right: 0;
border: 0;
}
table {
border-collapse: collapse;
margin-bottom: .75rem;;
width: 100%;
}
td {
border: 1px solid #aaa;
}
</style>
<form method="post">
<table>
<tr>
<td style="width: 15%;">
<input style="text-indent: .5rem" type="text" name="nick" id="nick" placeholder="Nickname" value="<?=htmlspecialchars($nick)?>" autocomplete="off">
</td>
<td style="width: 75%">
<input style="text-indent: .5rem" type="textarea" name="text" id="text" placeholder="Message" autocomplete="off">
</td>
</tr>
</table>
<input style="display: none;" type="submit" value="Send">
</form>
<div class="messages">
<iframe src="<?=url('/willychat/messages')?>" marginwidth="0" marginheight="0" scrolling="yes" frameborder="0"></iframe>
</div>
<script>
if (<?=$just_sent_message ? 'true' : 'false'?>) {
text.focus();
}
</script>
</body>
</html>