summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/achernar.php80
-rw-r--r--include/agbsum.php6
-rw-r--r--include/ax.php4
-rw-r--r--include/benoit.php18
-rw-r--r--include/bzipper.php8
-rw-r--r--include/dux.php4
-rw-r--r--include/eas.php4
-rw-r--r--include/luma.php4
-rw-r--r--include/pollex.php4
-rw-r--r--include/prelude.php120
-rw-r--r--include/u8c.php6
11 files changed, 186 insertions, 72 deletions
diff --git a/include/achernar.php b/include/achernar.php
index b54d189..1530e98 100644
--- a/include/achernar.php
+++ b/include/achernar.php
@@ -1,4 +1,26 @@
-<?php addHeading("The future is <em>now</em>", "about"); ?>
+<?php
+ function add_overview_card($page, $title) {
+ [$background_colour, $text_colour] = page_colours($page);
+
+ $glyph_addr = match ($page) {
+ "benoit",
+ "pollex",
+ => "/svg/glyph/" . $page . "Small.svg",
+
+ default => "/svg/glyph/" . $page . ".svg",
+ };
+
+ $card_style = "--backgroundColour: $background_colour; --textColour: $text_colour;";
+
+ echo <<<HTML
+ <a href="?p=$page" style="$card_style" title="$title">
+ <img alt="$page" src="$glyph_addr">
+ </a>
+ HTML;
+ }
+?>
+
+<?php add_heading("The future is now", "about"); ?>
<section>
<p><em>Achernar</em> is a European indie development studio based in the Capital Region of Denmark. &#127465;&#127472;</p>
@@ -8,7 +30,7 @@
<p class="note">See footer for contact information.</p>
</section>
-<?php addHeading("Projects", "projects"); ?>
+<?php add_heading("Projects", "projects"); ?>
<section class="fullWidth">
<p>The following is a list of our current projects. Click on a card to view the project's page.</p>
@@ -17,43 +39,23 @@
<br>
<div id="overview">
<?php
- function addCard($page, $title) {
- [$backgroundColour, $textColour] = pageColours($page);
-
- $glyphAddr = match ($page) {
- "benoit",
- "pollex",
- => "/svg/glyph/" . $page . "Small.svg",
-
- default => "/svg/glyph/" . $page . ".svg",
- };
-
- $cardStyle = "--backgroundColour: $backgroundColour; --textColour: $textColour;";
-
- echo <<<HTML
- <a href="?p=$page" style="$cardStyle" title="$title">
- <img alt="$page" src="$glyphAddr">
- </a>
- HTML;
- }
-
- addCard("agbsum", "agbsum");
- addCard("ax", "AX");
- //addCard("backspace", "Backspace");
- addCard("benoit", "Benoit");
- addCard("bowshock", "Bowshock");
- addCard("bzipper", "Bzipper");
- //addCard("deltaWorld", "Delta&middot;World");
- addCard("dux", "Dux");
- addCard("eas", "eAS");
- addCard("luma", "Luma");
- addCard("pollex", "Pollex");
- addCard("u8c", "u8c");
+ add_overview_card("agbsum", "agbsum");
+ add_overview_card("ax", "AX");
+ //add_overview_card("backspace", "Backspace");
+ add_overview_card("benoit", "Benoit");
+ add_overview_card("bowshock", "Bowshock");
+ add_overview_card("bzipper", "Bzipper");
+ //add_overview_card("deltaWorld", "Delta&middot;World");
+ add_overview_card("dux", "Dux");
+ add_overview_card("eas", "eAS");
+ add_overview_card("luma", "Luma");
+ add_overview_card("pollex", "Pollex");
+ add_overview_card("u8c", "u8c");
?>
</div>
</section>
-<?php addHeading("Vision", "vision"); ?>
+<?php add_heading("Vision", "vision"); ?>
<section>
<p>The goal of Achernar is to promote modern and robust software for everyone. In other words, our vision is to develop a human and clean industry and community for technology.</p>
@@ -61,7 +63,7 @@
<p>We believe in a society free of patents, and as such we release our scientific software in open-source form. For our games, we try to keep the base engine as open as possible whilst still keeping in mind that they yield our main income.</p>
</section>
-<?php addHeading("Roadmap", "roadmap"); ?>
+<?php add_heading("Roadmap", "roadmap"); ?>
<section>
<p>Currently, our roadmap is as follows:</p>
@@ -84,13 +86,13 @@
<p>This roadmap is, however, also subject to change, altough we do strive to live up to it.</p>
</section>
-<?php addHeading("Team", "team"); ?>
+<?php add_heading("Team", "team"); ?>
<section>
<p>As Achernar is currently registered as a PMV (lesser sole proprietorship), Gabriel Bjørnager Jensen is currently our only member.</p>
</section>
-<?php addHeading("Inception", "inception"); ?>
+<?php add_heading("Inception", "inception"); ?>
<section>
<p><em>Achernar</em> was incorporated on the first july of 2024 by current sole proprietor Gabriel Bjørnager Jensen.</p>
@@ -104,7 +106,7 @@
<p>Shortly after being incorporated, we registered the domain <code>achernar.io</code>. At that time, we also set up mail services using our domain.</p>
</section>
-<?php addHeading("Credits", "credits"); ?>
+<?php add_heading("Credits", "credits"); ?>
<section class="fullWidth">
<p>Thanks to <strong>Nicolas Gallagher</strong> for the <a href="https://necolas.github.io/normalize.css/"><code>normalize.css</code></a> stylesheet. Additionally thanks to the following creators for the fonts which we use on our website:</p>
diff --git a/include/agbsum.php b/include/agbsum.php
index afe3ebe..344930e 100644
--- a/include/agbsum.php
+++ b/include/agbsum.php
@@ -1,10 +1,10 @@
-<?php addHeading("agbsum", "about"); ?>
+<?php add_heading("agbsum", "about"); ?>
<section>
<p><em>agbsum</em> is a command line utility for patching AGB images.</p>
</section>
-<?php addHeading("Specs", "specs"); ?>
+<?php add_heading("Specs", "specs"); ?>
<section>
<p>All AGB images have a header at offsets <code>0x00-0xE3</code> (inclusive), of which (29) bytes in <code>0xA0-0xBD</code> denote metadata.</p>
@@ -12,7 +12,7 @@
<p>The first byte after this sequence holds a checksum of the metadata, which if invalid, the device bootloader will usually reject the entire image.</p>
</section>
-<?php addHeading("Compatibility", "compatibility"); ?>
+<?php add_heading("Compatibility", "compatibility"); ?>
<section>
<p><em>agbsum</em> is written in <strong>C99</strong> and uses makefiles as its build system. It has been tested to compile under Clang, GCC, and the <a href="https://bellard.org/tcc/">Tiny C Compiler</a> (altough the latter may have problems with the standard library). Both GNU Make (<code>gmake</code>) and BSD Make (<code>bmake</code>).</p>
diff --git a/include/ax.php b/include/ax.php
index bc7cdc4..75d13a3 100644
--- a/include/ax.php
+++ b/include/ax.php
@@ -1,10 +1,10 @@
-<?php addHeading("Advanced X", "about"); ?>
+<?php add_heading("Advanced X", "about"); ?>
<section>
<p><em>Advanced X</em> (or just <em>AX</em>) is a C library for developing apps for the <em>AGB</em> line of hardware.</p>
</section>
-<?php addHeading("Status", "status"); ?>
+<?php add_heading("Status", "status"); ?>
<section>
<p>The development of <em>AX</em> is currently on hold to prioritise <a href="?p=luma"><em>Luma</em></a> and <a href="?p=eas"><em>eAS</em></a>.</p>
diff --git a/include/benoit.php b/include/benoit.php
index 7d0013b..79e4bd9 100644
--- a/include/benoit.php
+++ b/include/benoit.php
@@ -1,29 +1,29 @@
-<?php addHeading("Benoit", "about"); ?>
+<?php add_heading("Benoit", "about"); ?>
<section>
<p><em>Benoit</em> is a Rust-written programme for visualising complex functions, e.g. <a href="https://en.wikipedia.org/wiki/Mandelbrot_set/"><em>the Mandelbrot Set</em></a> and similar fractals.</p>
<br>
- <?php addImage("benoit_2024-04-06_11-35-23", "A render of a single Minibrot on a green background. The render is coloures so that it resembles lightning coming from the Minibrot.") ?>
+ <?php add_image("benoit_2024-04-06_11-35-23", "A render of a single Minibrot on a green background. The render is coloures so that it resembles lightning coming from the Minibrot.") ?>
<br>
<p>The project consists of the core <a href="https://crates.io/crates/benoit/"><code>benoit</code></a> crate, from which the front-ends <code>benoit-cli</code> and (in the future) <code>benoit-gui</code> derive.</p>
</section>
-<?php addHeading("Features", "features"); ?>
+<?php add_heading("Features", "features"); ?>
<section>
<p>The core library uses multi-threading for rendering the provided scenes. Internally, the <a href="https://crates.io/crates/rayon/">Rayon</a> crate is used for threadpooling and such, where each pixel on the canvas is a job in and of itself.</p>
<br>
- <?php addImage("inverseJulia20231009200744", "An inverse Julia Set outside the Burning Ship fractal, resembling circles intertwined in a diamond shape with a dark red colour scheme.") ?>
+ <?php add_image("inverseJulia20231009200744", "An inverse Julia Set outside the Burning Ship fractal, resembling circles intertwined in a diamond shape with a dark red colour scheme.") ?>
<br>
<p>The <code><a href="#anchor.benoitCli">benoit-cli</a></code> front-end supports exporting to PNG. These images are saved with transparency and with sixteen bits per channel.</p>
</section>
-<?php addHeading("benoit-cli", "benoitCli"); ?>
+<?php add_heading("benoit-cli", "benoitCli"); ?>
<section>
<p>The <code>benoit-cli</code> executable can render and animate using <a href="https://en.wikipedia.org/wiki/TOML/">TOML</a> files right from the commandline.</p>
<br>
- <?php addImage("benoit_2024-04-05_20-55-13", "A Julia Set centred on a point inside the Mandelbrot Set. The resulting image resembles creeping, black vines with rainbows around.") ?>
+ <?php add_image("benoit_2024-04-05_20-55-13", "A Julia Set centred on a point inside the Mandelbrot Set. The resulting image resembles creeping, black vines with rainbows around.") ?>
<br>
<p>The main use of <code>benoit-cli</code> is to render still images or animations of fractals, e.g. zoom-ins. An example configuration could look like the following:</p>
<br>
@@ -34,17 +34,17 @@
<p class="codeblock">$ benoit-cli "benoit.toml"</p>
</section>
-<?php addHeading("benoit-gui", "benoitGui"); ?>
+<?php add_heading("benoit-gui", "benoitGui"); ?>
<section>
<p>The <code>benoit-gui</code> executable, on the other hand, allows viewing fractals in realtime. Do note, however, that this front-end is currently unimplemented.</p>
<br>
- <?php addImage("inverseJulia", "An inverse Julia Set just outside the Mandelbrot Set, with a surface resembling the bulb figures on the main cardioid's exterior.") ?>
+ <?php add_image("inverseJulia", "An inverse Julia Set just outside the Mandelbrot Set, with a surface resembling the bulb figures on the main cardioid's exterior.") ?>
<br>
<p>Until this front-end is implemented, please use version <a href="https://mandelbrot.dk/benoit/tag/?h=2.7.1"><code>2.7.1</code></a> of Benoit instead.</p>
</section>
-<?php addHeading("Docs", "docs"); ?>
+<?php add_heading("Docs", "docs"); ?>
<section>
<p>Documentation is written in source. Documentation for the main library is hosted on <a href="https://docs.rs/benoit/latest/benoit/"><code>docs.rs</code></a>.</p>
diff --git a/include/bzipper.php b/include/bzipper.php
index 8b6b677..023f30b 100644
--- a/include/bzipper.php
+++ b/include/bzipper.php
@@ -1,4 +1,4 @@
-<?php addHeading("bzipper", "about"); ?>
+<?php add_heading("bzipper", "about"); ?>
<section>
<p><em>bzipper</em> is a Rust crate for serialisation and deserialisation of binary streams.</p>
@@ -6,13 +6,13 @@
<p>See more at <code><a href="https://crates.io/crates/bzipper/">crates.io</a></code>.</p>
</section>
-<?php addHeading("rationale", "rationale"); ?>
+<?php add_heading("rationale", "rationale"); ?>
<section>
<p>Contrary to <a href="https://crates.io/crates/serde/">Serde</a>/<a href="https://crates.io/crates/bincode/">Bincode</a>, the goal of this crate is to serialise data with a known size limit. Therefore, this crate may be more suited for networking or other cases where a fixed-sized buffer is needed.</p>
</section>
-<?php addHeading("data model", "dataModel"); ?>
+<?php add_heading("data model", "dataModel"); ?>
<section>
<p>Most primitive types serialise losslessly, with the exception being <code>usize</code> and <code>isize</code>. These serialise as <code>u16</code> and <code>u32</code>, respectively, for portability reasons.</p>
@@ -20,7 +20,7 @@
<p>Unsized types, such as <code>str</code> and slices, are not supported. Instead, array should be used. For strings, the <code>FixedString</code> type is also provided.</p>
</section>
-<?php addHeading("docs", "docs"); ?>
+<?php add_heading("docs", "docs"); ?>
<section>
<p>Documentation is written in-source. See <a href="https://docs.rs/pollex/latest/pollex/"><code>docs.rs</code></a> for a rendered instance.</p>
diff --git a/include/dux.php b/include/dux.php
index 409ae2a..64c7838 100644
--- a/include/dux.php
+++ b/include/dux.php
@@ -1,10 +1,10 @@
-<?php addHeading("Dux", "about"); ?>
+<?php add_heading("Dux", "about"); ?>
<section>
<p><em>Dux</em> is a cross-platform widgeting library for developing GUI applications.</p>
</section>
-<?php addHeading("Status", "status"); ?>
+<?php add_heading("Status", "status"); ?>
<section>
<p>Dux is currently on standby and therefore unmaintained.</p>
diff --git a/include/eas.php b/include/eas.php
index ef51325..33805fa 100644
--- a/include/eas.php
+++ b/include/eas.php
@@ -1,4 +1,4 @@
-<?php addHeading("The Embedded Assembler", "about"); ?>
+<?php add_heading("The Embedded Assembler", "about"); ?>
<section>
<p>The <em>Embedded Assembler</em> (or simply <em>eAS</em>; as in <i>ease</i>) is an assembler for cross-compiling to Arm ISAs.</p>
@@ -6,7 +6,7 @@
<p>The assembler is intended as a drop-in replacement for the official <em>armasm</em> assembler by Arm Limited. It therefore imitates the same syntax.</p>
</section>
-<?php addHeading("Status", "status"); ?>
+<?php add_heading("Status", "status"); ?>
<section>
<p>Like <a href="?p=luma"><em>Luma</em></a>, the development of <em>eAS</em> is currently on hold in favour of the <a href="?p=pollex"><em>Pollex</em></a> library, which will be used as a backend.</p>
diff --git a/include/luma.php b/include/luma.php
index a8192ea..3af80af 100644
--- a/include/luma.php
+++ b/include/luma.php
@@ -1,10 +1,10 @@
-<?php addHeading("Luma", "about"); ?>
+<?php add_heading("Luma", "about"); ?>
<section>
<p><em>Luma</em> is an emulator for the <em>AGB</em> line of game consoles by Nintendo Co.</p>
</section>
-<?php addHeading("Status", "status"); ?>
+<?php add_heading("Status", "status"); ?>
<section>
<p>The development of <em>Luma</em> is currently on hold in favour of <a href="?p=pollex"><em>Pollex</em></a>, which is to be used as a backend.</p>
diff --git a/include/pollex.php b/include/pollex.php
index d4b9e69..6056aad 100644
--- a/include/pollex.php
+++ b/include/pollex.php
@@ -1,4 +1,4 @@
-<?php addHeading("Pollex", "about"); ?>
+<?php add_heading("Pollex", "about"); ?>
<section>
<p><em>Pollex</em> is a Rust crate for manipulating Arm ISA instructions. Its goal is to be used as a backend for Arm emulators, assemblers etc.</p>
@@ -8,7 +8,7 @@
<p>See more at <a href="https://crates.io/crates/pollex/"><code>crates.io</code></a>.</p>
</section>
-<?php addHeading("Docs", "docs"); ?>
+<?php add_heading("Docs", "docs"); ?>
<section>
<p>As per usual, documentation for <em>Pollex</em> can be found on <a href="https://docs.rs/pollex/latest/pollex/"><code>docs.rs</code></a>.</p>
diff --git a/include/prelude.php b/include/prelude.php
index e7d6324..bebcdf5 100644
--- a/include/prelude.php
+++ b/include/prelude.php
@@ -1,5 +1,17 @@
<?php
- function readConfig($key) {
+ function maybe_use_cache($addr, $lifetime = 0xE10) {
+ if (file_exists($addr) && filemtime($addr) > time() - $lifetime) {
+ echo file_get_contents($addr);
+
+ exit;
+ }
+ }
+
+ function dump_cache($addr, $buffer) {
+ file_put_contents($addr, $buffer);
+ }
+
+ function read_config($key) {
if (isset($_GET[$key])) {
return htmlspecialchars($_GET[$key], ENT_SUBSTITUTE, "UTF-8");
} else {
@@ -7,7 +19,7 @@
}
}
- function pageColours($page) {
+ function page_colours($page) {
return match ($page) {
"achernar" => ["#007B34", "#FFFFFF"],
"agbsum" => ["#4D4084", "#FFFFFF"],
@@ -26,13 +38,113 @@
};
}
- function addHeading($title, $anchor) {
+ function page_metadata($page) {
+ return match ($page) {
+ "achernar" => [
+ "Achernar",
+ "Achernar is a Danish indie studio developing video games and open-source software.",
+ "achernar, fractals, game, open source, open-source, software, video game",
+ ],
+
+ "agbsum" => [
+ "agbsum | Achernar",
+ "agbsum is a CLI utility for patching AGB images.",
+ "achernar, advance, agb, agbsum, cli, console, embedded, game, patch, terminal",
+ ],
+
+ "ax" => [
+ "AX | Achernar",
+ "AX is a C framework for developing AGB apps.",
+ "achernar, advance, agb, arm, assembly, ax, c, c++, cpp, cxx, thumb",
+ ],
+
+ "backspace" => [
+ "Backspace | Achernar",
+ "About the Backspace game engine.",
+ "achernar, backspace, game engine, rust, udp, webgpu",
+ ],
+
+ "benoit" => [
+ "Benoit | Achernar",
+ "Benoit is a Rust-written fractal renderer.",
+ "achernar, benoit, burning ship, cli, console, fractal, julia, mandelbrot, rust, terminal, tricorn, webgpu",
+ ],
+
+ "bowshock" => [
+ "Bowshock | Achernar",
+ "About Bowshock.",
+ "achernar, bowshock, dangerous, frontier, game, rust, open world, sci-fi, science fiction, space, video game",
+ ],
+
+ "bzipper" => [
+ "bzipper | Achernar",
+ "bzipper is a Rust crate for serialisation and deserialisation of binary streams.",
+ "achernar, binary, bzipper, deserialise, deserialiser, deserialize, deserializer, octet, serialize, serializer, serialize, serializer, tcp, udp",
+ ],
+
+ "deltaWorld" => [
+ "Delta&middot;World | Achernar",
+ "About Delta World.",
+ "achernar, adventure, delta world, open world, rust, webgpu",
+ ],
+
+ "dux" => [
+ "Dux | Achernar",
+ "Dux is a cross-platform widgeting library for developing GUI applications.",
+ "achernar, dux, multimedia, rust, webgpu, widget",
+ ],
+
+ "eas" => [
+ "eAS | Achernar",
+ "eAS is an assembler for cross-compiling to Arm ISAs.",
+ "achernar, agb, arm, as, asm, assembler, assembly, eas, embedded, risc, thumb",
+ ],
+
+ "luma" => [
+ "Luma | Achernar",
+ "Luma is an emulator for the AGB line of devices.",
+ "achernar, agb, arm, emulator, luma, rust, thumb",
+ ],
+
+ "pollex" => [
+ "Pollex | Achernar",
+ "Pollex is a Rust crate for manipulating Arm ISA instructions.",
+ "achernar, agb, arm, pollex, rust, thumb",
+ ],
+
+ "u8c" => [
+ "u8c | Achernar",
+ "u8c is a library for handling Unicode sequences in C.",
+ "achernar, u8c, unicode, utf, utf-16, utf-32, utf-8, utf16, utf32, utf8",
+ ],
+
+ default => die(),
+ };
+ }
+
+ function add_nav_bar_link($title, $page) {
+ global $current_page;
+
+ $ariaCurrent = match ($page) {
+ $current_page => "page",
+ default => "false",
+ };
+
+ $id = match ($page) {
+ "achernar" => "home",
+ default => "",
+ };
+
+ echo "<a aria-current=\"$ariaCurrent\" href=\"?p=$page\" id=\"$id\">$title</a>";
+ }
+
+ function add_heading($title, $anchor) {
$anchor = "anchor." . $anchor;
echo "<h1 id=\"$anchor\"><a class=\"anchor\" href=\"#$anchor\" title=\"Anchor\"></a> $title</h1>";
}
- function addImage($image, $alt) {
+ function add_image($image, $alt) {
$sourceAddr = "/image/source/" . $image . ".webp";
$thumbnailAddr = "/image/thumbnail/" . $image . ".avif";
diff --git a/include/u8c.php b/include/u8c.php
index c0ded80..9b04dd0 100644
--- a/include/u8c.php
+++ b/include/u8c.php
@@ -1,10 +1,10 @@
-<?php addHeading("u8c", "about"); ?>
+<?php add_heading("u8c", "about"); ?>
<section>
<p><em>u8c</em> is a library for handling Unicode sequences in C.</p>
</section>
-<?php addHeading("Features", "features"); ?>
+<?php add_heading("Features", "features"); ?>
<section>
<p><em>u8c</em> supports the following facilities:</p>
@@ -17,7 +17,7 @@
<p>Encoding and decoding <em>UTF-16</em></p>
</li>
<li>
- <p>Manipulation of <em>UTF-32</em> strings.</p>
+ <p>Manipulating <em>UTF-32</em> strings.</p>
</li>
</ul>
<br>