flash.moe/pages/contact.php

51 lines
1.6 KiB
PHP
Raw Normal View History

2020-07-30 00:55:37 +00:00
<?php
2022-02-04 20:30:52 +00:00
namespace Makai;
2022-02-05 03:35:42 +00:00
$router->get('/contact.php', mkiRedirect('/contact'));
$router->get('/contact.html', mkiRedirect('/contact'));
2022-09-25 22:17:54 +00:00
$router->get('/nintendo', mkiRedirect('/contact'));
$router->get('/nintendo.php', mkiRedirect('/contact'));
2020-07-30 00:55:37 +00:00
2022-09-26 19:09:33 +00:00
$router->get('/contact', function() use ($db) {
$contacts = (new Contacts($db))->getAll();
2020-07-30 00:55:37 +00:00
2022-02-05 03:35:42 +00:00
$body = fm_component('header', [
2020-07-30 00:55:37 +00:00
'title' => 'flash.moe / contact',
]);
2022-09-26 19:09:33 +00:00
$body .= <<<HTML
<div class="section">
<div class="section-content">
<div class="section-background"></div>
<h1>Contacts</h1>
</div>
</div>
<div class="socials">
2022-02-05 03:35:42 +00:00
HTML;
2022-09-26 19:09:33 +00:00
foreach($contacts as $contact) {
$body .= '<div class="social social-' . $contact->getName() . '" style="--social-colour: ' . $contact->getColourHex() . '">';
2022-02-05 03:35:42 +00:00
2022-09-26 19:09:33 +00:00
if($contact->hasLink()) {
$body .= '<a href="' . $contact->getLink() . '" class="social-background" target="_blank" rel="noopener"></a>';
} else {
$body .= '<div class="social-background" onclick="fm.selectTextInElement(this.parentNode.querySelector(\'.social-handle\')); fm.copySelectedText();"></div>';
}
2022-02-05 03:35:42 +00:00
2022-09-26 19:09:33 +00:00
$body .= <<<HTML
<div class="social-icon {$contact->getIcon()}"></div>
<div class="social-content">
<div class="social-name">{$contact->getName()}</div>
<div class="social-handle">{$contact->getDisplay()}</div>
2020-07-30 00:55:37 +00:00
</div>
2022-09-26 19:09:33 +00:00
</div>
2022-02-05 03:35:42 +00:00
HTML;
2020-07-30 00:55:37 +00:00
}
2022-09-26 19:09:33 +00:00
$body .= '</div>';
2022-02-05 03:35:42 +00:00
$body .= fm_component('footer');
2020-07-30 00:55:37 +00:00
2022-02-05 03:35:42 +00:00
return $body;
});