vlw.se/public/work.php

166 lines
5.2 KiB
PHP

<?php
use Reflect\Response;
use VLW\Client\API;
use VLW\API\Endpoints;
use VLW\Database\Tables\Work\WorkTable;
require_once VV::root("src/client/API.php");
require_once VV::root("api/src/Endpoints.php");
require_once VV::root("api/src/Database/Models/Work/Work.php");
// Number of items from the timeline to display on this page
const TIMELINE_PREVIEW_LIMIT = 5;
$work = new class extends API {
const ERROR_MSG = "Something went wrong";
private readonly Response $resp;
public function __construct() {
parent::__construct();
// Get work items from endpoint
$this->resp = $this->call(Endpoints::WORK->value)->params([
WorkTable::IS_LISTED->value => true
])->get();
}
private function get_item(string $key): array {
$idx = array_search($key, array_column($this->resp->json(), WorkTable::ID->value));
return $this->resp->json()[$idx];
}
public function get_summary(string $key): string {
return $this->resp->ok ? $this->get_item($key)[WorkTable::SUMMARY->value] : self::ERROR_MSG;
}
}
?>
<style><?= VV::css("public/assets/css/pages/work") ?></style>
<section class="hero">
<div class="item vegvisir">
<div class="wrapper">
<div class="title">
<?= VV::embed("public/assets/media/icons/vegvisir.svg") ?>
<h1>vegvisir</h1>
</div>
<p><?= $work->get_summary("vlw/vegvisir") ?></p>
<div class="actions">
<a href="https://vegvisir.vlw.se"><button class="inline solid">
<p>read more</p>
<?= VV::embed("public/assets/media/icons/chevron.svg") ?>
</button></a>
</div>
</div>
</div>
<div class="item reflect">
<div class="wrapper">
<div class="title">
<?= VV::embed("public/assets/media/icons/reflect.svg") ?>
<h1>reflect</h1>
</div>
<p><?= $work->get_summary("vlw/reflect") ?></p>
<div class="actions">
<a href="https://reflect.vlw.se"><button class="inline solid">
<p>read more</p>
<?= VV::embed("public/assets/media/icons/chevron.svg") ?>
</button></a>
</div>
</div>
</div>
</section>
<section class="featured">
<featured-item>
<div class="title">
<?= VV::embed("public/assets/media/icons/vw.svg") ?>
</div>
<h3>vlw.se</h3>
<p>Can I put my own website here, is that cheating? Maybe, but I think this site counts as the most important thing I've personally created. I've only used my own libraries and frameworks to create this website, so it kind of works as a live demonstration of many of my web projects bundled together.</p>
<div class="actions">
<a href="https://codeberg.org/vlw/vlw.se"><button class="inline">
<p>read more</p>
<?= VV::embed("public/assets/media/icons/chevron.svg") ?>
</button></a>
</div>
</featured-item>
<featured-item>
<div class="title">
<?= VV::embed("public/assets/media/icons/vw.svg") ?>
</div>
<h3>Silly dabbles</h3>
<p>I create silly things for fun to challenge myself sometimes, and putting them all on the timeline is not right. So I made an appropriately-themed and named page to highlight most of my "what if I could" projects.</p>
<div class="actions">
<a href="/playground"><button class="inline">
<p>playground</p>
<?= VV::embed("public/assets/media/icons/chevron.svg") ?>
</button></a>
</div>
</featured-item>
<featured-item>
<div class="title">
<?= VV::embed("public/assets/media/icons/repo.svg") ?>
</div>
<h3>vlw/php-mysql</h3>
<p><?= $work->get_summary("vlw/php-mysql") ?></p>
<div class="actions">
<a href="https://codeberg.org/vlw/php-mysql"><button class="inline">
<?= VV::embed("public/assets/media/icons/codeberg.svg") ?>
<p>view source</p>
<?= VV::embed("public/assets/media/icons/chevron.svg") ?>
</button></a>
</div>
</featured-item>
<featured-item>
<div class="title">
<?= VV::embed("public/assets/media/icons/star.svg") ?>
</div>
<h3>Website for iCellate Medical</h3>
<p><?= $work->get_summary("icellate/website") ?></p>
<div class="actions">
<a href="/work/icellate/website"><button class="inline">
<p>read more</p>
<?= VV::embed("public/assets/media/icons/chevron.svg") ?>
</button></a>
</div>
</featured-item>
<featured-item>
<div class="title">
<?= VV::embed("public/assets/media/icons/star.svg") ?>
</div>
<h3>Modernizing GeneMate by iCellate</h3>
<p><?= $work->get_summary("icellate/genemate") ?></p>
<div class="actions">
<a href="/work/icellate/genemate"><button class="inline">
<p>read more</p>
<?= VV::embed("public/assets/media/icons/chevron.svg") ?>
</button></a>
</div>
</featured-item>
<featured-item>
<div class="title">
<?= VV::embed("public/assets/media/icons/star.svg") ?>
</div>
<h3>Custom pages for Deltaco AB</h3>
<p><?= $work->get_summary("deltaco/asyncapp") ?></p>
<div class="actions">
<a href="/work/deltaco/asyncapp"><button class="inline">
<p>read more</p>
<?= VV::embed("public/assets/media/icons/chevron.svg") ?>
</button></a>
</div>
</featured-item>
</section>
<section class="heading">
<h1>latest projects</h1>
</section>
<?= VV::include("public/work/timeline?limit=" . TIMELINE_PREVIEW_LIMIT) ?>
<section class="heading">
<a href="/work/timeline"><button class="inline solid">
<p>view full timeline</p>
<?= VV::embed("public/assets/media/icons/chevron.svg") ?>
</button></a>
</section>