Skip to content

Commit 293ba30

Browse files
committed
Add Alpine; show shortcuts
Closes #26
1 parent 815b73d commit 293ba30

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ Homestead.yaml
1212
npm-debug.log
1313
yarn-error.log
1414
/public/page-cache
15+
.phpunit.cache/

.phpunit.cache/test-results

Lines changed: 0 additions & 1 deletion
This file was deleted.

resources/css/app.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,8 @@
7676
::file-selector-button {
7777
border-color: var(--color-gray-200, currentcolor);
7878
}
79+
80+
[x-cloak] {
81+
display: none !important;
82+
}
7983
}

resources/views/consoles/index.blade.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
11
@extends('layouts.app')
22

33
@section('content')
4-
<div class="container max-w-4xl mx-auto">
4+
<div class="container max-w-4xl mx-auto" x-data="{ showShortcuts: $persist(false) }">
5+
<div class="flex justify-end items-center gap-2 mx-2 mb-4 md:mx-0">
6+
<span class="text-sm text-gray-600">Show shortcut URLs?</span>
7+
<button
8+
type="button"
9+
role="switch"
10+
:aria-checked="showShortcuts"
11+
@click="showShortcuts = !showShortcuts"
12+
:class="showShortcuts ? 'bg-green-500' : 'bg-gray-300'"
13+
class="relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full transition-colors duration-200 ease-in-out"
14+
>
15+
<span
16+
:class="showShortcuts ? 'translate-x-5' : 'translate-x-0'"
17+
class="pointer-events-none inline-block h-6 w-6 rounded-full bg-white shadow ring-0 transition-transform duration-200 ease-in-out"
18+
></span>
19+
</button>
20+
</div>
21+
522
@foreach ($providers as $provider)
623
<div class="font-semibold m-2 text-gray-700 text-lg uppercase">{{ $provider->name }}</div>
724
<div class="grow flex flex-wrap rounded-sm mx-2 mb-8 md:mx-0">
825
@foreach ($provider->consoles as $console)
9-
<a href="{{ $console->url }}" class="m-2" id="{{ $console->shortcut }}">
26+
<a href="{{ $console->url }}" class="m-2" id="{{ $console->route }}">
1027
<div class="bg-blue-700 hover:bg-blue-800 px-5 py-3 rounded-lg shadow-xs text-white hover:text-white">
1128
<h4 class="font-semibold text-lg leading-tight truncate">{{ $console->name }}</h4>
29+
<p x-show="showShortcuts" x-cloak class="text-sm text-white/70 leading-tight">/{{ $console->route }}</p>
1230
</div>
1331
</a>
1432
@endforeach

resources/views/layouts/app.blade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
<!-- Styles -->
3434
@vite('resources/css/app.css')
3535

36+
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/persist@3.x.x/dist/cdn.min.js"></script>
37+
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
38+
3639
@if (config('services.fathom.id'))
3740
<script src="https://cdn.usefathom.com/script.js" data-site="{{ config('services.fathom.id') }}" defer></script>
3841
@endif

0 commit comments

Comments
 (0)