summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blog/index.php2
-rw-r--r--index.php16
-rw-r--r--lib/partials.php64
-rw-r--r--links.json27
-rwxr-xr-xstatic/img/icons/mail.png (renamed from static/img/letter.png)bin641 -> 641 bytes
-rw-r--r--static/img/icons/xmpp.pngbin0 -> 1636 bytes
-rw-r--r--static/style.css38
7 files changed, 99 insertions, 48 deletions
diff --git a/blog/index.php b/blog/index.php
index 773cc6f..7573d97 100644
--- a/blog/index.php
+++ b/blog/index.php
@@ -1,6 +1,7 @@
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/time.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/post.php';
+include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/partials.php';
$post_id = null;
$url = parse_url($_SERVER['REQUEST_URI']);
@@ -33,6 +34,7 @@ if ($post_id) {
<body>
<main>
+ <?php html_header(); ?>
<p><a href="/">ilt.su</a> - <a href="/blog/">blog</a></p>
<?php if (isset($post)): ?>
<h1><?= $post['name'] ?? '<i>No title.</i>' ?></h1>
diff --git a/index.php b/index.php
index a7b36dd..1d22335 100644
--- a/index.php
+++ b/index.php
@@ -1,12 +1,11 @@
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/time.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/post.php';
+include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/partials.php';
+
if (file_exists("{$_SERVER['DOCUMENT_ROOT']}/projects.json") && $contents = file_get_contents("{$_SERVER['DOCUMENT_ROOT']}/projects.json")) {
$projects = json_decode($contents, true);
}
-if (file_exists("{$_SERVER['DOCUMENT_ROOT']}/links.json") && $contents = file_get_contents("{$_SERVER['DOCUMENT_ROOT']}/links.json")) {
- $links = json_decode($contents, true);
-}
$posts = get_posts();
if (!empty($posts)) {
@@ -27,9 +26,7 @@ if (!empty($posts)) {
<body>
<main>
- <div class="rain">
- <p><img src="/static/img/pepe.png" alt="FeelsBadMan ☔ " width="18" height="18"> I'm just a memer</p>
- </div>
+ <?php html_header(); ?>
<?php if (isset($projects)): ?>
<section class="projects">
<?php foreach ($projects as $p): ?>
@@ -69,13 +66,6 @@ if (!empty($posts)) {
alt="[rss]"></a></p>
</div>
<?php endif; ?>
- <?php if (isset($links)): ?>
- <div class="main-links">
- <?php foreach ($links as $l): ?>
- <a href="<?= $l['url'] ?>"><img src="/static/img/<?= $l['icon'] ?>.png" alt=""><?= $l['title'] ?></a>
- <?php endforeach; ?>
- </div>
- <?php endif; ?>
</main>
</body>
diff --git a/lib/partials.php b/lib/partials.php
new file mode 100644
index 0000000..b94f6a3
--- /dev/null
+++ b/lib/partials.php
@@ -0,0 +1,64 @@
+<?php
+function html_header()
+{
+ $links = [
+ [
+ 'title' => "home",
+ 'url' => "/"
+ ],
+ [
+ 'title' => "software",
+ 'url' => "/software"
+ ],
+ [
+ 'title' => "wiki",
+ 'url' => "https://wiki.ilt.su"
+ ],
+ [
+ 'title' => "git",
+ 'url' => "https://git.ilt.su"
+ ],
+ [
+ 'title' => "server status",
+ 'url' => "https://status.ilt.su"
+ ],
+ [
+ 'title' => 'mail me!',
+ 'url' => 'mailto:iltsu@alright.party',
+ 'icon' => 'mail',
+ 'external' => true
+ ],
+ [
+ 'title' => 'XMPP me!',
+ 'url' => 'xmpp:iltsu@alright.party',
+ 'icon' => 'xmpp',
+ 'external' => true
+ ],
+ ];
+
+ echo '' ?>
+ <header>
+ <div class="brand rain">
+ <p><img src="/static/img/pepe.png" alt="FeelsBadMan ☔ " width="18" height="18"> I'm just a memer</p>
+ </div>
+ <div class="links">
+ <div class="crosspage-links">
+ <?php foreach (array_filter($links, fn($x) => !isset($x['external'])) as $l): ?>
+ <a href="<?= $l['url'] ?>">
+ <?php if (isset($l['icon'])): ?>
+ <img src="/static/img/icons/<?= $l['icon'] ?>.png" alt="">
+ <?php endif; ?>
+ <?= $l['title'] ?>
+ </a>
+ <?php endforeach; ?>
+ </div>
+ <div class="external-links">
+ <?php foreach (array_filter($links, fn($x) => isset($x['external'], $x['icon'])) as $l): ?>
+ <a href="<?= $l['url'] ?>"><img src="/static/img/icons/<?= $l['icon'] ?>.png" alt="<?= $l['title'] ?>"
+ title="<?= $l['title'] ?>"></a>
+ <?php endforeach; ?>
+ </div>
+ </div>
+ </header>
+ <?php ;
+} \ No newline at end of file
diff --git a/links.json b/links.json
deleted file mode 100644
index 9f585c5..0000000
--- a/links.json
+++ /dev/null
@@ -1,27 +0,0 @@
-[
- {
- "title": "wiki",
- "icon": "wiki",
- "url": "https://wiki.alright.party"
- },
- {
- "title": "@teabot",
- "icon": "bot",
- "url": "https://bot.alright.party"
- },
- {
- "title": "radicle",
- "icon": "radicle",
- "url": "https://app.radicle.xyz/nodes/seed.ilt.su"
- },
- {
- "title": "git",
- "icon": "git",
- "url": "https://git.ilt.su"
- },
- {
- "title": "server status",
- "icon": "status",
- "url": "https://status.ilt.su"
- }
-] \ No newline at end of file
diff --git a/static/img/letter.png b/static/img/icons/mail.png
index 7348aed..7348aed 100755
--- a/static/img/letter.png
+++ b/static/img/icons/mail.png
Binary files differ
diff --git a/static/img/icons/xmpp.png b/static/img/icons/xmpp.png
new file mode 100644
index 0000000..4ef9638
--- /dev/null
+++ b/static/img/icons/xmpp.png
Binary files differ
diff --git a/static/style.css b/static/style.css
index 74332eb..6070bdb 100644
--- a/static/style.css
+++ b/static/style.css
@@ -40,26 +40,48 @@ p img {
vertical-align: bottom;
}
-.status {
+/** HEADER */
+header .links {
display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
+ flex-direction: row;
+
+ border-top: dashed 2px black;
+ border-bottom: dashed 2px black;
+ margin: 4px 0;
+
+ font-size: 18px;
}
-.main-links {
+.links .crosspage-links {
display: flex;
flex-direction: row;
- justify-content: space-around;
+ flex-grow: 1;
+}
+
+.crosspage-links a {
+ padding: 4px 8px;
+}
+
+.external-links a:hover {
+ background: unset;
+ color: black;
}
-.main-links img {
+.external-links img {
vertical-align: middle;
+ height: 24px;
+}
+
+.status {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
}
.rain {
width: 100%;
- min-height: 10%;
+ min-height: 96px;
background-image: url('/static/img/rain.gif');
background-repeat: repeat;