Merge pull request #2486 from brkcvn/text-hover

Hover animation development
This commit is contained in:
Burak Civan 2022-06-28 15:37:32 +03:00 committed by GitHub
commit 239b4d6276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 12320 additions and 856 deletions

View File

@ -0,0 +1,36 @@
<?php
namespace App\View\Components\Link;
use App\Abstracts\View\Component;
use Illuminate\Support\Str;
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.link.hover');
}
}

12
presets.js vendored
View File

@ -224,7 +224,17 @@ module.exports = {
transitionProperty: {
'height': 'height',
'spacing': 'margin, padding',
'visible': 'visible, opacity'
'visible': 'visible, opacity',
'backgroundSize': 'background-size'
},
backgroundSize: {
'0-2': '0 2px',
'full-2': '100% 2px'
},
backgroundPosition: {
'0-full': ' 0 100%'
}
},

12917
public/css/app.css vendored

File diff suppressed because it is too large Load Diff

View File

@ -98,12 +98,12 @@
<div class="absolute flex flex-col mt-2">
<button type="button" class="p-0 text-xs text-purple ltr:text-left rtl:text-right" @click="onContactEdit">
<span class="border-b border-transparent transition-all hover:border-purple">
<span class="bg-no-repeat bg-0-2 bg-0-full hover:bg-full-2 bg-gradient-to-b from-transparent to-purple transition-backgroundSize">
{{ editContactText.replace(':contact_name', contact.name).replace(':field', contact.name) }}
</span>
</button>
<button type="button" class="p-0 text-xs text-purple ltr:text-left rtl:text-right" @click="onContactList">
<span class="border-b border-transparent transition-all hover:border-purple">
<span class="bg-no-repeat bg-0-2 bg-0-full hover:bg-full-2 bg-gradient-to-b from-transparent to-purple transition-backgroundSize">
{{ chooseDifferentContactText }}
</span>
</button>

View File

@ -121,7 +121,7 @@
<div v-if="currencies.length" class="w-full border-b hover:bg-gray-100" style="height:53px;">
<button type="button" class="w-full h-full flex items-center justify-center text-purple font-medium disabled:bg-gray-200" @click="onAddItem()">
<span class="material-icons-outlined text-base font-bold ltr:mr-1 rtl:ml-1">add</span>
<span class="border-b border-transparent transition-all">{{ translations.currencies.new_currency }}</span>
<span class="bg-no-repeat bg-0-2 bg-0-full hover:bg-full-2 bg-gradient-to-b from-transparent to-purple transition-backgroundSize">{{ translations.currencies.new_currency }}</span>
</button>
</div>

View File

@ -93,7 +93,7 @@
}
table thead a {
@apply border-b border-transparent transition-all;
@apply bg-no-repeat bg-0-2 bg-0-full hover:bg-full-2 bg-gradient-to-b from-transparent to-black transition-backgroundSize;
}
table thead a:hover {

View File

@ -286,7 +286,7 @@ return [
],
'empty' => [
'documentation' => 'Check out the <a href=":url" target="_blank" class="text-green border-b border-transparent transition-all hover:text-green-700 hover:border-green-700">documentation</a> for more details.',
'documentation' => 'Check out the <a href=":url" target="_blank" class="text-green bg-no-repeat bg-0-2 bg-0-full hover:bg-full-2 bg-gradient-to-b from-transparent to-green transition-backgroundSize">documentation</a> for more details.',
'items' => 'Items can be products or services. You can use items when creating invoices and bills to have the price, tax etc fields populated.',
'invoices' => 'Invoices can be one time or recurring. You can send them to customers and start accepting online payments.',
'revenues' => 'Revenue is a paid income transaction. It can be an independent record (i.e. deposit) or attached to an invoice.',

View File

@ -8,8 +8,10 @@
<div class="flex items-center relative cursor-pointer">
<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 border-b border-transparent transition-all hover:text-black-700 hover:border-black">
{{ $dashboard->name }}
<span class="text-2xl xl:text-5xl text-black font-light truncate">
<x-link.hover color="to-black-700">
{{ $dashboard->name }}
</x-link.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">

View File

@ -42,9 +42,9 @@
<div class="ltr:ml-2 rtl:mr-2">
<h2 class="mb-1">
<span class="border-b border-transparent transition-all group-hover:border-black">
<x-link.hover group-hover>
{{ $report->name }}
</span>
</x-link.hover>
</h2>
<span class="text-black-400 text-sm">{{ $report->description }}</span>

View File

@ -190,18 +190,18 @@
@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)">
<span class="border-b border-transparent transition-all hover:border-purple">
<x-link.hover color="to-purple">
{{ trans('general.title.add', ['type' => trans('invoices.discount')]) }}
</span>
</x-link.hover>
</button>
</div>
@endif
<div class="text-right border-0 p-0 pr-4">
<button type="button" class="text-xs text-purple" @click="onAddTax(index)">
<span class="border-b border-transparent transition-all hover:border-purple">
<x-link.hover color="to-purple">
{{ trans('general.title.add', ['type' => trans_choice('general.taxes', 1)]) }}
</span>
</x-link.hover>
</button>
</div>
</div>

View File

@ -79,10 +79,10 @@
<td class="border-t-0 py-0"></td>
<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">
<span class="border-b border-transparent transition-all text-sm text-purple cursor-pointer hover:border-purple" v-if="!totals.discount_text" @click="onAddDiscount()">
<div v-if="show_discount_text" v-if="!totals.discount_text" @click="onAddDiscount()">
<x-link.hover color="to-purple">
{{ trans('invoices.add_discount') }}
</span>
</x-link.hover>
</div>
<span v-if="totals.discount_text" v-html="totals.discount_text"></span>

View File

@ -35,9 +35,9 @@
override="class"
class="py-1.5 mb-3 sm:mb-0 text-xs bg-transparent hover:bg-transparent font-medium leading-6"
>
<span class="border-b border-transparent transition-all hover:border-black">
<x-link.hover>
{{ trans('documents.accept_payment_online') }}
</span>
</x-link.hover>
</x-link>
@endif
</div>
@ -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) }}')">
<span class="border-b border-transparent transition-all hover:border-purple">
<x-link.hover color="to-purple">
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
</span>
</x-link.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">
<span class="border-b border-transparent transition-all hover:border-purple">
<x-link.hover color="to-purple">
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
</span>
</x-link.hover>
</x-button>
</x-tooltip>
@endif
@ -84,9 +84,9 @@
class="text-purple mt-1"
override="class"
>
<span class="border-b border-transparent transition-all hover:border-purple">
<x-link.hover color="to-purple">
{{ trans('general.title.edit', ['type' => trans_choice('general.payments', 1)]) }}
</span>
</x-link.hover>
</x-button>
<span> - </span>
@ -105,7 +105,7 @@
:message="$message"
:label="trans('general.title.delete', ['type' => trans_choice('general.payments', 1)])"
class="text-purple mt-1"
text-class="border-b border-transparent transition-all hover:border-purple"
text-class="bg-no-repeat bg-0-2 bg-0-full hover:bg-full-2 bg-gradient-to-b from-transparent to-purple transition-backgroundSize"
override="class"
/>
</div>

View File

@ -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) }}')">
<span class="border-b border-transparent transition-all hover:border-purple">
<x-link.hover color="to-purple">
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
</span>
</x-link.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">
<span class="border-b border-transparent transition-all hover:border-purple">
<x-link.hover color="to-purple">
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
</span>
</x-link.hover>
</x-button>
</x-tooltip>
@endif
@ -68,9 +68,9 @@
class="text-purple mt-1"
override="class"
>
<span class="border-b border-transparent transition-all hover:border-purple">
<x-link.hover color="to-purple">
{{ trans('general.title.edit', ['type' => trans_choice('general.payments', 1)]) }}
</span>
</x-link.hover>
</x-button>
<span> - </span>
@ -89,7 +89,7 @@
:message="$message"
:label="trans('general.title.delete', ['type' => trans_choice('general.payments', 1)])"
class="text-purple mt-1"
text-class="border-b border-transparent transition-all hover:border-purple"
text-class="bg-no-repeat bg-0-2 bg-0-full hover:bg-full-2 bg-gradient-to-b from-transparent to-purple transition-backgroundSize"
override="class"
/>
</div>

View File

@ -56,8 +56,10 @@
</div>
<div class="ltr:mr-4 rtl:ml-4" v-if="bulk_action.count">
<button type="button" class="text-sm border-b border-transparent transition-all hover:border-black" @click="onClearBulkAction">
<span>{{ trans('general.clear') }}</span>
<button type="button" @click="onClearBulkAction">
<x-link.hover>
{{ trans('general.clear') }}
</x-link.hover>
</button>
</div>
</div>

View File

@ -113,9 +113,9 @@
<div class="flex ltr:ml-2 rtl:mr-2">
<span class="w-28 text-left block text-base truncate">
<span class="border-b border-transparent transition-all hover:border-black">
<x-link.hover>
{{ Str::limit(setting('company.name'), 22) }}
</span>
</x-link.hover>
</span>
@can('read-common-companies')

View File

@ -14,9 +14,9 @@
<div class="grid grid-cols-2 gap-2">
@foreach ($categories as $slug => $category)
<x-link href="{{ $categoryUrl($slug) }}" class="font-semibold text-sm ltr:pr-4 rtl:pl-4 lg:pr-0 truncate bg-transparent" override="class">
<span class="border-b border-transparent transition-all hover:border-black">
<x-link.hover>
{{ $category }}
</span>
</x-link.hover>
</x-link>
@endforeach
</div>
@ -80,27 +80,27 @@
<div class="flex flex-row items-end lg:items-center mb-1 divide-x divide-black-400">
<x-link href="{{ route('apps.home.index') }}" class="text-sm font-semibold px-2 sm:mt-0 sm:mb-0 leading-4" override="class">
<span class="border-b border-transparent transition-all hover:border-black-400">
<x-link.hover color="to-black-400">
{{ trans('modules.home') }}
</span>
</x-link.hover>
</x-link>
<x-link href="{{ route('apps.new') }}" class="text-sm font-semibold px-2 sm:mt-0 sm:mb-0 leading-4" override="class">
<span class="border-b border-transparent transition-all hover:border-black-400">
<x-link.hover color="to-black-400">
{{ trans('modules.new') }}
</span>
</x-link.hover>
</x-link>
<x-link href="{{ route('apps.paid') }}" class="text-sm font-semibold px-2 sm:mt-0 sm:mb-0 leading-4" override="class">
<span class="border-b border-transparent transition-all hover:border-black-400">
<x-link.hover color="to-black-400">
{{ trans('modules.top_paid') }}
</span>
</x-link.hover>
</x-link>
<x-link href="{{ route('apps.free') }}" class="text-sm font-semibold px-2 sm:mt-0 sm:mb-0 leading-4" override="class">
<span class="border-b border-transparent transition-all hover:border-black-400">
<x-link.hover color="to-black-400">
{{ trans('modules.top_free') }}
</span>
</x-link.hover>
</x-link>
</div>
</div>

View File

@ -84,9 +84,9 @@
<div class="flex ltr:ml-2 rtl:mr-2">
<span class="w-28 text-left block text-base truncate">
<span class="border-b border-transparent transition-all hover:border-black">
<x-link.hover>
{{ Str::limit(setting('company.name'), 22) }}
</span>
</x-link.hover>
</span>
@can('read-common-companies')

View File

@ -0,0 +1,10 @@
<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>

View File

@ -11,9 +11,9 @@
@if ($attributes->has('route'))
<div class="flex justify-center items-center group">
<a href="{{ route($attributes->get('route')) }}">
<span class="border-b border-transparent transition-all group-hover:border-black">
<x-link.hover group-hover>
{{ trans('modules.see_all_type', ['type' => $attributes->get('title')]) }}
</span>
</x-link.hover>
</a>
<i class="material-icons text-sm ltr:ml-1 rtl:mr-1 transform transition-all group-hover:translate-x-1">arrow_forward</i>

View File

@ -1,8 +1,8 @@
<div>
<h2 class="lg:text-lg font-medium text-black">
<span class="border-b border-transparent transition-all group-hover:border-black">
<x-link.hover group-hover>
{{ $title }}
</span>
</x-link.hover>
</h2>
@if (! empty($description))

View File

@ -22,8 +22,10 @@
@if (! empty($button) && $button->isNotEmpty())
{!! $button !!}
@else
<a href="{!! $url !!}" class="border-b border-transparent transition-all hover:border-white">
{{ $textAction }}
<a href="{!! $url !!}">
<x-link.hover color="to-white">
{{ $textAction }}
</x-link.hover>
</a>
@endif
</div>

View File

@ -14,8 +14,10 @@
{!! $item->description !!}
</p>
<a href="{{ $item->action }}" class="font-light text-sm border-b border-transparent transition-all hover:border-black" target="_blank">
{{ $item->learn_more }}
<a href="{{ $item->action }}" class="font-light text-sm" target="_blank">
<x-link.hover>
{{ $item->learn_more }}
</x-link.hover>
</a>
</div>

View File

@ -14,8 +14,10 @@
{!! $item->description !!}
</p>
<a href="{{ $item->action }}" class="font-light text-sm border-b border-transparent transition-all hover:border-black">
{{ $item->learn_more }}
<a href="{{ $item->action }}" class="font-light text-sm">
<x-link.hover>
{{ $item->learn_more }}
</x-link.hover>
</a>
</div>

View File

@ -5,8 +5,10 @@
<div class="relative w-full text-left cursor-pointer group"
x-on:click="attachment !== 1 ? attachment = 1 : attachment = null"
>
<span class="font-medium border-b border-transparent transition-all group-hover:border-black">
{{ trans_choice('general.attachments', 2) }}
<span class="font-medium">
<x-link.hover group-hover>
{{ trans_choice('general.attachments', 2) }}
</x-link.hover>
</span>
<div class="text-black-400 text-sm">

View File

@ -2,8 +2,10 @@
<button class="relative w-full text-left cursor-pointer group"
x-on:click="children !== 1 ? children = 1 : children = null"
>
<span class="font-medium border-b border-transparent transition-all group-hover:border-black">
{{ trans_choice('general.transactions', 2) }}
<span class="font-medium">
<x-link.hover group-hover>
{{ trans_choice('general.transactions', 2) }}
</x-link.hover>
</span>
<div class="text-black-400 text-sm">

View File

@ -4,8 +4,10 @@
<button class="relative w-full text-left group"
x-on:click="create !== 1 ? create = 1 : create = null"
>
<span class="font-medium border-b border-transparent transition-all group-hover:border-black">
{{ trans('general.create') }}
<span class="font-medium">
<x-link.hover>
{{ trans('general.create') }}
</x-link.hover>
</span>
<div class="text-black-400 text-sm">

View File

@ -7,8 +7,10 @@
<button class="relative w-full text-left cursor-pointer group"
x-on:click="schedule !== 1 ? schedule = 1 : schedule = null"
>
<span class="font-medium border-b border-transparent transition-all group-hover:border-black">
{{ trans_choice('general.schedules', 1) }}
<span class="font-medium">
<x-link.hover group-hover>
{{ trans_choice('general.schedules', 1) }}
</x-link.hover>
</span>
<div class="text-black-400 text-sm">

View File

@ -1,8 +1,10 @@
@if ($transfer->attachment)
<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 border-b border-transparent transition-all group-hover:border-black">
{{ trans_choice('general.attachments', 2) }}
<span class="font-medium">
<x-link.hover group-hover>
{{ trans_choice('general.attachments', 2) }}
</x-link.hover>
</span>
<div class="text-black-400 text-sm">

View File

@ -2,8 +2,10 @@
<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 border-b border-transparent transition-all group-hover:border-black">
{{ trans('general.create') }}
<span class="font-medium">
<x-link.hover group-hover>
{{ trans('general.create') }}
</x-link.hover>
</span>
<div class="text-black-400 text-sm">

View File

@ -7,7 +7,11 @@
<div class="flex items-center">
@if ($report = $class->getReportUrl())
<a href="{{ $report }}" class="text-purple text-sm mr-3 border-b border-transparent transition-all hover:border-purple hover:text-purple-700">{{ trans('widgets.view_report') }}</a>
<a href="{{ $report }}" class="text-purple text-sm mr-3">
<x-link.hover color="to-purple">
{{ trans('widgets.view_report') }}
</x-link.hover>
</a>
@endif
<x-dropdown id="dropdown-widget-{{ $class->model->id }}">

View File

@ -7,10 +7,11 @@
])
>
<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">
<span class="border-b border-transparent transition-all group-hover:border-black">
<x-link.hover group-hover>
{{ $report->name }}
</span>
</x-link.hover>
</div>
</a>
@endforeach

View File

@ -106,7 +106,7 @@
@foreach ($invoice->transactions as $transaction)
<div class="my-2">
<span>
<x-link href="{{ route('preview.payments.show', $transaction->id) }}" class="text-black border-b border-transparent transition-all hover:border-black" override="class">
<x-link href="{{ route('preview.payments.show', $transaction->id) }}" class="text-black bg-no-repeat bg-0-2 bg-0-full hover:bg-full-2 bg-gradient-to-b from-transparent to-black transition-backgroundSize" override="class">
<x-date :date="$transaction->paid_at" />
</x-link>
- {!! trans('documents.transaction', [

View File

@ -102,7 +102,7 @@
@foreach ($invoice->transactions as $transaction)
<div class="my-2">
<span>
<x-link href="{{ route('portal.payments.show', $transaction->id) }}" class="text-black border-b border-transparent transition-all hover:border-black" override="class">
<x-link href="{{ route('portal.payments.show', $transaction->id) }}" class="text-black bg-no-repeat bg-0-2 bg-0-full hover:bg-full-2 bg-gradient-to-b from-transparent to-black transition-backgroundSize" override="class">
<x-date :date="$transaction->paid_at" />
</x-link>
- {!! trans('documents.transaction', [

View File

@ -105,7 +105,7 @@
@foreach ($invoice->transactions as $transaction)
<div class="my-2">
<span>
<x-link href="{{ \URL::signedRoute('portal.payments.show', [$transaction->id]) }}" class="text-black border-b border-transparent transition-all hover:border-black" override="class">
<x-link href="{{ \URL::signedRoute('portal.payments.show', [$transaction->id]) }}" class="text-black bg-no-repeat bg-0-2 bg-0-full hover:bg-full-2 bg-gradient-to-b from-transparent to-black transition-backgroundSize" override="class">
<x-date :date="$transaction->paid_at" />
</x-link>
- {!! trans('documents.transaction', [

View File

@ -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">
<span class="font-medium border-b border-transparent transition-all group-hover:border-black">
<x-link.hover group-hover>
{{ trans('portal.received_date') }}
</span>
</x-link.hover>
</div>
<div class="relative overflow-hidden transition-all duration-700">

View File

@ -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">
<span class="font-medium border-b border-transparent transition-all group-hover:border-black">
<x-link.hover group-hover>
{{ trans('portal.received_date') }}
</span>
</x-link.hover>
</div>
<div class="relative overflow-hidden transition-all duration-700">

View File

@ -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">
<span class="font-medium border-b border-transparent transition-all group-hover:border-black">
<x-link.hover group-hover>
{{ trans('portal.received_date') }}
</span>
</x-link.hover>
</div>
<div class="relative overflow-hidden transition-all duration-700">

View File

@ -14,8 +14,10 @@
<div class="flex flex-col">
<div class="mb-3">
@foreach ($template as $item)
<button class="text-xs truncate text-left border-b border-transparent transition-all hover:border-purple hover:text-purple" @click="onEditEmailTemplate({{ $item->id }}, $event)" >
{{ trans($item->name) }}
<button class="text-xs truncate text-left" @click="onEditEmailTemplate({{ $item->id }}, $event)" >
<x-link.hover color="to-purple">
{{ trans($item->name) }}
</x-link.hover>
</button>
@endforeach
</div>

View File

@ -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 }}">
<span class="border-b border-transparent transition-all group-hover:border-black-400">
<x-link.hover color="to-black-400" group-hover>
{{ $totals['overdue'] }}
</span>
</x-link.hover>
<div class="relative flex">
<span class="material-icons-round cursor-pointer">arrow_drop_down</span>