willy.club/views/pages/chat/index.php

81 lines
2.1 KiB
PHP
Raw Normal View History

2023-01-22 09:47:36 +00:00
<!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">
2023-01-22 12:17:50 +00:00
<link rel="stylesheet" href="<?=url('/static/style/fonts.css')?>">
2023-01-22 09:47:36 +00:00
<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;
2023-01-22 17:18:12 +00:00
text-indent: .5rem;
2023-01-22 09:47:36 +00:00
}
table {
border-collapse: collapse;
margin-bottom: .75rem;;
width: 100%;
}
td {
2023-01-22 17:18:12 +00:00
border: 1px solid silver;
2023-01-22 09:47:36 +00:00
}
</style>
<form method="post">
<table>
<tr>
<td style="width: 15%;">
2023-01-22 17:18:12 +00:00
<input type="text" name="nick" id="nick" placeholder="Nickname" value="<?=htmlspecialchars($nick)?>" autocomplete="off">
2023-01-22 09:47:36 +00:00
</td>
<td style="width: 75%">
2023-01-22 17:18:12 +00:00
<input type="textarea" name="text" id="text" placeholder="Message" autocomplete="off">
2023-01-22 09:47:36 +00:00
</td>
</tr>
</table>
<input style="display: none;" type="submit" value="Send">
</form>
2023-01-22 17:18:12 +00:00
<?php if ($errmsg): ?>
<p style="color: red">Error: <?=$errmsg?></p>
<?php endif; ?>
2023-01-22 09:47:36 +00:00
<div class="messages">
2023-02-03 11:00:13 +00:00
<iframe src="<?=url('./messages')?>" marginwidth="0" marginheight="0" scrolling="yes" frameborder="0"></iframe>
2023-01-22 09:47:36 +00:00
</div>
<script>
if (<?=$just_sent_message ? 'true' : 'false'?>) {
text.focus();
}
</script>
</body>
</html>