forked from rapidez/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Styling buttons | Added new button | Added anmation for add to cart b…
…utton
- Loading branch information
1 parent
3a1a4a7
commit fab8271
Showing
22 changed files
with
164 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@keyframes is-loading { | ||
0% { | ||
left: 0; | ||
width: 0; | ||
} | ||
50% { | ||
left: 0; | ||
width: 100%; | ||
} | ||
to { | ||
left: 100%; | ||
width: 0; | ||
} | ||
} | ||
|
||
.button-loading { | ||
@apply overflow-hidden !bg-enhanced/10 hover:!bg-enhanced/10 !text-white !cursor-progress before:absolute before:block before:h-1 before:bg-enhanced before:top-0 before:left-0 before:w-16; | ||
} | ||
|
||
.button-loading:before { | ||
animation: is-loading 1s infinite; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
<x-rapidez::button {{ $attributes->merge([ | ||
'type' => 'submit', | ||
'dusk' => 'add-to-cart', | ||
])->class('flex items-center') }}> | ||
<x-heroicon-o-shopping-cart class="mr-2 h-5 w-5" v-if="!addToCart.adding && !addToCart.added" /> | ||
<x-heroicon-o-arrow-path class="mr-2 h-5 w-5 animate-spin" v-if="addToCart.adding" v-cloak /> | ||
<x-heroicon-o-check class="mr-2 h-5 w-5" v-if="addToCart.added" v-cloak /> | ||
{{-- | ||
This is the default add to cart button and has a nice loading animation when you click on it. | ||
Example: | ||
``` | ||
<x-rapidez:button.card>Something</x-rapidez:button.card> | ||
``` | ||
--}} | ||
|
||
<x-rapidez::button.enhanced | ||
v-bind:class="{ 'button-loading': addToCart.adding }" | ||
class="flex-1" | ||
{{ $attributes->merge([ 'type' => 'submit', 'dusk' => 'add-to-cart']) }} | ||
> | ||
<x-heroicon-o-shopping-cart class="mr-2 size-5" /> | ||
<span v-if="!addToCart.adding && !addToCart.added">@lang('Add to cart')</span> | ||
<span v-if="addToCart.adding" v-cloak>@lang('Adding')...</span> | ||
<span v-if="addToCart.adding" v-cloak>@lang('Adding')</span> | ||
<span v-if="addToCart.added" v-cloak>@lang('Added')</span> | ||
</x-rapidez::button> | ||
</x-rapidez::button.enhanced> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{-- | ||
This is the enhanced button the button will be used for the add to cart buttons | ||
and it is used in the checkout. | ||
Example: | ||
``` | ||
<x-rapidez:button.enhanced>Something</x-rapidez:button.enhanced> | ||
``` | ||
--}} | ||
|
||
<x-rapidez::button {{ $attributes->twMerge('bg-enhanced text-white border-b border-black/15') }}> | ||
{{ $slot }} | ||
</x-rapidez::button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
<x-rapidez::button.base {{ $attributes->class('bg-inactive text-white') }}> | ||
{{-- | ||
This is the default button if you use the example you get this. | ||
Example: | ||
``` | ||
<x-rapidez:button>Something</x-rapidez:button> | ||
``` | ||
--}} | ||
|
||
<x-rapidez::button.base {{ $attributes->twMerge('relative inline-flex items-center justify-center transition text-white bg-neutral text-base font-medium rounded min-h-12 py-1.5 px-5 hover:bg-opacity-80 border-b border-black/15 disabled:text-inactive disabled:bg-disabled disabled:cursor-not-allowed') }}> | ||
{{ $slot }} | ||
</x-rapidez::button.base> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
<x-rapidez::button.base {{ $attributes->class('bg-transparent hover:bg-neutral text-neutral hover:text-white border-neutral hover:border-transparent') }}> | ||
{{-- | ||
This is an outline button so it doesn't need a background and only need a border. | ||
Example: | ||
``` | ||
<x-rapidez:button.outline>Something</x-rapidez:button.outline> | ||
``` | ||
--}} | ||
|
||
<x-rapidez::button {{ $attributes->twMerge('bg-transparent border text-neutral hover:border-neutral') }}> | ||
{{ $slot }} | ||
</x-rapidez::button.base> | ||
</x-rapidez::button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
<x-rapidez::button.base {{ $attributes->class('bg-primary text-primary-text') }}> | ||
{{-- | ||
This is the primary button. | ||
Example: | ||
``` | ||
<x-rapidez:button.primary>Something</x-rapidez:button.primary> | ||
``` | ||
--}} | ||
|
||
<x-rapidez::button {{ $attributes->twMerge('bg-primary text-white border-b border-black/15') }}> | ||
{{ $slot }} | ||
</x-rapidez::button.base> | ||
</x-rapidez::button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
<x-rapidez::button.base {{ $attributes->class('rounded-full w-12 h-12 bg-white border hover:bg-neutral hover:text-white') }}> | ||
{{-- | ||
This button is used for sliders. | ||
Example: | ||
``` | ||
<x-rapidez:button.slider>Icon</x-rapidez:button.slider> | ||
``` | ||
--}} | ||
|
||
<x-rapidez::button {{ $attributes->twMerge('inline-flex bg-white p-0 rounded-full size-14 items-center justify-center shadow bg-white text-neutral border') }}> | ||
{{ $slot }} | ||
</x-rapidez::button.base> | ||
</x-rapidez::button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
@php($id = uniqid('filters-')) | ||
<x-rapidez::slideover.mobile :$id :title="__('Filters')" position="right"> | ||
<div class="w-full p-2"> | ||
{{-- On mobile the filters aren't immedately visible so we should defer loading --}} | ||
<lazy> | ||
@include('rapidez::listing.partials.filter.selected') | ||
@include('rapidez::listing.partials.filter.category') | ||
<template v-for="filter in filters"> | ||
@include('rapidez::listing.partials.filter.price') | ||
@include('rapidez::listing.partials.filter.swatch') | ||
@include('rapidez::listing.partials.filter.boolean') | ||
@include('rapidez::listing.partials.filter.select') | ||
</template> | ||
</lazy> | ||
<x-rapidez::button for="{{ $id }}" class="w-full text-sm lg:hidden"> | ||
@lang('Show results') | ||
</x-rapidez::button> | ||
</div> | ||
</x-rapidez::slideover.mobile> | ||
|
||
<x-rapidez::button :for="$id" class="mb-3 w-full lg:hidden"> | ||
@lang('Filters') | ||
</x-rapidez::button> | ||
<x-rapidez::slideover :mobile-only="true"> | ||
<x-slot:button> | ||
<x-rapidez::button.primary v-on:click="toggle" class="mb-3 w-full md:hidden"> | ||
@lang('Filters') | ||
</x-rapidez::button.primary> | ||
</x-slot:button> | ||
<x-slot:title> | ||
@lang('Filters') | ||
</x-slot:title> | ||
{{-- On mobile the filters aren't immedately visible so we should defer loading --}} | ||
<lazy> | ||
@include('rapidez::listing.partials.filter.selected') | ||
@include('rapidez::listing.partials.filter.category') | ||
<template v-for="filter in filters"> | ||
@include('rapidez::listing.partials.filter.price') | ||
@include('rapidez::listing.partials.filter.swatch') | ||
@include('rapidez::listing.partials.filter.boolean') | ||
@include('rapidez::listing.partials.filter.select') | ||
</template> | ||
</lazy> | ||
<x-rapidez::button.primary v-on:click="toggle" class="w-full text-sm md:hidden"> | ||
@lang('Show results') | ||
</x-rapidez::button.primary> | ||
</x-rapidez::slideover> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters