mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
back/forward buttons, fix timestamps in DB
This commit is contained in:
parent
3c618a2209
commit
733f0aa228
79 changed files with 171 additions and 6904 deletions
|
|
@ -52,19 +52,14 @@ $title = $title ? $title . ' | Laravel Code Tips' : 'Laravel Code Tips';
|
|||
|
||||
<footer class="py-12 border-t">
|
||||
<ul class="px-4 space-y-4 text-center text-gray-500">
|
||||
<li>
|
||||
Found an error? Contact us at
|
||||
<x-link href="mailto:hello@laravel-code.tips">support@laravel-code.tips</x-link>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Want to share a tip? Submit it
|
||||
<x-link target="_blank" href="https://github.com/stancl/laravel-tips">here</x-link>
|
||||
<x-link href="https://github.com/stancl/laravel-tips">here</x-link>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Designed with <span class="text-red-500">❤️</span> by
|
||||
<x-link target="_blank" href="http://twitter.com/larsKlopstra/">@larsklopstra</x-link>
|
||||
<x-link target="_blank" href="http://twitter.com/LarsKlopstra">Lars Klopstra</x-link>
|
||||
</li>
|
||||
</ul>
|
||||
</footer>
|
||||
|
|
|
|||
|
|
@ -1,24 +1,32 @@
|
|||
<ul class="inline-grid grid-flow-col gap-4">
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $twitter }}">Twitter</a>
|
||||
</li>
|
||||
<div class="inline-flex flex-col">
|
||||
<ul class="inline-grid grid-flow-col gap-4">
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $twitter }}">Twitter</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>·</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>·</span>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $telegram }}">Telegram</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $telegram }}">Telegram</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>·</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>·</span>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $newsletter }}">Newsletter</a>
|
||||
</li>
|
||||
</ul>
|
||||
<li>
|
||||
<a class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900"
|
||||
href="{{ $newsletter }}">Newsletter</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="mt-3">
|
||||
<a href="/" class="transition border-b-2 border-pink-100 hover:border-pink-900 focus:outline-none focus:border-pink-900">
|
||||
All tips
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,23 +1,40 @@
|
|||
<x:layout>
|
||||
<div
|
||||
class="fixed inset-0 z-40 items-center justify-between hidden w-full h-screen p-16 pointer-events-none lg:flex">
|
||||
<a class="rounded-full shadow-md pointer-events-auto" href="#">
|
||||
<div class="flex items-center justify-center w-16 h-16 bg-white rounded-full shadow-2xl">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 text-orange-500" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||
</svg>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a class="rounded-full shadow-md pointer-events-auto" href="#">
|
||||
<div class="flex items-center justify-center w-16 h-16 bg-white rounded-full shadow-2xl">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 text-orange-500" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
{{-- Left button = newer --}}
|
||||
@if($link = $tip->newQuery()->orderBy('created_at', 'asc')->firstWhere('created_at', '>', $tip->created_at))
|
||||
<a
|
||||
class="rounded-full shadow-md pointer-events-auto"
|
||||
href="{{ route('tip.show', $link, false) }}"
|
||||
>
|
||||
<div class="flex items-center justify-center w-16 h-16 bg-white rounded-full shadow-2xl">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 text-orange-500" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||
</svg>
|
||||
</div>
|
||||
</a>
|
||||
@else
|
||||
<div>
|
||||
{{-- Placeholder for positioning of the right button --}}
|
||||
</div>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
{{-- Right button = older --}}
|
||||
@if($link = $tip->newQuery()->orderBy('created_at', 'desc')->firstWhere('created_at', '<', $tip->created_at))
|
||||
<a
|
||||
class="rounded-full shadow-md pointer-events-auto"
|
||||
href="{{ route('tip.show', $link, false) }}"
|
||||
>
|
||||
<div class="flex items-center justify-center w-16 h-16 bg-white rounded-full shadow-2xl">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 text-orange-500" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
</div>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<main class="relative flex-1 py-24">
|
||||
|
|
@ -41,7 +58,7 @@
|
|||
@endif
|
||||
|
||||
@if ($tip->content)
|
||||
<div class="prose break-all md:prose-xl">
|
||||
<div class="prose break-words md:prose-xl">
|
||||
{!! Str::markdown($tip->content) !!}
|
||||
</div>
|
||||
@endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue