button animated change component..
This commit is contained in:
parent
47610fa373
commit
ded7bfdce6
36
app/View/Components/Button/Hover.php
Normal file
36
app/View/Components/Button/Hover.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Button;
|
||||
|
||||
use App\Abstracts\View\Component;
|
||||
|
||||
class Hover extends Component
|
||||
{
|
||||
public $color;
|
||||
|
||||
public $groupHover;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
string $color = 'to-black',
|
||||
bool $groupHover = false,
|
||||
|
||||
) {
|
||||
$this->color = $color;
|
||||
$this->groupHover = $groupHover;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.button.hover');
|
||||
}
|
||||
}
|
@ -3,11 +3,11 @@
|
||||
namespace App\View\Components\Link;
|
||||
|
||||
use App\Abstracts\View\Component;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class Hover extends Component
|
||||
{
|
||||
public $color;
|
||||
|
||||
public $groupHover;
|
||||
|
||||
/**
|
||||
|
@ -9,9 +9,9 @@
|
||||
<x-dropdown id="dashboard-list">
|
||||
<x-slot name="trigger" class="flex items-center" override="class">
|
||||
<span class="text-2xl xl:text-5xl text-black font-light truncate">
|
||||
<x-link.hover color="to-black-700">
|
||||
<x-button.hover color="to-black-700">
|
||||
{{ $dashboard->name }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</span>
|
||||
|
||||
<svg class="w-5 h-5 mt-1 text-gray-400" x-description="Heroicon name: solid/selector" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
|
@ -35,7 +35,7 @@
|
||||
@foreach($category['reports'] as $report)
|
||||
<div class="flex justify-between sm:col-span-3 p-1 group">
|
||||
<div class="lg:w-80">
|
||||
<a href="{{ route('reports.show', $report->id) }}" class="flex">
|
||||
<x-link href="{{ route('reports.show', $report->id) }}" class="flex" override="class">
|
||||
<span class="material-icons-outlined text-5xl transform transition-all hover:scale-125 text-black-400">
|
||||
{{ $icons[$report->id] }}
|
||||
</span>
|
||||
@ -47,9 +47,11 @@
|
||||
</x-link.hover>
|
||||
</h2>
|
||||
|
||||
<span class="text-black-400 text-sm">{{ $report->description }}</span>
|
||||
<span class="text-black-400 text-sm">
|
||||
{{ $report->description }}
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
</x-link>
|
||||
</div>
|
||||
|
||||
<div class="flex items-start ltr:space-x-2 rtl:space-x-reverse">
|
||||
|
9
resources/views/components/button/hover.blade.php
Normal file
9
resources/views/components/button/hover.blade.php
Normal file
@ -0,0 +1,9 @@
|
||||
<span
|
||||
@class([
|
||||
$color,
|
||||
$groupHover ? 'group-hover:bg-full-2' : 'hover:bg-full-2',
|
||||
'bg-no-repeat bg-0-2 bg-0-full bg-gradient-to-b from-transparent transition-backgroundSize'
|
||||
])
|
||||
>
|
||||
{!! $slot !!}
|
||||
</span>
|
@ -189,20 +189,20 @@
|
||||
<div class="absolute -top-6 left-3 flex items-center">
|
||||
@if (! $hideDiscount && in_array(setting('localisation.discount_location'), ['item', 'both']))
|
||||
<div class="text-left border-0 p-0 mr-16" v-if="!row.add_discount">
|
||||
<button type="button" class="text-xs text-purple" @click="onAddLineDiscount(index)">
|
||||
<x-link.hover color="to-purple">
|
||||
<x-button type="button" class="text-xs text-purple" @click="onAddLineDiscount(index)" override="class">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans('general.title.add', ['type' => trans('invoices.discount')]) }}
|
||||
</x-link.hover>
|
||||
</button>
|
||||
</x-button.hover>
|
||||
</x-button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="text-right border-0 p-0 pr-4">
|
||||
<button type="button" class="text-xs text-purple" @click="onAddTax(index)">
|
||||
<x-link.hover color="to-purple">
|
||||
<x-button type="button" class="text-xs text-purple" @click="onAddTax(index)" override="class">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans('general.title.add', ['type' => trans_choice('general.taxes', 1)]) }}
|
||||
</x-link.hover>
|
||||
</button>
|
||||
</x-button.hover>
|
||||
</x-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -80,9 +80,9 @@
|
||||
|
||||
<td class="text-right border-t-0 border-r-0 border-b-0 align-middle py-0 pr-0">
|
||||
<div v-if="show_discount_text" v-if="!totals.discount_text" @click="onAddDiscount()">
|
||||
<x-link.hover color="to-purple">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans('invoices.add_discount') }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</div>
|
||||
|
||||
<span v-if="totals.discount_text" v-html="totals.discount_text"></span>
|
||||
|
@ -62,16 +62,16 @@
|
||||
|
||||
@if (! empty($transaction->contact) && $transaction->contact->email)
|
||||
<x-button id="button-email-send" class="text-purple mt-1" override="class" @click="onEmail('{{ route($transactionEmailRoute, $transaction->id) }}')">
|
||||
<x-link.hover color="to-purple">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</x-button>
|
||||
@else
|
||||
<x-tooltip message="{{ trans('invoices.messages.email_required') }}" placement="top">
|
||||
<x-button class="text-purple mt-1" override="class" disabled="disabled">
|
||||
<x-link.hover color="to-purple">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</x-button>
|
||||
</x-tooltip>
|
||||
@endif
|
||||
@ -84,9 +84,9 @@
|
||||
class="text-purple mt-1"
|
||||
override="class"
|
||||
>
|
||||
<x-link.hover color="to-purple">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans('general.title.edit', ['type' => trans_choice('general.payments', 1)]) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</x-button>
|
||||
|
||||
<span> - </span>
|
||||
|
@ -46,16 +46,16 @@
|
||||
|
||||
@if (! empty($transaction->contact) && $transaction->contact->email)
|
||||
<x-button id="button-email-send" class="text-purple mt-1" override="class" @click="onEmail('{{ route($transactionEmailRoute, $transaction->id) }}')">
|
||||
<x-link.hover color="to-purple">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</x-button>
|
||||
@else
|
||||
<x-tooltip message="{{ trans('invoices.messages.email_required') }}" placement="top">
|
||||
<x-button class="text-purple mt-1" override="class" disabled="disabled">
|
||||
<x-link.hover color="to-purple">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</x-button>
|
||||
</x-tooltip>
|
||||
@endif
|
||||
@ -68,9 +68,9 @@
|
||||
class="text-purple mt-1"
|
||||
override="class"
|
||||
>
|
||||
<x-link.hover color="to-purple">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans('general.title.edit', ['type' => trans_choice('general.payments', 1)]) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</x-button>
|
||||
|
||||
<span> - </span>
|
||||
|
@ -56,11 +56,11 @@
|
||||
</div>
|
||||
|
||||
<div class="ltr:mr-4 rtl:ml-4" v-if="bulk_action.count">
|
||||
<button type="button" @click="onClearBulkAction">
|
||||
<x-link.hover>
|
||||
<x-button @click="onClearBulkAction" class="bg-transparent" override="class">
|
||||
<x-button.hover>
|
||||
{{ trans('general.clear') }}
|
||||
</x-link.hover>
|
||||
</button>
|
||||
</x-button.hover>
|
||||
</x-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -113,9 +113,9 @@
|
||||
|
||||
<div class="flex ltr:ml-2 rtl:mr-2">
|
||||
<span class="w-28 text-left block text-base truncate">
|
||||
<x-link.hover>
|
||||
<x-button.hover>
|
||||
{{ Str::limit(setting('company.name'), 22) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</span>
|
||||
|
||||
@can('read-common-companies')
|
||||
|
@ -84,9 +84,9 @@
|
||||
|
||||
<div class="flex ltr:ml-2 rtl:mr-2">
|
||||
<span class="w-28 text-left block text-base truncate">
|
||||
<x-link.hover>
|
||||
<x-button.hover>
|
||||
{{ Str::limit(setting('company.name'), 22) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</span>
|
||||
|
||||
@can('read-common-companies')
|
||||
|
@ -7,4 +7,3 @@
|
||||
>
|
||||
{!! $slot !!}
|
||||
</span>
|
||||
|
||||
|
@ -10,11 +10,11 @@
|
||||
|
||||
@if ($attributes->has('route'))
|
||||
<div class="flex justify-center items-center group">
|
||||
<a href="{{ route($attributes->get('route')) }}">
|
||||
<x-link.hover group-hover>
|
||||
<x-link href="{{ route($attributes->get('route')) }}" class="bg-transparent" override="class">
|
||||
<x-link.hover group-hover>
|
||||
{{ trans('modules.see_all_type', ['type' => $attributes->get('title')]) }}
|
||||
</x-link.hover>
|
||||
</a>
|
||||
</x-link>
|
||||
|
||||
<i class="material-icons text-sm ltr:ml-1 rtl:mr-1 transform transition-all group-hover:translate-x-1">arrow_forward</i>
|
||||
</div>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<div>
|
||||
<h2 class="lg:text-lg font-medium text-black">
|
||||
<x-link.hover group-hover>
|
||||
<x-button.hover group-hover>
|
||||
{{ $title }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</h2>
|
||||
|
||||
@if (! empty($description))
|
||||
|
@ -8,7 +8,6 @@
|
||||
<img src="{{ $image }}" class="w-60 h-60 object-contain mt-10 m-auto" />
|
||||
</div>
|
||||
|
||||
|
||||
<div @class([
|
||||
'lg:w-3/5',
|
||||
$textColor,
|
||||
@ -22,11 +21,11 @@
|
||||
@if (! empty($button) && $button->isNotEmpty())
|
||||
{!! $button !!}
|
||||
@else
|
||||
<a href="{!! $url !!}">
|
||||
<x-link href="{!! $url !!}" class="bg-transparent" override="class">
|
||||
<x-link.hover color="to-white">
|
||||
{{ $textAction }}
|
||||
</x-link.hover>
|
||||
</a>
|
||||
</x-link>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
@ -14,11 +14,11 @@
|
||||
{!! $item->description !!}
|
||||
</p>
|
||||
|
||||
<a href="{{ $item->action }}" class="font-light text-sm" target="_blank">
|
||||
<x-link href="{{ $item->action }}" class="font-light text-sm" override="class" target="_blank">
|
||||
<x-link.hover>
|
||||
{{ $item->learn_more }}
|
||||
</x-link.hover>
|
||||
</a>
|
||||
</x-link>
|
||||
</div>
|
||||
|
||||
<div class="absolute ltr:right-0 rtl:left-0 -top-4">
|
||||
|
@ -14,11 +14,11 @@
|
||||
{!! $item->description !!}
|
||||
</p>
|
||||
|
||||
<a href="{{ $item->action }}" class="font-light text-sm">
|
||||
<x-link href="{{ $item->action }}" class="font-light text-sm" override="class" target="_blank">
|
||||
<x-link.hover>
|
||||
{{ $item->learn_more }}
|
||||
</x-link.hover>
|
||||
</a>
|
||||
</x-link>
|
||||
</div>
|
||||
|
||||
<div class="absolute ltr:right-0 rtl:left-0 -top-4">
|
||||
|
@ -6,9 +6,9 @@
|
||||
x-on:click="attachment !== 1 ? attachment = 1 : attachment = null"
|
||||
>
|
||||
<span class="font-medium">
|
||||
<x-link.hover group-hover>
|
||||
<x-button.hover group-hover>
|
||||
{{ trans_choice('general.attachments', 2) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</span>
|
||||
|
||||
<div class="text-black-400 text-sm">
|
||||
|
@ -3,9 +3,9 @@
|
||||
x-on:click="children !== 1 ? children = 1 : children = null"
|
||||
>
|
||||
<span class="font-medium">
|
||||
<x-link.hover group-hover>
|
||||
<x-button.hover group-hover>
|
||||
{{ trans_choice('general.transactions', 2) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</span>
|
||||
|
||||
<div class="text-black-400 text-sm">
|
||||
|
@ -5,9 +5,9 @@
|
||||
x-on:click="create !== 1 ? create = 1 : create = null"
|
||||
>
|
||||
<span class="font-medium">
|
||||
<x-link.hover>
|
||||
<x-button.hover>
|
||||
{{ trans('general.create') }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</span>
|
||||
|
||||
<div class="text-black-400 text-sm">
|
||||
|
@ -8,9 +8,9 @@
|
||||
x-on:click="schedule !== 1 ? schedule = 1 : schedule = null"
|
||||
>
|
||||
<span class="font-medium">
|
||||
<x-link.hover group-hover>
|
||||
<x-button.hover group-hover>
|
||||
{{ trans_choice('general.schedules', 1) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</span>
|
||||
|
||||
<div class="text-black-400 text-sm">
|
||||
|
@ -2,9 +2,9 @@
|
||||
<div class="border-b border-gray-200 pb-4" x-data="{ attachment : null }">
|
||||
<div class="relative w-full text-left cursor-pointer group" x-on:click="attachment !== 1 ? attachment = 1 : attachment = null">
|
||||
<span class="font-medium">
|
||||
<x-link.hover group-hover>
|
||||
<x-button.hover group-hover>
|
||||
{{ trans_choice('general.attachments', 2) }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</span>
|
||||
|
||||
<div class="text-black-400 text-sm">
|
||||
@ -17,7 +17,7 @@
|
||||
<div class="overflow-hidden transition-transform origin-top-left ease-linear duration-100"
|
||||
x-ref="container1"
|
||||
x-bind:class="attachment == 1 ? 'h-auto ' : 'scale-y-0 h-0'"
|
||||
|
||||
>
|
||||
@foreach ($transfer->attachment as $file)
|
||||
<x-media.file :file="$file" />
|
||||
@endforeach
|
||||
|
@ -3,9 +3,9 @@
|
||||
<div class="border-b pb-4" x-data="{ create : null }">
|
||||
<button class="relative w-full text-left group" x-on:click="create !== 1 ? create = 1 : create = null">
|
||||
<span class="font-medium">
|
||||
<x-link.hover group-hover>
|
||||
<x-button.hover group-hover>
|
||||
{{ trans('general.create') }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</span>
|
||||
|
||||
<div class="text-black-400 text-sm">
|
||||
|
@ -7,11 +7,11 @@
|
||||
|
||||
<div class="flex items-center">
|
||||
@if ($report = $class->getReportUrl())
|
||||
<a href="{{ $report }}" class="text-purple text-sm mr-3">
|
||||
<x-link href="{{ $report }}" class="text-purple text-sm mr-3" override="class">
|
||||
<x-link.hover color="to-purple">
|
||||
{{ trans('widgets.view_report') }}
|
||||
</x-link.hover>
|
||||
</a>
|
||||
</x-link>
|
||||
@endif
|
||||
|
||||
<x-dropdown id="dropdown-widget-{{ $class->model->id }}">
|
||||
|
@ -1,19 +1,22 @@
|
||||
<div class="flex flex-wrap lg:flex-nowrap items-center justify-between my-16">
|
||||
@foreach ($reports as $report)
|
||||
<a href="{{ route('reports.show', $report->id) }}"
|
||||
<x-link href="{{ route('reports.show', $report->id) }}"
|
||||
@class([
|
||||
'w-6/12 lg:w-2/12 text-center px-3 group',
|
||||
'border-r border-gray-300' => ($loop->count == 6 && $loop->last) ? false : true,
|
||||
])
|
||||
override="class"
|
||||
>
|
||||
<span class="material-icons-outlined text-4xl transition-all text-black-400">{{ $icons[$report->id] }}</span>
|
||||
<span class="material-icons-outlined text-4xl transition-all text-black-400">
|
||||
{{ $icons[$report->id] }}
|
||||
</span>
|
||||
|
||||
<div class="h-10 font-medium text-sm mt-2">
|
||||
<x-link.hover group-hover>
|
||||
{{ $report->name }}
|
||||
</x-link.hover>
|
||||
</div>
|
||||
</a>
|
||||
</x-link>
|
||||
@endforeach
|
||||
|
||||
@for ($i = 6; $i > $reports->count(); $i--)
|
||||
@ -24,7 +27,10 @@
|
||||
])
|
||||
>
|
||||
<span class="material-icons-outlined text-4xl transform rotate-45">push_pin</span>
|
||||
<div class="h-10 font-medium text-sm mt-2">{{ trans('reports.pin') }}</div>
|
||||
|
||||
<div class="h-10 font-medium text-sm mt-2">
|
||||
{{ trans('reports.pin') }}
|
||||
</div>
|
||||
</div>
|
||||
@endfor
|
||||
</div>
|
||||
|
@ -24,9 +24,9 @@
|
||||
<div class="w-full lg:w-5/12 space-y-8">
|
||||
<div class="border-b-2 border-gray-200 pb-1">
|
||||
<div class="relative w-full text-left group">
|
||||
<x-link.hover group-hover>
|
||||
<x-button.hover group-hover>
|
||||
{{ trans('portal.received_date') }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</div>
|
||||
|
||||
<div class="relative overflow-hidden transition-all duration-700">
|
||||
|
@ -22,9 +22,9 @@
|
||||
<div class="w-full lg:w-5/12 space-y-8">
|
||||
<div class="border-b-2 border-gray-200 pb-1">
|
||||
<div class="relative w-full text-left group">
|
||||
<x-link.hover group-hover>
|
||||
<x-button.hover group-hover>
|
||||
{{ trans('portal.received_date') }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</div>
|
||||
|
||||
<div class="relative overflow-hidden transition-all duration-700">
|
||||
|
@ -32,9 +32,9 @@
|
||||
<div class="w-full lg:w-5/12 space-y-8">
|
||||
<div class="border-b-2 border-gray-200 pb-1">
|
||||
<div class="relative w-full text-left group">
|
||||
<x-link.hover group-hover>
|
||||
<x-button.hover group-hover>
|
||||
{{ trans('portal.received_date') }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
</div>
|
||||
|
||||
<div class="relative overflow-hidden transition-all duration-700">
|
||||
|
@ -14,11 +14,11 @@
|
||||
<div class="flex flex-col">
|
||||
<div class="mb-3">
|
||||
@foreach ($template as $item)
|
||||
<button class="text-xs truncate text-left" @click="onEditEmailTemplate({{ $item->id }}, $event)" >
|
||||
<x-link.hover color="to-purple">
|
||||
<x-button class="text-xs truncate text-left" @click="onEditEmailTemplate({{ $item->id }}, $event)" override="class">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans($item->name) }}
|
||||
</x-link.hover>
|
||||
</button>
|
||||
</x-button.hover>
|
||||
</x-button>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
@ -28,9 +28,9 @@
|
||||
</span>
|
||||
|
||||
<button id="dashboard-widget-{{ strtolower(class_basename($class)) }}-overdue" type="button" class="flex items-center text-black-400 font-medium group" data-dropdown-toggle="widgets-list-{{ $class->model->id }}">
|
||||
<x-link.hover color="to-black-400" group-hover>
|
||||
<x-button.hover color="to-black-400" group-hover>
|
||||
{{ $totals['overdue'] }}
|
||||
</x-link.hover>
|
||||
</x-button.hover>
|
||||
|
||||
<div class="relative flex">
|
||||
<span class="material-icons-round cursor-pointer">arrow_drop_down</span>
|
||||
|
Loading…
x
Reference in New Issue
Block a user