vlw.se/public/work.php

138 lines
No EOL
4.4 KiB
PHP

<?php
use Reflect\Response;
use VLW\Client\API;
use VLW\API\Endpoints;
use VLW\API\Databases\VLWdb\Models\Work\WorkModel;
require_once VV::root("src/client/API.php");
require_once VV::root("api/src/Endpoints.php");
require_once VV::root("api/src/databases/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([
WorkModel::IS_LISTED->value => true
])->get();
}
private function get_item(string $key): array {
$idx = array_search($key, array_column($this->resp->json(), WorkModel::ID->value));
return $this->resp->json()[$idx];
}
public function get_summary(string $key): string {
return $this->resp->ok ? $this->get_item($key)[WorkModel::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">read more</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">read more</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">view source</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">playground</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">view source</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">read more</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">read more</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">read more</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">view full timeline</button></a>
</section>