All Projects → lukeraymonddowning → Alpinimations

lukeraymonddowning / Alpinimations

Licence: mit
Streamline your animations by using these simple blade directives in your components!

Labels

Projects that are alternatives of or similar to Alpinimations

Idea Php Laravel Plugin
Laravel Framework Plugin for PhpStorm / IntelliJ IDEA
Stars: ✭ 537 (+635.62%)
Mutual labels:  blade
Laravelm1
Tracking what works and doesn't in the Laravel ecosystem on M1
Stars: ✭ 23 (-68.49%)
Mutual labels:  blade
Larawind
Larawind - Laravel 8.0+ Jetstream and Tailwind CSS Admin Theme
Stars: ✭ 55 (-24.66%)
Mutual labels:  blade
Pretty Routes
Pretty routes for Laravel
Stars: ✭ 549 (+652.05%)
Mutual labels:  blade
Laravel Notify
Flexible Flash notifications for Laravel
Stars: ✭ 787 (+978.08%)
Mutual labels:  blade
Bladex
BladeX - Python Blade Morphing
Stars: ✭ 34 (-53.42%)
Mutual labels:  blade
Tale
🦄 Best beautiful java blog, worth a try
Stars: ✭ 4,784 (+6453.42%)
Mutual labels:  blade
Laravel Tinymce Simple Imageupload
Simple image upload for TinyMCE in Laravel.
Stars: ✭ 66 (-9.59%)
Mutual labels:  blade
Laravel Blade Directives
A collection of nice Laravel Blade directives
Stars: ✭ 813 (+1013.7%)
Mutual labels:  blade
Tailwindcss
A Tailwind CSS frontend preset for the Laravel Framework
Stars: ✭ 1,056 (+1346.58%)
Mutual labels:  blade
Blade
🚀 Lightning fast and elegant mvc framework for Java8
Stars: ✭ 5,569 (+7528.77%)
Mutual labels:  blade
Blade Ui Kit
A set of renderless components to utilise in your Laravel Blade views.
Stars: ✭ 763 (+945.21%)
Mutual labels:  blade
Admin Generator
Laravel CRUD generator - quickly scaffold your typical admin interface.
Stars: ✭ 37 (-49.32%)
Mutual labels:  blade
Blade
🔪 A standalone version of Laravel's Blade templating engine for use outside of Laravel.
Stars: ✭ 542 (+642.47%)
Mutual labels:  blade
Laravel Ui Coreui
Laravel UI Frontend Preset for CoreUI V3.
Stars: ✭ 56 (-23.29%)
Mutual labels:  blade
Laravel Blade X
Use custom HTML components in your Blade views
Stars: ✭ 538 (+636.99%)
Mutual labels:  blade
Beautymail
Send beautiful HTML emails with Laravel
Stars: ✭ 923 (+1164.38%)
Mutual labels:  blade
Mario
🗿 如何设计一个Java MVC框架源码
Stars: ✭ 68 (-6.85%)
Mutual labels:  blade
Laravel Generator
laravel-generator / laravel代码生成器
Stars: ✭ 61 (-16.44%)
Mutual labels:  blade
Blade Zondicons
A package to easily make use of Zondicons in your Laravel Blade views.
Stars: ✭ 40 (-45.21%)
Mutual labels:  blade

Alpinimations

Clean up your Alpine JS animations.

Table of Contents

About Alpinimations

Alpinimations helps you clean up your Laravel blade files when using Alpine JS. Alpine has a super powerful animation system, but it can often bloat your HTML. This package bundles common animations into small blade files that you can include in your HTML.

We currently support all Tailwind UI animations and will be adding animations from more places over time.

Installation

To install the package, simply run composer require lukeraymonddowning/alpinimations in the terminal from the root of your Laravel project.

If you'd like to edit the animation files, you can publish the views by running php artisan vendor:publish --tag=alpinimations.

Usage

Using Alpinimations couldn't be simpler. Let's take a super awesome Tailwind UI component, the slideover. After copying over the HTML from the Tailwind UI component library, you'll have something like this:

<div class="fixed inset-0 overflow-hidden">
  <div class="absolute inset-0 overflow-hidden">
    <!--
      Background overlay, show/hide based on slide-over state.

      Entering: "ease-in-out duration-500"
        From: "opacity-0"
        To: "opacity-100"
      Leaving: "ease-in-out duration-500"
        From: "opacity-100"
        To: "opacity-0"
    -->
    <div class="absolute inset-0 bg-gray-500 bg-opacity-75 transition-opacity"></div>

    <section class="absolute inset-y-0 right-0 pl-10 max-w-full flex">
      <!--
        Slide-over panel, show/hide based on slide-over state.

        Entering: "transform transition ease-in-out duration-500 sm:duration-700"
          From: "translate-x-full"
          To: "translate-x-0"
        Leaving: "transform transition ease-in-out duration-500 sm:duration-700"
          From: "translate-x-0"
          To: "translate-x-full"
      -->
      <div class="w-screen max-w-md">
        <div class="h-full flex flex-col space-y-6 py-6 bg-white shadow-xl overflow-y-scroll">
          <header class="px-4 sm:px-6">
            <div class="flex items-start justify-between space-x-3">
              <h2 class="text-lg leading-7 font-medium text-gray-900">
                Panel title
              </h2>
              <div class="h-7 flex items-center">
                <button aria-label="Close panel" class="text-gray-400 hover:text-gray-500 transition ease-in-out duration-150">
                  <svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
                  </svg>
                </button>
              </div>
            </div>
          </header>
          <div class="relative flex-1 px-4 sm:px-6">
          </div>
        </div>
      </div>
    </section>
  </div>
</div>

Note that Tailwind UI includes the animations we should apply. These animations are included out of the box with Alpinimations. Let's sweeten up our component with Alpine:

<div x-data="{ showSlideover: false }" class="fixed inset-0 overflow-hidden">
  <div class="absolute inset-0 overflow-hidden">
    <div x-show="showSlideover" @anim('tailwindui.slideover.overlay') class="absolute inset-0 bg-gray-500 bg-opacity-75 transition-opacity"></div>

    <section class="absolute inset-y-0 right-0 pl-10 max-w-full flex">
      <div x-show="showSlideover" @anim('tailwindui.slideover.panel') class="w-screen max-w-md">
        <div class="h-full flex flex-col space-y-6 py-6 bg-white shadow-xl overflow-y-scroll">
          <header class="px-4 sm:px-6">
            <div class="flex items-start justify-between space-x-3">
              <h2 class="text-lg leading-7 font-medium text-gray-900">
                Panel title
              </h2>
              <div class="h-7 flex items-center">
                <button @click="showSlideover = false" aria-label="Close panel" class="text-gray-400 hover:text-gray-500 transition ease-in-out duration-150">
                  <svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
                  </svg>
                </button>
              </div>
            </div>
          </header>
          <div class="relative flex-1 px-4 sm:px-6">
          </div>
        </div>
      </div>
    </section>
  </div>
</div>

Note how we can use the @anim blade directive to include all the necessary alpine animation directives. A list of all Tailwind UI animations available can be found below.

We can go even further here. As most animations are coupled with x-show, Alpinimations includes an @xshow blade directive. Check it out:

<div x-data="{ showSlideover: false }" class="fixed inset-0 overflow-hidden">
  <div class="absolute inset-0 overflow-hidden">
    <div @xshow('showSlideover', 'tailwindui.slideover.overlay') class="absolute inset-0 bg-gray-500 bg-opacity-75 transition-opacity"></div>

    <section class="absolute inset-y-0 right-0 pl-10 max-w-full flex">
      <div @xshow('showSlideover', 'tailwindui.slideover.panel') class="w-screen max-w-md">
        <div class="h-full flex flex-col space-y-6 py-6 bg-white shadow-xl overflow-y-scroll">
          <header class="px-4 sm:px-6">
            <div class="flex items-start justify-between space-x-3">
              <h2 class="text-lg leading-7 font-medium text-gray-900">
                Panel title
              </h2>
              <div class="h-7 flex items-center">
                <button @click="showSlideover = false" aria-label="Close panel" class="text-gray-400 hover:text-gray-500 transition ease-in-out duration-150">
                  <svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
                  </svg>
                </button>
              </div>
            </div>
          </header>
          <div class="relative flex-1 px-4 sm:px-6">
          </div>
        </div>
      </div>
    </section>
  </div>
</div>

Suuuuuper clean.

Available animations

Tailwind UI

Dropdowns

  • tailwindui.dropdown.panel - Can apply to all dropdown components. Tailwind UI docs

Menus

  • tailwindui.menu.card - Can apply to mobile menus such as seen in Tailwind UI hero mobile menus. Tailwind UI docs
  • tailwindui.menu.flyout - Works with all flyout menus. Tailwind UI docs
  • tailwindui.menu.off-canvas - For those swanky mobile sidebar menus. Tailwind UI docs
  • tailwindui.menu.overlay - For any overlay backgrounds needed when menus are displayed, especially in mobile. Tailwind UI docs

Modals

  • tailwindui.modal.overlay - The overlay that shows behind a modal when it is displayed. Tailwind UI docs
  • tailwindui.modal.panel - The actual panel/card that shows the modal content. Tailwind UI docs

Notifications

  • tailwindui.notification.panel - The container for the notification. Tailwind UI docs

Select Boxes

Slideovers

  • tailwindui.slideover.close-button - The close button for a slideover. This could apply to any close button. Tailwind UI docs
  • tailwindui.slideover.overlay - The background overlay that applies to certain slideovers. Tailwind UI docs
  • tailwindui.slideover.panel - The actual slideover panel/card that will contain your content. Tailwind UI docs

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

License

The Laravel framework is open-sourced software licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].