Feedback slider using tailwind css and swiper js
Web2tailwind.com

Output

Code

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>Swiper demo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">

    <link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.css">
    <link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/js/all.min.js"></script>

    <script src="https://unpkg.com/swiper/swiper-bundle.js"></script>
    <script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script>
    <link href="https://unpkg.com/[email protected]^1.0/dist/tailwind.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>


    <!-- Demo styles -->
    <style>
        :root{
            --swiper-navigation-size:12px;
        }

        .swiper-slide-next {
            opacity: 1;
        }

        .swiper-container::after,
        .swiper-container::before {
            position: absolute;
            content: '';
            top: 0;
            left: 0;
            width: 300px;
            height: 100%;
            z-index: 2  ;
            background: linear-gradient(to right,rgb(238 238 238) 52%, rgba(249, 249, 249, 0.06) 90%, rgba(249, 249, 249, 0) 100%);
        }

        .swiper-container::after {
            left: auto;
            right: 0;
            background: linear-gradient(to left, rgb(238 238 238) 52%, rgba(249, 249, 249, 0.06) 90%, rgba(249, 249, 249, 0) 100%);
        }
    </style>
</head>
<body style="background-color: #eee;">
    <div class="container mx-auto mt-40">
        <div class="swiper-container">
            <div class="swiper-wrapper">
                <div class="swiper-slide bg-white rounded-lg text-center px-4 opacity-25">
                    <div class="py-6 mb-4">
                        <div class="flex justify-center py-4">
                            <img class="h-20 w-20 rounded-full"
                                src="http://bugspatrol.ancorathemes.com/wp-content/uploads/2016/07/testimonials-3-75x75.jpg">
                        </div>
                        <div>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fas fa-star"></i>
                        </div>
                        <div class="flex jusify-center py-4 text-base text-center">
                            "Feedback with swiper js and Tailwind css seems perfect to me. I like multiple sliders in one places."
                        </div>
                        <div class="font-bold text-base flex justify-center text-gray-700">Julia Bredshow, NY</div>
                        <div class="text-sm">Apple Inc</div>
                    </div>
                </div>
                <div class="swiper-slide bg-white rounded-lg text-center px-4 opacity-25">
                    <div class="py-6 mb-4">
                        <div class="flex justify-center py-4">
                            <img class="h-20 w-20 rounded-full"
                                src="http://bugspatrol.ancorathemes.com/wp-content/uploads/2016/07/testimonials-3-75x75.jpg">
                        </div>
                        <div>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fas fa-star"></i>
                        </div>
                        <div class="flex jusify-center py-4 text-base text-center">
                            "Feedback with swiper js and Tailwind css seems perfect to me. I like multiple sliders in one places."
                        </div>
                        <div class="font-bold text-base flex justify-center text-gray-700">Julia Bredshow, NY</div>
                        <div class="text-sm">Apple Inc</div>
                    </div>
                </div>
                <div class="swiper-slide bg-white rounded-lg text-center px-4 opacity-25">
                    <div class="py-6 mb-4">
                        <div class="flex justify-center py-4">
                            <img class="h-20 w-20 rounded-full"
                                src="http://bugspatrol.ancorathemes.com/wp-content/uploads/2016/07/testimonials-3-75x75.jpg">
                        </div>
                        <div>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fas fa-star"></i>
                        </div>
                        <div class="flex jusify-center py-4 text-base text-center">
                            "Feedback with swiper js and Tailwind css seems perfect to me. I like multiple sliders in one places."
                        </div>
                        <div class="font-bold text-base flex justify-center text-gray-700">Julia Bredshow, NY</div>
                        <div class="text-sm">Apple Inc</div>
                    </div>
                </div>
                <div class="swiper-slide bg-white rounded-lg text-center px-4 opacity-25">
                    <div class="py-6 mb-4">
                        <div class="flex justify-center py-4">
                            <img class="h-20 w-20 rounded-full"
                                src="http://bugspatrol.ancorathemes.com/wp-content/uploads/2016/07/testimonials-3-75x75.jpg">
                        </div>
                        <div>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fas fa-star"></i>
                        </div>
                        <div class="flex jusify-center py-4 text-base text-center">
                            "Feedback with swiper js and Tailwind css seems perfect to me. I like multiple sliders in one places."
                        </div>
                        <div class="font-bold text-base flex justify-center text-gray-700">Julia Bredshow, NY</div>
                        <div class="text-sm">Apple Inc</div>
                    </div>
                </div>
                <div class="swiper-slide bg-white rounded-lg text-center px-4 opacity-25">
                    <div class="py-6 mb-4">
                        <div class="flex justify-center py-4">
                            <img class="h-20 w-20 rounded-full"
                                src="http://bugspatrol.ancorathemes.com/wp-content/uploads/2016/07/testimonials-3-75x75.jpg">
                        </div>
                        <div>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                            <i class="fill-current text-green-500 fas fa-star"></i>
                        </div>
                        <div class="flex jusify-center py-4 text-base text-center">
                            "Feedback with swiper js and Tailwind css seems perfect to me. I like multiple sliders in one places."
                        </div>
                        <div class="font-bold text-base flex justify-center text-gray-700">Julia Bredshow, NY</div>
                        <div class="text-sm">Apple Inc</div>
                    </div>
                </div>
            </div>
            <div class="swiper-button-prev bg-white w-8 h-8 text-xs rounded-full text-green-500 mx-10"></div>
            <div class="swiper-button-next bg-white w-8 h-8 text-xs rounded-full text-green-500 mx-10"></div>
            <!-- Add Pagination -->
            <div class="swiper-pagination"></div>
        </div>
    </div>


    <!-- Initialize Swiper -->
    <script>
        var swiper = new Swiper('.swiper-container', {
            slidesPerView: 3,
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },
            pagination: {
                el: '.swiper-pagination',
                clickable: true,
            },
        });
    </script>
</body>

</html>
© 2019 - 2021 Web2tailwind.com