From 656e63b8acafdbcba4f876c3c0da042b053c0a30 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sat, 6 Jul 2024 13:14:33 +0200 Subject: [PATCH] wip: 2024-07-05T14:14:12+0200 (1720181652) --- api/endpoints/battlestation/chassis/GET.php | 5 ++- api/endpoints/battlestation/coolers/GET.php | 5 ++- api/endpoints/battlestation/cpu/GET.php | 5 ++- api/endpoints/battlestation/dram/GET.php | 5 ++- api/endpoints/battlestation/gpu/GET.php | 5 ++- api/endpoints/battlestation/mb/GET.php | 5 ++- api/endpoints/battlestation/psu/GET.php | 5 ++- api/endpoints/battlestation/storage/GET.php | 5 ++- .../models/Battlestation/Chassis.php | 2 +- .../models/Battlestation/Coolers.php | 2 +- .../databases/models/Battlestation/Cpu.php | 2 +- .../databases/models/Battlestation/Dram.php | 2 +- .../databases/models/Battlestation/Gpu.php | 2 +- api/src/databases/models/Battlestation/Mb.php | 2 +- .../databases/models/Battlestation/Psu.php | 2 +- .../models/Battlestation/Storage.php | 20 +++++----- assets/css/pages/about/battlestation.css | 27 ++++++++++++-- assets/media/icons/chevron.svg | 2 +- pages/about.php | 1 + pages/about/battlestation.php | 37 ++++++++++++------- 20 files changed, 98 insertions(+), 43 deletions(-) diff --git a/api/endpoints/battlestation/chassis/GET.php b/api/endpoints/battlestation/chassis/GET.php index 7277912..b00c21d 100644 --- a/api/endpoints/battlestation/chassis/GET.php +++ b/api/endpoints/battlestation/chassis/GET.php @@ -54,7 +54,10 @@ ->type(Type::NUMBER) ->type(Type::NULL) ->min(0) - ->max(parent::MYSQL_TINYINT_MAX_LENGTH) + ->max(parent::MYSQL_TINYINT_MAX_LENGTH), + + (new Rules(ChassisModel::IS_RETIRED->value)) + ->type(Type::BOOLEAN) ]); parent::__construct(Databases::BATTLESTATION, $this->ruleset); diff --git a/api/endpoints/battlestation/coolers/GET.php b/api/endpoints/battlestation/coolers/GET.php index 133e52a..5d93726 100644 --- a/api/endpoints/battlestation/coolers/GET.php +++ b/api/endpoints/battlestation/coolers/GET.php @@ -59,7 +59,10 @@ (new Rules(CoolerModel::VENDOR_MODEL->value)) ->type(Type::STRING) ->min(1) - ->max(parent::MYSQL_VARCHAR_MAX_LENGTH) + ->max(parent::MYSQL_VARCHAR_MAX_LENGTH), + + (new Rules(CoolerModel::IS_RETIRED->value)) + ->type(Type::BOOLEAN) ]); parent::__construct(Databases::BATTLESTATION, $this->ruleset); diff --git a/api/endpoints/battlestation/cpu/GET.php b/api/endpoints/battlestation/cpu/GET.php index 8a109c9..2bdfb69 100644 --- a/api/endpoints/battlestation/cpu/GET.php +++ b/api/endpoints/battlestation/cpu/GET.php @@ -68,7 +68,10 @@ (new Rules(CpuModel::VENDOR_MODEL->value)) ->type(Type::STRING) ->min(1) - ->max(parent::MYSQL_VARCHAR_MAX_LENGTH) + ->max(parent::MYSQL_VARCHAR_MAX_LENGTH), + + (new Rules(CpuModel::IS_RETIRED->value)) + ->type(Type::BOOLEAN) ]); parent::__construct(Databases::BATTLESTATION, $this->ruleset); diff --git a/api/endpoints/battlestation/dram/GET.php b/api/endpoints/battlestation/dram/GET.php index 09c2813..72539af 100644 --- a/api/endpoints/battlestation/dram/GET.php +++ b/api/endpoints/battlestation/dram/GET.php @@ -66,7 +66,10 @@ (new Rules(DramModel::VENDOR_MODEL->value)) ->type(Type::STRING) ->min(1) - ->max(parent::MYSQL_VARCHAR_MAX_LENGTH) + ->max(parent::MYSQL_VARCHAR_MAX_LENGTH), + + (new Rules(DramModel::IS_RETIRED->value)) + ->type(Type::BOOLEAN) ]); parent::__construct(Databases::BATTLESTATION, $this->ruleset); diff --git a/api/endpoints/battlestation/gpu/GET.php b/api/endpoints/battlestation/gpu/GET.php index 17ce6f5..5a8598b 100644 --- a/api/endpoints/battlestation/gpu/GET.php +++ b/api/endpoints/battlestation/gpu/GET.php @@ -56,7 +56,10 @@ (new Rules(GpuModel::VENDOR_CHIP_MODEL->value)) ->type(Type::STRING) ->min(1) - ->max(parent::MYSQL_VARCHAR_MAX_LENGTH) + ->max(parent::MYSQL_VARCHAR_MAX_LENGTH), + + (new Rules(GpuModel::IS_RETIRED->value)) + ->type(Type::BOOLEAN) ]); parent::__construct(Databases::BATTLESTATION, $this->ruleset); diff --git a/api/endpoints/battlestation/mb/GET.php b/api/endpoints/battlestation/mb/GET.php index 43cd84e..d2c0ea0 100644 --- a/api/endpoints/battlestation/mb/GET.php +++ b/api/endpoints/battlestation/mb/GET.php @@ -83,7 +83,10 @@ ->type(Type::NULL) ->type(Type::STRING) ->min(1) - ->max(parent::MYSQL_VARCHAR_MAX_LENGTH) + ->max(parent::MYSQL_VARCHAR_MAX_LENGTH), + + (new Rules(MbModel::IS_RETIRED->value)) + ->type(Type::BOOLEAN) ]); parent::__construct(Databases::BATTLESTATION, $this->ruleset); diff --git a/api/endpoints/battlestation/psu/GET.php b/api/endpoints/battlestation/psu/GET.php index 63352b0..2420422 100644 --- a/api/endpoints/battlestation/psu/GET.php +++ b/api/endpoints/battlestation/psu/GET.php @@ -53,7 +53,10 @@ (new Rules(PsuModel::VENDOR_MODEL->value)) ->type(Type::STRING) ->min(1) - ->max(parent::MYSQL_VARCHAR_MAX_LENGTH) + ->max(parent::MYSQL_VARCHAR_MAX_LENGTH), + + (new Rules(PsuModel::IS_RETIRED->value)) + ->type(Type::BOOLEAN) ]); parent::__construct(Databases::BATTLESTATION, $this->ruleset); diff --git a/api/endpoints/battlestation/storage/GET.php b/api/endpoints/battlestation/storage/GET.php index a0f2366..4bfff74 100644 --- a/api/endpoints/battlestation/storage/GET.php +++ b/api/endpoints/battlestation/storage/GET.php @@ -61,7 +61,10 @@ (new Rules(StorageModel::VENDOR_MODEL->value)) ->type(Type::STRING) ->min(1) - ->max(parent::MYSQL_VARCHAR_MAX_LENGTH) + ->max(parent::MYSQL_VARCHAR_MAX_LENGTH), + + (new Rules(StorageModel::IS_RETIRED->value)) + ->type(Type::BOOLEAN) ]); parent::__construct(Databases::BATTLESTATION, $this->ruleset); diff --git a/api/src/databases/models/Battlestation/Chassis.php b/api/src/databases/models/Battlestation/Chassis.php index 2967440..55a8417 100644 --- a/api/src/databases/models/Battlestation/Chassis.php +++ b/api/src/databases/models/Battlestation/Chassis.php @@ -15,5 +15,5 @@ case STORAGE_TWOINCHFIVE = "storage_2i5hi"; case STORAGE_THREEINCHFIVE = "storage_3i5hi"; case DATE_AQUIRED = "date_aquired"; - case DATE_RETIRED = "date_retired"; + case IS_RETIRED = "is_retired"; } \ No newline at end of file diff --git a/api/src/databases/models/Battlestation/Coolers.php b/api/src/databases/models/Battlestation/Coolers.php index 5f60bd8..56f5e40 100644 --- a/api/src/databases/models/Battlestation/Coolers.php +++ b/api/src/databases/models/Battlestation/Coolers.php @@ -12,5 +12,5 @@ case VENDOR_NAME = "vendor_name"; case VENDOR_MODEL = "vendor_model"; case DATE_AQUIRED = "date_aquired"; - case DATE_RETIRED = "date_retired"; + case IS_RETIRED = "is_retired"; } \ No newline at end of file diff --git a/api/src/databases/models/Battlestation/Cpu.php b/api/src/databases/models/Battlestation/Cpu.php index b036971..ddc5b2d 100644 --- a/api/src/databases/models/Battlestation/Cpu.php +++ b/api/src/databases/models/Battlestation/Cpu.php @@ -27,5 +27,5 @@ case VENDOR_NAME = "vendor_name"; case VENDOR_MODEL = "vendor_model"; case DATE_AQUIRED = "date_aquired"; - case DATE_RETIRED = "date_retired"; + case IS_RETIRED = "is_retired"; } \ No newline at end of file diff --git a/api/src/databases/models/Battlestation/Dram.php b/api/src/databases/models/Battlestation/Dram.php index e135417..cf5c8f4 100644 --- a/api/src/databases/models/Battlestation/Dram.php +++ b/api/src/databases/models/Battlestation/Dram.php @@ -33,5 +33,5 @@ case VENDOR_NAME = "vendor_name"; case VENDOR_MODEL = "vendor_model"; case DATE_AQUIRED = "date_aquired"; - case DATE_RETIRED = "date_retired"; + case IS_RETIRED = "is_retired"; } \ No newline at end of file diff --git a/api/src/databases/models/Battlestation/Gpu.php b/api/src/databases/models/Battlestation/Gpu.php index 47b8877..c6ce0b4 100644 --- a/api/src/databases/models/Battlestation/Gpu.php +++ b/api/src/databases/models/Battlestation/Gpu.php @@ -16,5 +16,5 @@ case VENDOR_CHIP_NAME = "vendor_chip_name"; case VENDOR_CHIP_MODEL = "vendor_chip_model"; case DATE_AQUIRED = "date_aquired"; - case DATE_RETIRED = "date_retired"; + case IS_RETIRED = "is_retired"; } \ No newline at end of file diff --git a/api/src/databases/models/Battlestation/Mb.php b/api/src/databases/models/Battlestation/Mb.php index 7c4c207..e200c1d 100644 --- a/api/src/databases/models/Battlestation/Mb.php +++ b/api/src/databases/models/Battlestation/Mb.php @@ -26,5 +26,5 @@ case NETWORK_WLAN = "network_wlan"; case NETWORK_BLUETOOTH = "network_bluetooth"; case DATE_AQUIRED = "date_aquired"; - case DATE_RETIRED = "date_retired"; + case IS_RETIRED = "is_retired"; } \ No newline at end of file diff --git a/api/src/databases/models/Battlestation/Psu.php b/api/src/databases/models/Battlestation/Psu.php index 7a3be44..8214b5d 100644 --- a/api/src/databases/models/Battlestation/Psu.php +++ b/api/src/databases/models/Battlestation/Psu.php @@ -27,5 +27,5 @@ case TYPE_MODULAR = "type_modular"; case EIGHTYPLUS_RATING = "80plus_rating"; case DATE_AQUIRED = "date_aquired"; - case DATE_RETIRED = "date_retired"; + case IS_RETIRED = "is_retired"; } \ No newline at end of file diff --git a/api/src/databases/models/Battlestation/Storage.php b/api/src/databases/models/Battlestation/Storage.php index 16e6afd..da61b33 100644 --- a/api/src/databases/models/Battlestation/Storage.php +++ b/api/src/databases/models/Battlestation/Storage.php @@ -32,14 +32,14 @@ const TABLE = "storage"; - case ID = "id"; - case DISK_TYPE = "disk_type"; - case DISK_SIZE = "disk_size"; - case DISK_SECTORS = "disk_sectors"; - case DISK_INTERFACE = "disk_interface"; - case DISK_FORMFACTOR = "disk_formfactor"; - case VENDOR_NAME = "vendor_name"; - case VENDOR_MODEL = "vendor_model"; - case DATE_AQUIRED = "date_aquired"; - case DATE_RETIRED = "date_retired"; + case ID = "id"; + case DISK_TYPE = "disk_type"; + case DISK_SIZE = "disk_size"; + case DISK_SECTORS = "disk_sectors"; + case DISK_INTERFACE = "disk_interface"; + case DISK_FORMFACTOR = "disk_formfactor"; + case VENDOR_NAME = "vendor_name"; + case VENDOR_MODEL = "vendor_model"; + case DATE_AQUIRED = "date_aquired"; + case IS_RETIRED = "is_retired"; } \ No newline at end of file diff --git a/assets/css/pages/about/battlestation.css b/assets/css/pages/about/battlestation.css index 47a22e4..84e4641 100644 --- a/assets/css/pages/about/battlestation.css +++ b/assets/css/pages/about/battlestation.css @@ -13,6 +13,23 @@ main { /* # Content */ +/* ## Title */ + +section.title { + display: flex; + flex-direction: column; + gap: 5px; + padding: calc(var(--padding) * 1.5); + background-color: rgba(var(--primer-color-accent), .1); + border-radius: 6px; +} + +section.title > div { + margin-top: calc(var(--padding) / 2); + display: flex; + gap: var(--padding); +} + /* ## Heading */ section.heading h1::before, @@ -37,11 +54,11 @@ section.config { gap: calc(var(--padding) * 2); } -section.config:nth-child(4n+1) { +section.config:nth-child(4n+2) { grid-template-columns: 1fr 300px; } -section.config:nth-child(4n+1) > svg { +section.config:nth-child(4n+2) > svg { order: 1; } @@ -258,8 +275,12 @@ section.config .specs .group.active + .collection { /* # Size quries */ @media (max-width: 700px) { + section.title > div { + flex-direction: column; + } + section.config, - section.config:nth-child(4n+1) { + section.config:nth-child(4n+2) { grid-template-columns: 1fr; } diff --git a/assets/media/icons/chevron.svg b/assets/media/icons/chevron.svg index 83c2dbe..056ac62 100644 --- a/assets/media/icons/chevron.svg +++ b/assets/media/icons/chevron.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/pages/about.php b/pages/about.php index 5431d1f..5957ac9 100755 --- a/pages/about.php +++ b/pages/about.php @@ -16,6 +16,7 @@

Personal

With a cup of coffee ready at hand, I can at times become a real armchair detective for a variety of nerdy topics I find interesting, and spend hours reading as much as I can about them too. I like to skii when I'm not glued in front of a computer screen.

+

I do occationally game, and I also have a silent passion for building gaming computers (even servers recently!) that comes out every few years.

Projects

diff --git a/pages/about/battlestation.php b/pages/about/battlestation.php index 9f2d5b5..641533c 100644 --- a/pages/about/battlestation.php +++ b/pages/about/battlestation.php @@ -57,6 +57,15 @@ ?> ok): ?> +
+

Battle­stations

+

I'd be happy to send you, dear reader, any component that you find here for "free" that hasn't been retired yet. The only thing I ask in return is that you pay for shipping.

+

I can't guarantee the thing you want will work as expected, or work at all! But I will test the compontent for you if I still have means at hand to do so.

+
+ +
+
+ json() as $config): ?> value]) ?>

- value]): ?> + value]): ?>
-

value]) ?>

+

Yes

@@ -166,10 +175,10 @@

value]) ?>

- value]): ?> + value]): ?>
-

value]) ?>

+

Yes

@@ -221,10 +230,10 @@

value]) ?>

- value]): ?> + value]): ?>
-

value]) ?>

+

Yes

@@ -278,10 +287,10 @@

value]) ?>

- value]): ?> + value]): ?>
-

value]) ?>

+

Yes

@@ -325,10 +334,10 @@

value]) ?>

- value]): ?> + value]): ?>
-

value]) ?>

+

Yes

@@ -393,10 +402,10 @@

value]) ?>

- value]): ?> + value]): ?>
-

value]) ?>

+

Yes

@@ -464,10 +473,10 @@

value]) ?>

- value]): ?> + value]): ?>
-

value]) ?>

+

Yes