diff --git a/public/static/img/tower.gif b/public/static/img/tower.gif new file mode 100644 index 0000000..6683b0a Binary files /dev/null and b/public/static/img/tower.gif differ diff --git a/public/static/style/main.css b/public/static/style/main.css index 63ac1d4..2708257 100644 --- a/public/static/style/main.css +++ b/public/static/style/main.css @@ -22,7 +22,7 @@ a { } h1 { - border-bottom: 4px double yellow; + border-bottom: .25rem double yellow; color: yellow; } @@ -31,14 +31,14 @@ img { max-width: 100%; } -pre, code { +code { + display: block; + max-width: min-content; margin: auto; font-family: monospace; background: black; color: greenyellow; - padding: 8px; - max-width: min-content; - display: block; + padding: .75rem; overflow-x: auto; overflow-y: hidden; } \ No newline at end of file diff --git a/routes/start.php b/routes/start.php index 72ed9e3..d958b94 100644 --- a/routes/start.php +++ b/routes/start.php @@ -9,6 +9,10 @@ ErrorHandler::register(function($error_messages) { Route::get('/', fn() => view('pages/home')); +Route::group(function() { + require __DIR__ . '/willychat.php'; +}); + Route::get('/test/$whatever?', function($whatever = 'Default Value') { echo htmlspecialchars($whatever); }); diff --git a/routes/willychat.php b/routes/willychat.php new file mode 100644 index 0000000..0e53dc2 --- /dev/null +++ b/routes/willychat.php @@ -0,0 +1,77 @@ + 10) { + array_pop(WillyChat::$messages); + } + + if (!empty(trim($text, ' '))) { + + array_unshift(WillyChat::$messages, [ + 'nick' => $nick, + 'date' => time(), + 'text' => $text + ]); + + file_put_contents(WillyChat::$data_path, + json_encode( + WillyChat::$messages + ) + ); + } + + $just_sent_message = true; + } + + view('pages/willychat/index', [ + 'nick' => $nick, + 'just_sent_message' => $just_sent_message + ]); +}); + +Route::get('/willychat/messages', function() { + view('pages/willychat/messages', [ + 'messages' => WillyChat::$messages + ]); +}); + +Route::get('/willychat/sync', function() { + json_response( + hash('crc32', serialize(WillyChat::$messages)) + ); +}); \ No newline at end of file diff --git a/views/pages/home.php b/views/pages/home.php index ec3b59e..29be2ae 100644 --- a/views/pages/home.php +++ b/views/pages/home.php @@ -40,8 +40,12 @@ +

Having a problem?

+

Send me a nice and positive message on matrix: @william:willy.club

+

We love you! xoxo

+

Awesome webring

diff --git a/views/pages/willychat/index.php b/views/pages/willychat/index.php new file mode 100644 index 0000000..cd73b8f --- /dev/null +++ b/views/pages/willychat/index.php @@ -0,0 +1,75 @@ + + + + + + + WillyChat + + + + +
+ + + + + +
+ + + +
+ +
+ +
+ +
+ + + + + \ No newline at end of file diff --git a/views/pages/willychat/messages.php b/views/pages/willychat/messages.php new file mode 100644 index 0000000..9a41574 --- /dev/null +++ b/views/pages/willychat/messages.php @@ -0,0 +1,46 @@ + + + + + + + + + + + +
+ says: +

+
+ + + + + \ No newline at end of file diff --git a/views/templates/footer.php b/views/templates/footer.php index b781bcc..d020983 100644 --- a/views/templates/footer.php +++ b/views/templates/footer.php @@ -1,12 +1,25 @@ -

Live chat

- +
+

Message board

+ +

Racism not allowed

+ +

+
the Willy Club(WC)
- Copyeverything © 2020 - 2194 + Copyeverything © 2020 - \ No newline at end of file diff --git a/views/templates/header.php b/views/templates/header.php index 0fd4105..0f33c0d 100644 --- a/views/templates/header.php +++ b/views/templates/header.php @@ -14,6 +14,7 @@ function special_events(): string { <?=htmlspecialchars($title)?> - the Willy Club +