207 lines
6.9 KiB
PHP
207 lines
6.9 KiB
PHP
<?php
|
|
if($reqPath === '/contact.php' || $reqPath === '/contact.html') {
|
|
if($reqMethod !== 'GET')
|
|
return FM_ERR | 405;
|
|
header('Location: /contact');
|
|
return FM_HIT | 302;
|
|
}
|
|
|
|
if($reqPath === '/nintendo') {
|
|
if($reqMethod !== 'GET')
|
|
return FM_ERR | 405;
|
|
header('Location: /contact#gaming');
|
|
return FM_HIT | 302;
|
|
}
|
|
|
|
if($reqPath === '/now-listening.json') {
|
|
if($reqMethod !== 'GET')
|
|
return FM_ERR | 405;
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
$lfmInfo = cache_output('lastfm', 10, function() {
|
|
return json_decode(file_get_contents('https://now.flash.moe/get.php?u=flashwave_'));
|
|
});
|
|
|
|
if(empty($lfmInfo[0]->name))
|
|
echo '[]';
|
|
else {
|
|
$lfmInfo = $lfmInfo[0];
|
|
echo json_encode([
|
|
'name' => strval($lfmInfo->name),
|
|
'now_playing' => !empty($lfmInfo->nowplaying),
|
|
'url' => strval($lfmInfo->url),
|
|
'cover' => !empty($lfmInfo->images->large) ? strval($lfmInfo->images->large) : '',
|
|
'artist' => [
|
|
'name' => !empty($lfmInfo->artist->name) ? strval($lfmInfo->artist->name) : '',
|
|
'url' => explode('/_/', strval($lfmInfo->url))[0],
|
|
],
|
|
]);
|
|
}
|
|
|
|
return FM_HIT;
|
|
}
|
|
|
|
if($reqPath === '/contact') {
|
|
if($reqMethod !== 'GET')
|
|
return FM_ERR | 405;
|
|
|
|
$contact = [
|
|
[
|
|
'id' => 'contact',
|
|
'title' => 'Direct Contact',
|
|
'items' => [
|
|
[
|
|
'id' => 'email',
|
|
'name' => 'E-mail',
|
|
'icon' => 'fmi fmi-email',
|
|
'display' => 'me@flash.moe',
|
|
'link' => 'mailto:me+contact@flash.moe',
|
|
],
|
|
],
|
|
],
|
|
|
|
[
|
|
'id' => 'communities',
|
|
'title' => 'Communities & Social Media',
|
|
'items' => [
|
|
[
|
|
'id' => 'flashii',
|
|
'name' => 'Flashii',
|
|
'icon' => 'fmi fmi-flashii',
|
|
'display' => 'flash',
|
|
'link' => '//flashii.net/profile.php?u=1',
|
|
],
|
|
[
|
|
'id' => 'twitter',
|
|
'name' => 'Twitter',
|
|
'icon' => 'fmi fmi-twitter',
|
|
'display' => '@smugwave',
|
|
'link' => '//twitter.com/smugwave',
|
|
],
|
|
[
|
|
'id' => 'youtube',
|
|
'name' => 'YouTube',
|
|
'icon' => 'fmi fmi-youtube',
|
|
'display' => 'flashwave',
|
|
'link' => '//youtube.com/c/flashwave',
|
|
],
|
|
[
|
|
'id' => 'github',
|
|
'name' => 'Github',
|
|
'icon' => 'fmi fmi-github',
|
|
'display' => 'flashwave',
|
|
'link' => '//github.com/flashwave',
|
|
],
|
|
[
|
|
'id' => 'twitch',
|
|
'name' => 'Twitch.tv',
|
|
'icon' => 'fmi fmi-twitch',
|
|
'display' => 'flashwave0',
|
|
'link' => '//twitch.tv/flashwave0',
|
|
],
|
|
[
|
|
'id' => 'lastfm',
|
|
'name' => 'Last.fm',
|
|
'icon' => 'fmi fmi-lastfm',
|
|
'display' => 'flashwave_',
|
|
'link' => '//last.fm/user/flashwave_',
|
|
],
|
|
],
|
|
],
|
|
|
|
[
|
|
'id' => 'gaming',
|
|
'title' => 'Gaming',
|
|
'items' => [
|
|
[
|
|
'id' => 'steam',
|
|
'name' => 'Steam',
|
|
'icon' => 'fmi fmi-steam',
|
|
'display' => 'flashwave_',
|
|
'link' => '//steamcommunity.com/id/flashwave_',
|
|
],
|
|
[
|
|
'id' => 'nin-sw',
|
|
'name' => 'Nintendo Switch',
|
|
'icon' => 'fmi fmi-switch',
|
|
'display' => 'SW-7446-8163-4902',
|
|
],
|
|
[
|
|
'id' => 'nin-3ds',
|
|
'name' => 'Nintendo 3DS',
|
|
'icon' => 'fmi fmi-n3ds',
|
|
'display' => '4013-0352-0648',
|
|
],
|
|
[
|
|
'id' => 'nin-wiiu',
|
|
'name' => 'Wii U / NNID',
|
|
'icon' => 'fmi fmi-wiiu',
|
|
'display' => 'flashwave0',
|
|
],
|
|
[
|
|
'id' => 'osu',
|
|
'name' => 'osu!',
|
|
'icon' => 'fmi fmi-osu',
|
|
'display' => 'flash',
|
|
'link' => '//osu.ppy.sh/u/flash',
|
|
],
|
|
],
|
|
],
|
|
|
|
[
|
|
'id' => 'support',
|
|
'title' => 'Support me',
|
|
'items' => [
|
|
[
|
|
'id' => 'paypal',
|
|
'name' => 'Paypal Donation',
|
|
'icon' => 'fmi fmi-paypal',
|
|
'display' => 'flashwave',
|
|
'link' => '//paypal.me/flashwave',
|
|
],
|
|
[
|
|
'id' => 'patreon',
|
|
'name' => 'Patreon',
|
|
'icon' => 'fmi fmi-patreon',
|
|
'display' => 'flashwave',
|
|
'link' => '//patreon.com/flashwave',
|
|
],
|
|
],
|
|
],
|
|
];
|
|
|
|
fm_component('header', [
|
|
'title' => 'flash.moe / contact',
|
|
]);
|
|
|
|
foreach($contact as $section) {
|
|
?>
|
|
<div class="section" id="section-<?=$section['id'];?>">
|
|
<div class="section-content">
|
|
<div class="section-background"></div>
|
|
<h1><?=$section['title'];?></h1>
|
|
</div>
|
|
</div>
|
|
<div class="socials">
|
|
<?php foreach($section['items'] as $social): ?>
|
|
<div class="social social-<?=$social['id'];?>">
|
|
<?php if(isset($social['link'])): ?>
|
|
<a href="<?=$social['link'];?>" class="social-background" target="_blank" rel="noopener"></a>
|
|
<?php else: ?>
|
|
<div class="social-background" onclick="fm.selectTextInElement(this.parentNode.querySelector('.social-handle')); fm.copySelectedText();"></div>
|
|
<?php endif; ?>
|
|
<div class="social-icon <?=$social['icon'];?>"></div>
|
|
<div class="social-content">
|
|
<div class="social-name"><?=$social['name'];?></div>
|
|
<div class="social-handle"><?=$social['display'];?></div>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
fm_component('footer');
|
|
|
|
return FM_HIT;
|
|
}
|