mirror of
https://git.sr.ht/~iwakuralain/text0Nly
synced 2025-07-27 15:36:11 +00:00
beautiful i think
This commit is contained in:
parent
f1a6426e22
commit
b4bf88f7b0
216
main/index.php
216
main/index.php
@ -48,61 +48,187 @@ try {
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Text0Nly</title>
|
<title>Text0Nly</title>
|
||||||
<style>
|
<style>
|
||||||
body { font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; }
|
body {
|
||||||
.message { margin: 10px 0; padding: 10px; border: 1px solid #ddd; border-radius: 5px; }
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||||
.username { font-weight: bold; color: #2196F3; }
|
max-width: 800px;
|
||||||
.time { color: #666; font-size: 0.8em; }
|
margin: 0 auto;
|
||||||
.encrypted { color: #4CAF50; }
|
padding: 20px;
|
||||||
.signature { color: #FF9800; font-size: 0.8em; }
|
background: #f5f5f5;
|
||||||
form { margin: 20px 0; }
|
color: #333;
|
||||||
textarea { width: 100%; height: 100px; margin: 10px 0; }
|
}
|
||||||
input[type="text"] { width: 200px; }
|
.container {
|
||||||
.register-link { position: fixed; top: 20px; right: 20px; }
|
background: white;
|
||||||
.api-info { margin: 20px 0; padding: 10px; background: #f5f5f5; border-radius: 5px; }
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
.message {
|
||||||
|
margin: 10px 0;
|
||||||
|
padding: 15px;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: white;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
.message:hover {
|
||||||
|
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
.username {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #2196F3;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.time {
|
||||||
|
color: #999;
|
||||||
|
font-size: 0.8em;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.encrypted {
|
||||||
|
color: #4CAF50;
|
||||||
|
font-size: 0.9em;
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
.signature {
|
||||||
|
color: #FF9800;
|
||||||
|
font-size: 0.9em;
|
||||||
|
margin-top: 5px;
|
||||||
|
padding-top: 5px;
|
||||||
|
border-top: 1px solid #eee;
|
||||||
|
}
|
||||||
|
form {
|
||||||
|
margin: 20px 0;
|
||||||
|
background: white;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
input[type="text"] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 5px 0;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
textarea {
|
||||||
|
width: 100%;
|
||||||
|
height: 100px;
|
||||||
|
margin: 10px 0;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 4px;
|
||||||
|
resize: vertical;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
background: #2196F3;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 12px 24px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: 600;
|
||||||
|
transition: background 0.2s ease;
|
||||||
|
}
|
||||||
|
button:hover {
|
||||||
|
background: #1976D2;
|
||||||
|
}
|
||||||
|
.register-link {
|
||||||
|
position: fixed;
|
||||||
|
top: 20px;
|
||||||
|
right: 20px;
|
||||||
|
background: white;
|
||||||
|
padding: 8px 16px;
|
||||||
|
border-radius: 4px;
|
||||||
|
text-decoration: none;
|
||||||
|
color: #2196F3;
|
||||||
|
font-weight: 600;
|
||||||
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
.register-link:hover {
|
||||||
|
background: #2196F3;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.api-info {
|
||||||
|
margin: 20px 0;
|
||||||
|
padding: 15px;
|
||||||
|
background: #f8f9fa;
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
}
|
||||||
|
.api-info pre {
|
||||||
|
background: #2d2d2d;
|
||||||
|
color: #fff;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
.checkbox-wrapper {
|
||||||
|
margin: 10px 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.checkbox-wrapper input[type="checkbox"] {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.checkbox-wrapper label {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
color: #2196F3;
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
}
|
||||||
|
.clear {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="register-link">
|
<div class="container">
|
||||||
<a href="register.php">Register</a>
|
<div class="register-link">
|
||||||
</div>
|
<a href="register.php">Register</a>
|
||||||
|
</div>
|
||||||
<h1>Text0Nly</h1>
|
|
||||||
|
<h1>Text0Nly</h1>
|
||||||
<div class="api-info">
|
|
||||||
<h3>Message API:</h3>
|
<div class="api-info">
|
||||||
<pre>curl -X POST http://localhost/api.php -H "Content-Type: application/json" -d '{
|
<h3>Message API:</h3>
|
||||||
|
<pre>curl -X POST http://localhost/api.php -H "Content-Type: application/json" -d '{
|
||||||
"username": "name",
|
"username": "name",
|
||||||
"message": "text",
|
"message": "text",
|
||||||
"signature": "pgp_signature",
|
"signature": "pgp_signature",
|
||||||
"encrypted": true
|
"encrypted": true
|
||||||
}'</pre>
|
}'</pre>
|
||||||
</div>
|
|
||||||
|
|
||||||
<form method="post">
|
|
||||||
<input type="text" name="username" placeholder="Your username" required maxlength="50">
|
|
||||||
<textarea name="message" placeholder="Your message" required></textarea>
|
|
||||||
<textarea name="signature" placeholder="PGP signature (optional)"></textarea>
|
|
||||||
<div>
|
|
||||||
<input type="checkbox" name="encrypted" id="encrypted">
|
|
||||||
<label for="encrypted">Message is encrypted</label>
|
|
||||||
</div>
|
</div>
|
||||||
<button type="submit">Send</button>
|
|
||||||
</form>
|
<form method="post">
|
||||||
|
<input type="text" name="username" placeholder="Your username" required maxlength="50">
|
||||||
<div id="messages">
|
<textarea name="message" placeholder="Your message" required></textarea>
|
||||||
<?php foreach ($messages as $msg): ?>
|
<textarea name="signature" placeholder="PGP signature (optional)"></textarea>
|
||||||
<div class="message">
|
<div class="checkbox-wrapper">
|
||||||
<span class="username"><?= htmlspecialchars($msg['username']) ?>:</span>
|
<input type="checkbox" name="encrypted" id="encrypted">
|
||||||
<div><?= nl2br(htmlspecialchars($msg['message'])) ?></div>
|
<label for="encrypted">Message is encrypted</label>
|
||||||
<?php if ($msg['is_encrypted']): ?>
|
|
||||||
<span class="encrypted">[Encrypted]</span>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($msg['signature']): ?>
|
|
||||||
<div class="signature">Signature: <?= htmlspecialchars($msg['signature']) ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<span class="time"><?= $msg['created_at'] ?></span>
|
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<button type="submit">Send Message</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div id="messages">
|
||||||
|
<?php foreach ($messages as $msg): ?>
|
||||||
|
<div class="message">
|
||||||
|
<span class="username"><?= htmlspecialchars($msg['username']) ?></span>
|
||||||
|
<?php if ($msg['is_encrypted']): ?>
|
||||||
|
<span class="encrypted">[Encrypted]</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
<span class="time"><?= $msg['created_at'] ?></span>
|
||||||
|
<div class="clear"></div>
|
||||||
|
<div class="message-content"><?= nl2br(htmlspecialchars($msg['message'])) ?></div>
|
||||||
|
<?php if ($msg['signature']): ?>
|
||||||
|
<div class="signature">Signature: <?= htmlspecialchars($msg['signature']) ?></div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user