@extends('layouts.app')

@section('title')
    Projects List
@stop

@section('breadcrumb')
    <ol class="breadcrumb pull-right">
        <li><a href="{{ route('home') }}"><i class="fa fa-dashboard"></i> Home</a></li>

        <li class="active"> Society </li>
    </ol>
@stop
@section('css')
<style type="text/css">
    @import url('https://fonts.googleapis.com/css2?family=Poppins&family=Rubik:wght@300&family=Varela+Round&family=Work+Sans&display=swap');

    .stories-container{
        max-width: 900px;
        margin: 35px auto;
        position: relative;
    }
    .stories-container .previous-btn,
    .stories-container .next-btn {
        width: 30px;
        position: absolute;
        z-index: 2;
        top: 50%;
        transform: translateY(-50%);
        background: #444;
        color: #fff;
        /* border-radius: 50%; */
        padding: 10px;
        display: flex;
        cursor: pointer;
    }
    .stories-container .previous-btn,
    .stories-container .next-btn
    {
        /* opacity: 0; */
        pointer-events: none;
        transition: all 400ms ease;
    }
    .stories-container .previous-btn.active,
    .stories-container .next-btn.active
    {
        opacity: 1;
        pointer-events: auto;
    }

    .stories-container .previous-btn{
        left: 89%;
        top: 308px;
    }
    .stories-container .next-btn{
        right: 3px;
        top: 308px;
    }
    .stories-container .story{
        height: 270px;
        background: white;
        width: 260px;
        flex-shrink: 0;
        border-radius: 5px;
        overflow: hidden;
        position: relative;
        border-radius: 5%;
        box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.5); 
    }
    .stories-container 
    .activ,
    .story:hover{
        transform: scale(1.05);
        transition: ease-in-out all .2s;
        box-shadow: rgb(38, 57, 77) 0px 20px 30px -10px;
        /* box-shadow: 0 0 2rem rgba(0,0,0,.2); */
    }
    
    .stories-container .socities_name{
        position: absolute;
        text-align: center;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 15px;
        font-size: 15px;
        font-family: "Roboto", sans-serif;
        font-weight: 500;
        color: black;
        background: white;
        /* background: #0078bc; */
        /* background: linear-gradient(transparent, #222 130%); */
    }
    .stories-container .story img{
        width: 100%;
        height: 100%;
        object-fit: cover;
        padding: 10px;
    }
    .stories-container .story:hover{
        cursor: pointer;
        /* box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
        cursor: pointer;
        border: 1px solid lightgray;
        transition: all 1s ease;
        transform: scale(1.03); */
    }
    .stories-container .stories{
        display: flex;
        gap: 35px;
        flex-wrap: wrap;
    }
    .stories-container .inside_content{
        /* overflow-x: scroll;
        scrollbar-width: none; */
        scroll-behavior: smooth; 
    }
    .stories-container  .inside_content::-webkit-scrollbar {
        display: none;
    }
    
    .box-title {
        text-align: center;
        color: black !important
    }

    .container-fluid {
        margin-left: 50px;
    }
    .whitebox3 {
    /* background: #ddd; */
    /* background: #ededed; */
    background: whitesmoke;
    padding: 18px 25px 10px 25px;
    margin-bottom: 30px;
    border-radius: 4px;
}

    .h2 {
        text-align: center;
        color: #273019 !important;
        font-weight: 400px;
        text-shadow: 0 1px 0 #ccc,
               0 2px 0 #C9C9C9,
               0 3px 0 #bbb,
               0 4px 0 #B9B9B9,
               0 5px 0 #aaa,
               0 6px 1px rgba(0,0,0,.1),
               0 0 5px rgba(0,0,0,.1),
               0 1px 3px rgba(0,0,0,.3),
               0 3px 5px rgba(0,0,0,.2),
               0 5px 10px rgba(0,0,0,.25),
               0 10px 10px rgba(0,0,0,.2),
               0 20px 20px rgba(0,0,0,.15);
    }
    /* img{
    width: 20%;
    height: 20%;
   } */
    .cards {
        width: 20%;
        height: auto;
        /* display: inline-block; */
        background-color: white;
        border-radius: 10px;
        /* margin: 40px; */
        margin-top: 100px;
        margin-left: 45px;
        border: 1px solid gray;

    }
    .card-wrapper {
    display: flex;
    justify-content: center;
    background: white;
    margin-left: 10px;
    margin-right: 10px;
   }

    .cards:hover {
        box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
        /* box-shadow: 2px 2px 10px black; */
        cursor: pointer;
        border: 1px solid LightGray;
        transition: all 1s ease;
        transform: scale(1.03);
    }

    .image img {
        width: 100%;
        border-radius: 5px;
        height: 150px;
        object-fit: cover;

    }

    .title {
        text-align: center;
        color: black;
        font-size: 16px;
        font-weight: bold;
        font-family: Arial, Helvetica, sans-serif;
        padding: 10px
    }
    body{
        background: red;
    }

    /* button{
    margin-top: 10%;
    margin-bottom: 10%;
    background-color: white;
    border: 1px solid black;
    padding: 5px;
    border-radius: 5px;
    color: black;
    cursor: pointer;
   } */
    button:hover {
        background-color: black;
        color: white;
        transition: 0.5s;
    }
    .head {
      /* display: flex;
      background: white;
      margin-left: 10px;
      margin-right: 10px;
      justify-content: space-around; */
   }
   .head img{
        width: 20%;
    }
    .texts{
        margin-top: 105px;
    }
    .texts > h4{
        font-size: 20px;
        font-family: 'georgia';
        letter-spacing: 0.5px;
    }
    h2{
        position: relative;
        font-size: 20px;
        color: transparent;
        -webkit-text-stroke: 0.3vw transparent;
        text-transform: uppercase;
    }
    h3 {
    line-height: 30px;
    font-size: 21px;
    /* text-align: center; */
    font-weight: 500;
    }
    .check{
    /* background: white; */
    margin-top: -28px;
    margin-right: 10px;
    margin-left: 10px;
    padding: 50px;
    }
    h2::before{
        position: absolute;
        top: 0;
        left: 0;
        width: 0%;
        height: 100%;
        color: #f2a225;
        -webkit-text-stroke: 0vw #383d52;
        border-right: 2px solid #f2a225;
        overflow: hidden;
        animation: animate 6s linear infinite;
    }
    #imag {
    width: 12%;
    position: absolute;
    left: 70%;
    top: 10px;
}
    
</style>
@stop
@section('content')



    <div class="col-lg-12 col-sm-12 col-xs-12">
    <div class="whitebox3">
    <div class="check">
    <h4 style="font-size: 21px; font-weight: 500;">𝐏𝐑𝐎𝐉𝐄𝐂𝐓𝐒</h4>
    <h3>Ｓｏｃｉｅｔｙ ａｎｄ Ｈｉｇｈ Ｒｉｓｅ</h3>
     <img src="images/building.jpg" id="imag">
    <div class="stories-container">

    <div class="inside_content">
        <!-- <div class="previous-btn" style="width: 40px; height: 40px; background: #0078bc">
        <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
        <path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5L8.25 12l7.5-7.5" /> 
       </svg> -->

    </div>
    
    <div class="stories">
        <!-- These are the Cards Below -->
        <!-- 1 -->
    <div class="story">
        <a href="https://www.google.com/" target="_blank">
            <img src="images/metrocity.jpg" alt="">
            <div class="socities_name">Metro City</div>
        </a>
        </div>
        <!-- 2 -->
        <div class="story">
            <img src="images/newmetro.jpeg" alt="">
            <div class="socities_name">Prism City</div>
        </div>
        <!-- 3 -->
        <div class="story">
            <img src="images/logo.png" alt="">
            <div class="socities_name">Ronanclave City</div>
        </div>
        <!-- 4 -->
        <div class="story">
            <img src="images/logo.png" alt="">
            <div class="socities_name">Ronanclave City</div>
        </div>
        <!-- 5 -->
        <div class="story">
            <img src="images/logo.png" alt="">
            <div class="socities_name">Ronanclave City</div>
        </div>
    </div>

    <!-- <div class="next-btn active" style="width: 40px; height: 40px; background: #0078bc">
    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
    <path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" />
    </svg> -->

    </div>
    </div>
    </div>
</div>
</div>
</div>

@stop

@section('js')
    <script>
        $(function() {

            // Order by the grouping
            $('#example tbody').on('click', 'tr.group', function() {
                var currentOrder = table.order()[0];
                if (currentOrder[0] === 2 && currentOrder[1] === 'asc') {
                    table.order([2, 'desc']).draw();
                } else {
                    table.order([2, 'asc']).draw();
                }
            });
        });
        $('#example23').DataTable({
            dom: 'Bfrtip',
            buttons: [
                'copy', 'csv', 'excel', 'pdf', 'print'
            ]
        });
        let card = document.querySelectorAll('.story')
        card.forEach(story => {
            story.addEventListener('click', function() {
                card.forEach(cd => cd.classList.remove('activ'));
                this.classList.add('activ');

            })
        })
        // Swiper Code
//         const allStories = [
//     {
//         id: 0,
//         socities_name: "Metro City",
//         imageUrl: "images/test1.png",
        
//     },
//     {
//         id: 1,
//         socities_name: "Prism City",
//         imageUrl: "images/test1.png",
        
//     },
//     {
//         id: 2,
//         socities_name: "BlueArc City",
//         imageUrl: "images/newmetro.jpeg",
        
//     },
//     {
//         id: 3,
//         socities_name: "Roenclave Society",
//         imageUrl: "images/test1.png",
        
//     },
//     {
//         id: 4,
//         socities_name: "Metro City",
//         imageUrl: "images/metrocity.jpg",
        
//     },

// ];
// const stories = document.querySelector(".stories");
// const nextBtn = document.querySelector(".stories-container .next-btn");
// const previousBtn = document.querySelector(".stories-container .previous-btn");
// const storiesContent = document.querySelector(".stories-container .inside_content");
// const createStories = () =>{
//     allStories.forEach((s) => {
//         const story = document.createElement("div");
//         story.classList.add("story");
//         const img = document.createElement("img");
//         img.src = s.imageUrl;
//         const socities_name = document.createElement("div");
//         socities_name.classList.add("socities_name");
//         socities_name.innerHTML = s.socities_name;

//         story.appendChild(img);
//         story.appendChild(socities_name);

//         stories.appendChild(story);
//     });
// };
// createStories();
// nextBtn.addEventListener("click", () => {
//     storiesContent.scrollLeft += 300;
// });
// previousBtn.addEventListener("click", () => {
//     storiesContent.scrollLeft -= 300;
// });
// storiesContent.addEventListener("scroll", () =>{
//     if(storiesContent.scrollLeft <= 24) {
//         previousBtn.classList.remove("active");
//     }
//     else{
//         previousBtn.classList.add("active");
//     }


//     let maxScrollValue = storiesContent.scrollWidth - storiesContent.clientWidth -24;
//     if(storiesContent.scrollLeft >= maxScrollValue){
//         nextBtn.classList.remove("active");
//     }
//     else{
//         nextBtn.classList.add("active");
//     }
// });
// End Here
    </script>

    <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
    <script>
        var CSRF_TOKEN = $('meta[name="csrf-token"]').attr('content');
        // $("#postbutton").click(function() {

        function callFunction(val) {

            $('.preloader').fadeIn();
            $.ajax({
                /* the route pointing to the post function */
                url: '{{ route('projectswitch.create') }}',
                type: 'POST',
                /* send the csrf-token and the input to the controller */
                data: {
                    _token: CSRF_TOKEN,
                    project: val
                },
                dataType: 'JSON',
                /* remind that 'data' is the response of the AjaxController */
                success: function(data) {

                    $('.preloader').fadeOut();
                    //  localStorage.setItem('project_id', data.session);
                    Swal.fire({

                            icon: 'success',
                            title: 'Your Project Switched Successfully!',
                            confirmButtonColor: '#3085d6',

                            confirmButtonText: 'ok!',
                            showCancelButton: false,
                            allowOutsideClick: false
                        })
                        .then((result) => {
                            if (result.isConfirmed) {
                               
                                location.href = "{{ route('home') }}";

                            }
                        });


                },
                error: function(xhr, status, error) {
                    // handle error response here
                    if (xhr.status == 422) {
                        var errors = xhr.responseJSON.errors;
                        //   console.log(errors);
                        Swal.fire({
                            icon: 'error',
                            title: 'Oops...',
                            text: 'Something went wrong!',

                        })

                    } else {
                        //   console.log(xhr.responseText);
                        Swal.fire({
                            icon: 'error',
                            title: 'Oops...',
                            text: 'Something went wrong!',

                        })
                    }
                }
            });




        }
    </script>

@stop
