This commit is contained in:
floppydiskette 2024-12-07 01:11:00 +00:00
parent 3ee7cc2448
commit faed02e0c8
Signed by: fwoppydwisk
SSH key fingerprint: SHA256:Hqn452XQ1ETzUt/FthJu6+OFkS4NBxCv5VQSEvuk7CE
13 changed files with 261 additions and 28 deletions

View file

@ -0,0 +1,48 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\File;
use Illuminate\View\View;
class RoscoController extends Controller {
public function getImages(): array {
$images = [];
foreach (File::glob(public_path('images/rosco').'/*') as $path) {
$image_data = [];
try {
$exif = exif_read_data($path);
} catch (Exception $ex) {
}
$image_data["path"] = str_replace(public_path(), '', $path);
if (isset($exif)) {
if (isset($exif["ImageDescription"])) {
$image_data["description"] = $exif["ImageDescription"];
}
if (isset($exif["DateTime"])) {
$image_data["date"] = strtotime($exif["DateTime"]);
}
}
array_push($images, $image_data);
}
usort($images, function ($a, $b) {
$dateA = $a['date'] ?? PHP_INT_MIN;
$dateB = $b['date'] ?? PHP_INT_MIN;
return $dateB <=> $dateA;
});
return $images;
}
/**
* Shows the page
* @return View
*/
public function show(): View {
return view('rosco', [
'images' => $this->getImages(),
]);
}
}

View file

@ -8,13 +8,15 @@
"php": "^8.1", "php": "^8.1",
"gecche/laravel-multidomain": "^10.2", "gecche/laravel-multidomain": "^10.2",
"guzzlehttp/guzzle": "^7.2", "guzzlehttp/guzzle": "^7.2",
"intervention/image": "^3.9",
"laravel/framework": "^10.10", "laravel/framework": "^10.10",
"laravel/tinker": "^2.8", "laravel/tinker": "^2.8",
"scrivo/highlight.php": "v9.18.1.10", "scrivo/highlight.php": "v9.18.1.10",
"sentry/sentry-laravel": "^4.1", "sentry/sentry-laravel": "^4.1",
"spatie/laravel-honeypot": "^4.3", "spatie/laravel-honeypot": "^4.3",
"spatie/laravel-html": "^3.4", "spatie/laravel-html": "^3.4",
"ua-parser/uap-php": "^3.9.14" "ua-parser/uap-php": "^3.9.14",
"ext-exif": "*"
}, },
"require-dev": { "require-dev": {
"fakerphp/faker": "^1.9.1", "fakerphp/faker": "^1.9.1",

150
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "9ebfe85d188a66c9ab775b795cc6c06c", "content-hash": "9bdf6eb9bee36a39d65606daa89e30ee",
"packages": [ "packages": [
{ {
"name": "brick/math", "name": "brick/math",
@ -1191,6 +1191,150 @@
], ],
"time": "2023-12-03T19:50:20+00:00" "time": "2023-12-03T19:50:20+00:00"
}, },
{
"name": "intervention/gif",
"version": "4.2.0",
"source": {
"type": "git",
"url": "https://github.com/Intervention/gif.git",
"reference": "42c131a31b93c440ad49061b599fa218f06f93be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Intervention/gif/zipball/42c131a31b93c440ad49061b599fa218f06f93be",
"reference": "42c131a31b93c440ad49061b599fa218f06f93be",
"shasum": ""
},
"require": {
"php": "^8.1"
},
"require-dev": {
"phpstan/phpstan": "^1",
"phpunit/phpunit": "^10.0",
"slevomat/coding-standard": "~8.0",
"squizlabs/php_codesniffer": "^3.8"
},
"type": "library",
"autoload": {
"psr-4": {
"Intervention\\Gif\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Oliver Vogel",
"email": "oliver@intervention.io",
"homepage": "https://intervention.io/"
}
],
"description": "Native PHP GIF Encoder/Decoder",
"homepage": "https://github.com/intervention/gif",
"keywords": [
"animation",
"gd",
"gif",
"image"
],
"support": {
"issues": "https://github.com/Intervention/gif/issues",
"source": "https://github.com/Intervention/gif/tree/4.2.0"
},
"funding": [
{
"url": "https://paypal.me/interventionio",
"type": "custom"
},
{
"url": "https://github.com/Intervention",
"type": "github"
},
{
"url": "https://ko-fi.com/interventionphp",
"type": "ko_fi"
}
],
"time": "2024-09-20T13:35:02+00:00"
},
{
"name": "intervention/image",
"version": "3.9.1",
"source": {
"type": "git",
"url": "https://github.com/Intervention/image.git",
"reference": "b496d1f6b9f812f96166623358dfcafb8c3b1683"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Intervention/image/zipball/b496d1f6b9f812f96166623358dfcafb8c3b1683",
"reference": "b496d1f6b9f812f96166623358dfcafb8c3b1683",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"intervention/gif": "^4.2",
"php": "^8.1"
},
"require-dev": {
"mockery/mockery": "^1.6",
"phpstan/phpstan": "^1",
"phpunit/phpunit": "^10.0",
"slevomat/coding-standard": "~8.0",
"squizlabs/php_codesniffer": "^3.8"
},
"suggest": {
"ext-exif": "Recommended to be able to read EXIF data properly."
},
"type": "library",
"autoload": {
"psr-4": {
"Intervention\\Image\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Oliver Vogel",
"email": "oliver@intervention.io",
"homepage": "https://intervention.io/"
}
],
"description": "PHP image manipulation",
"homepage": "https://image.intervention.io/",
"keywords": [
"gd",
"image",
"imagick",
"resize",
"thumbnail",
"watermark"
],
"support": {
"issues": "https://github.com/Intervention/image/issues",
"source": "https://github.com/Intervention/image/tree/3.9.1"
},
"funding": [
{
"url": "https://paypal.me/interventionio",
"type": "custom"
},
{
"url": "https://github.com/Intervention",
"type": "github"
},
{
"url": "https://ko-fi.com/interventionphp",
"type": "ko_fi"
}
],
"time": "2024-10-27T10:15:54+00:00"
},
{ {
"name": "jean85/pretty-package-versions", "name": "jean85/pretty-package-versions",
"version": "2.0.6", "version": "2.0.6",
@ -9087,12 +9231,12 @@
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": [], "stability-flags": {},
"prefer-stable": true, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": "^8.1" "php": "^8.1"
}, },
"platform-dev": [], "platform-dev": {},
"plugin-api-version": "2.6.0" "plugin-api-version": "2.6.0"
} }

View file

@ -5,7 +5,7 @@
return [ return [
'name' => env('APP_NAME', 'diskfloppy.me'), 'name' => env('APP_NAME', 'diskfloppy.me'),
'version' => '2024.08.30', 'version' => '2024.12.07',
'env' => env('APP_ENV', 'production'), 'env' => env('APP_ENV', 'production'),
'debug' => (bool) env('APP_DEBUG', false), 'debug' => (bool) env('APP_DEBUG', false),
'url' => env('APP_URL', 'http://localhost'), 'url' => env('APP_URL', 'http://localhost'),

View file

@ -21,6 +21,7 @@ body {
min-height: 100%; min-height: 100%;
background-color: hsla(0, 0%, 0%, 0); background-color: hsla(0, 0%, 0%, 0);
padding: 10px; padding: 10px;
font-family: serif;
} }
/*noinspection CssUnknownTarget*/ /*noinspection CssUnknownTarget*/
@ -111,6 +112,28 @@ div#content::after {
clear: both; clear: both;
} }
div#footer {
display: grid;
grid-template-columns: auto 1fr;
grid-template-rows: 1fr;
grid-column-gap: 0px;
grid-row-gap: 0px;
align-items: center;
}
div#footer div:last-child {
text-align: right;
}
div#footer div:last-child img {
image-rendering: pixelated;
margin: 0;
padding: 0;
width: 88px;
height: 31px;
}
/** Wah! **/
div.wah { div.wah {
float: right; float: right;
border: var(--border); border: var(--border);
@ -138,27 +161,6 @@ div.wah img {
width: 250px; width: 250px;
} }
div#footer {
display: grid;
grid-template-columns: auto 1fr;
grid-template-rows: 1fr;
grid-column-gap: 0px;
grid-row-gap: 0px;
align-items: center;
}
div#footer div:last-child {
text-align: right;
}
div#footer div:last-child img {
image-rendering: pixelated;
margin: 0;
padding: 0;
width: 88px;
height: 31px;
}
/** Guestbook **/ /** Guestbook **/
table.form input, table.form input,
table.form textarea, table.form textarea,
@ -235,3 +237,25 @@ table.music-top10 tr td:first-child {
div.bookmark-category:first-child h2 { div.bookmark-category:first-child h2 {
margin: 0; margin: 0;
} }
/** Rosco **/
div.rosco-gallery {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
}
div.rosco {
border: var(--border);
padding: 5px;
filter: var(--shadow-small);
background-color: var(--background);
margin: 10px;
height: auto;
}
div.rosco,
div.rosco img {
max-width: 220px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 MiB

View file

@ -5,5 +5,6 @@
<a href="/pub">files</a> | <a href="/pub">files</a> |
<a href="/bookmarks">bookmarks</a> | <a href="/bookmarks">bookmarks</a> |
<a href="/guestbook">guestbook</a> | <a href="/guestbook">guestbook</a> |
<a href="/music">music</a> <a href="/music">music</a> |
<a href="/rosco">rosco</a>
</nav> </nav>

View file

@ -0,0 +1,13 @@
<x-layout>
<x-slot:title>Rosco</x-slot:title>
<div class="rosco-gallery">
@foreach($images as $image)
<div class="rosco">
<img src="{{ $image["path"] }}" @if(isset($image["description"])) alt="{{ $image["description"] }}" @endif>
@if(isset($image["description"]))
<p>{{$image["description"]}}</p>
@endif
</div>
@endforeach
</div>
</x-layout>

View file

@ -5,6 +5,7 @@
use App\Http\Controllers\HomeController; use App\Http\Controllers\HomeController;
use App\Http\Controllers\MusicController; use App\Http\Controllers\MusicController;
use App\Http\Controllers\PrivacyController; use App\Http\Controllers\PrivacyController;
use App\Http\Controllers\RoscoController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
/* /*
@ -22,6 +23,6 @@
Route::get('/bookmarks', [BookmarksController::class, 'show']); Route::get('/bookmarks', [BookmarksController::class, 'show']);
Route::get('/guestbook', [GuestbookController::class, 'show']); Route::get('/guestbook', [GuestbookController::class, 'show']);
Route::get('/music', [MusicController::class, 'show']); Route::get('/music', [MusicController::class, 'show']);
Route::get('/privacy', [PrivacyController::class, 'show']); Route::get('/rosco', [RoscoController::class, 'show']);
Route::post('/guestbook', [GuestbookController::class, 'addEntry']) Route::post('/guestbook', [GuestbookController::class, 'addEntry'])
->middleware('rate_limit'); ->middleware('rate_limit');