Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ on:
permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
quality:
runs-on: ubuntu-latest
# Skip if this is an auto-commit from the workflow itself
if: ${{ !contains(github.event.head_commit.message, 'fix code style') }}
steps:
- uses: actions/checkout@v4

Expand All @@ -38,3 +44,18 @@ jobs:
file_pattern: |
**/*
!.github/workflows/*

# Ensures there's always a passing check on every commit
status:
name: Linter Status
runs-on: ubuntu-latest
if: always()
needs: [quality]
steps:
- name: Check quality result
run: |
if [[ "${{ needs.quality.result }}" == "failure" ]]; then
echo "Quality job failed"
exit 1
fi
echo "Linter checks passed"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ yarn-error.log
/.nova
/.vscode
/.zed
.claude
74 changes: 74 additions & 0 deletions app/Http/Controllers/LatencyController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

namespace App\Http\Controllers;

use App\Traits\RequestMirrorTrait;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class LatencyController
{
use RequestMirrorTrait;

/**
* Add a fixed delay to the response.
* GET /latency/{milliseconds}
*/
public function fixed(Request $request, string $milliseconds): JsonResponse
{
$request->merge(['milliseconds' => $milliseconds]);

$request->validate([
'milliseconds' => ['required', 'integer', 'min:0', 'max:1000'],
]);

$ms = (int) $milliseconds;
usleep($ms * 1000);

return $this->buildLatencyResponse($request, $ms);
}

/**
* Add a random delay between min and max milliseconds.
* GET /latency/between/{min}/and/{max}
*/
public function between(Request $request, string $min, string $max): JsonResponse
{
$request->merge(['min' => $min, 'max' => $max]);

$request->validate([
'min' => ['required', 'integer', 'min:0', 'max:1000', 'lte:max'],
'max' => ['required', 'integer', 'min:0', 'max:1000'],
]);

$minMs = (int) $min;
$maxMs = (int) $max;

$delayMs = random_int($minMs, $maxMs);
usleep($delayMs * 1000);

return $this->buildLatencyResponse($request, $delayMs);
}

/**
* Add a random delay between 0 and 1000 milliseconds.
* GET /latency/random
*/
public function random(Request $request): JsonResponse
{
$delayMs = random_int(0, 1000);
usleep($delayMs * 1000);

return $this->buildLatencyResponse($request, $delayMs);
}

private function buildLatencyResponse(Request $request, int $delayMs): JsonResponse
{
return response()->json([
'delay_ms' => $delayMs,
'headers' => $this->formatHeaders($request),
'origin' => $request->ip(),
'url' => $request->fullUrl(),
]);
}
}
48 changes: 48 additions & 0 deletions resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,51 @@
linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
}
}

/* Homepage component styles */
.card {
@apply bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-2xl p-8 shadow-sm hover:shadow-md transition-shadow;
}

.card-icon {
@apply w-12 h-12 bg-primary/10 rounded-xl flex items-center justify-center mb-6;
}

.card-title {
@apply text-xl font-semibold mb-6 text-gray-900 dark:text-white;
}

.route-link {
@apply font-mono text-sm text-gray-700 dark:text-gray-300 mb-1;
}

.route-link a {
@apply inline-block relative px-1.5 py-0.5 -mx-1.5 rounded transition-all duration-150 ease-out;
text-decoration: none;
}

.route-link a::before {
content: '';
@apply absolute inset-0 rounded opacity-0 transition-opacity duration-150;
background: linear-gradient(135deg, rgba(255, 57, 0, 0.08) 0%, rgba(255, 57, 0, 0.04) 100%);
}

.route-link a:hover {
@apply text-primary;
transform: translateX(2px);
}

.route-link a:hover::before {
@apply opacity-100;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
.route-link a::before {
background: linear-gradient(135deg, rgba(255, 57, 0, 0.15) 0%, rgba(255, 57, 0, 0.08) 100%);
}
}

.route-description {
@apply text-xs text-gray-500 dark:text-gray-400;
}
Loading