sekolah_adiwiyata/resources/views/index.blade.php

215 lines
9.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

@extends('layouts.app')
@section('content')
<section id="section1" class="relative overflow-hidden md:pt-20" style="min-height: 95vh">
<!-- Enhanced Animated Background Elements -->
<div class="absolute inset-0 bg-gradient-to-br from-slate-50 via-white to-gray-100">
<div class="absolute inset-0 bg-grid-pattern opacity-[0.03]"></div>
<div class="absolute top-0 left-0 w-full h-full overflow-hidden">
<div class="blob blob-1 absolute top-[10%] right-[15%] w-[40vw] h-[40vw] rounded-full mix-blend-multiply filter blur-[80px] animate-blob-slow opacity-15 bg-gradient-to-br from-green-300 to-emerald-400"></div>
<div class="blob blob-2 absolute bottom-[5%] left-[20%] w-[35vw] h-[35vw] rounded-full mix-blend-multiply filter blur-[80px] animate-blob-slow animation-delay-2000 opacity-15 bg-gradient-to-br from-amber-300 to-orange-400"></div>
<div class="blob blob-3 absolute top-[30%] left-[10%] w-[30vw] h-[30vw] rounded-full mix-blend-multiply filter blur-[80px] animate-blob-slow animation-delay-4000 opacity-15 bg-gradient-to-tr from-green-400 to-teal-300"></div>
</div>
</div>
<div class="flex flex-col md:flex-row px-4 container mx-auto my-40 md:my-0 gap-3">
<div class="w-full md:w-3/5 z-10 relative items-center">
<div class="flex flex-col justify-center text-center md:text-left item-center gap-0">
<h4 class="mb-2 text-lg font-semibold animate-fade-in" style="animation-delay: 0.4s">
<span class="text-black">Portal Resmi</span>
</h4>
<h2 class="mb-5 text-3xl md:text-3xl lg:text-4xl font-extrabold animate-fade-in" style="animation-delay: 0.4s">
<span class="text-warning">Sekolah Adiwiyata</span> <br>
<span class="text-black">Provinsi DKI Jakarta</span>
</h2>
<p class="mb-5 text-gray-600 text-lg max-w-2xl leading-relaxed mb-2 animate-fade-in" style="animation-delay: 0.8s">
Sistem Informasi Adiwiyata. <br> Pusat Pengembangan Generasi Lingkungan Hidup
</p>
<a onclick="document.getElementById('section2').scrollIntoView({ behavior: 'smooth' });" class="p-3 cursor-pointer text-white bg-success rounded-[10px] mx-auto md:mx-0 w-50 text-center flex flex-row gap-3 shadow-[10px_10px_10px_0px_rgba(0,0,0,0.25)]">
<span>Lihat Selengkapnya</span> <x-lucide-arrow-down width="20" class="text-white"/>
</a>
</div>
</div>
<div class="w-2/5 relative flex md:block hidden">
<div class="flex flex-col absolute top-0 left-0 right-10 w-full h-full">
<img class="left-[100px] top-0 absolute " src="{{ asset('img2.svg') }}" />
<img class="left-0 top-[90px] absolute " src="{{ asset('img1.svg') }}" />
</div>
</div>
</div>
</section>
<section id="section2" class="container mx-auto p-12 md:py-12">
<div class="grid grid-rows-1 md:grid-cols-3 gap-5">
<div class="bg-danger flex flex-col justify-around text-white rounded-xl gap-3 min-h-[30vh] shadow-[10px_10px_10px_0px_rgba(0,0,0,0.25)]">
<div class="text-6xl lg:text-7xl font-extrabold text-center">68</div>
<div class="flex justify-around items-center">
<div class="flex flex-col">
<span class="font-extrabold">Kota</span>
<span class="opacity-[70%]">Sekolah Adiwiyata</span>
</div>
<div>
<span class="font-extrabold">2025</span>
</div>
</div>
</div>
<div class="bg-info flex flex-col justify-around text-white rounded-xl gap-3 min-h-[30vh] shadow-[10px_10px_10px_0px_rgba(0,0,0,0.25)]">
<div class="text-6xl lg:text-7xl font-extrabold text-center">137</div>
<div class="flex justify-around items-center">
<div class="flex flex-col">
<span class="font-extrabold">Provinsi</span>
<span class="opacity-[70%]">Sekolah Adiwiyata</span>
</div>
<div>
<span class="font-extrabold">2025</span>
</div>
</div>
</div>
<div class="bg-warning flex flex-col justify-around text-white rounded-xl gap-3 min-h-[30vh] shadow-[10px_10px_10px_0px_rgba(0,0,0,0.25)]">
<div class="text-6xl lg:text-7xl font-extrabold text-center">89</div>
<div class="flex justify-around items-center">
<div class="flex flex-col">
<span class="font-extrabold">Nasional</span>
<span class="opacity-[70%]">Sekolah Adiwiyata</span>
</div>
<div>
<span class="font-extrabold">2025</span>
</div>
</div>
</div>
</div>
</section>
<section id="section3" class="container mx-auto p-12 md:py-12">
<div class="flex justify-between mb-15">
<h4 class="text-lg md:text-2xl font-extrabold text-black">Kegiatan Adiwiyata</h4>
<a href="{{ url('kegiatan') }}" class="p-2 text-white text-sm bg-warning rounded-[10px] mx-auto md:mx-0 text-center flex flex-row justify-between gap-3 ">
<span>Lihat Semua</span> <x-lucide-arrow-right width="20" class="text-white text-right"/>
</a>
</div>
<div class="flex flex-row gap-10">
<div class="w-full lg:w-2/3">
<div class="flex flex-col gap-3">
<?php
$image = json_decode($kegiatan[0]->image);
?>
<img src="{{ asset($image[0]) }}" alt="" class="w-full lg:w-[100%] rounded-[10px]">
<div class="flex flex-row gap-3 items-center">
<span class="p-2 bg-warning text-xs rounded-[10px] text-white">Kegiatan {{ $kegiatan[0]->kategori }}</span>
<span class="text-xs opacity-[50%]">{{ date('D',strtotime($kegiatan[0]->created_at)) }}, {{ date('d M Y',strtotime($kegiatan[0]->created_at)) }}</span>
</div>
<h4 class="text-2xl text-black font-bold mt-2">{{ $kegiatan[0]->judul }}</h4>
<div class="text-sm opacity-[50%]">
{!! substr(strip_tags($kegiatan[0]->body),0,1000) !!}
</div>
<a href="{{ url('kegiatan/'.$kegiatan[0]->slug) }}" class="text-sm text-warning rounded-[10px] mx-auto md:mx-0 flex flex-row gap-3 ">
<span>Baca Selengkapnya</span> <x-lucide-arrow-right width="20" class="text-warning"/>
</a>
</div>
</div>
<div class="hidden lg:block w-1/3">
<div class="flex flex-col gap-3">
@foreach($kegiatan as $dataKeg)
<?php
$images = json_decode($dataKeg->image);
?>
<div class="flex items-center gap-3 flex-row border-b-1 border-b-[#eee] pb-3">
<div class="flex justify-end w-2/5">
<img src="{{ asset($images[0]) }}" class="rounded-[10px] ">
</div>
<div class="flex flex-col gap-3 justify-center w-3/5">
<span class="text-xs opacity-[50%]">{{ date('D',strtotime($dataKeg->created_at)) }}, {{ date('d M Y',strtotime($dataKeg->created_at)) }}</span>
<a href="{{ url('kegiatan/'.$dataKeg->slug) }}" class="text-xs text-black font-bold">{{ $dataKeg->judul }}</a>
</div>
</div>
@endforeach
</div>
</div>
</div>
</section>
<section id="section4" class="container mx-auto p-12 md:py-12">
<div class="flex justify-between mb-15">
<h4 class="text-lg md:text-2xl font-extrabold text-black">Galeri Adiwiyata</h4>
<a href="{{ url('galeri') }}" class="p-2 text-white text-sm bg-warning rounded-[10px] mx-auto md:mx-0 text-center flex flex-row justify-between gap-3 ">
<span>Lihat Semua</span> <x-lucide-arrow-right width="20" class="text-white text-right"/>
</a>
</div>
<div class="flex flex-row gap-10">
<div class="grid grid-rows-1 md:grid-cols-3 lg:grid-cols-4 gap-5">
@foreach($kegiatan as $dataKeg)
<?php
$images = json_decode($dataKeg->image);
?>
<div class="relative group w-full overflow-hidden rounded-lg shadow-[10px_10px_10px_0px_rgba(0,0,0,0.25)]">
<img src="{{ asset($images[0]) }}" class="w-full h-full object-cover" alt="Galeri">
<div class="absolute inset-0 bg-success bg-opacity-50 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col justify-center p-4 gap-3">
<h4 class="mb-5 font-bold text-white w-50">{{ $dataKeg->judul }}</h4>
{{-- <p class="text-white text-sm font-normal">1 Agustus 2025</p> --}}
<a href="#" data-url="{{$dataKeg->image}}" data-judul="{{$dataKeg->judul}}" class="btnmodal p-2 text-black text-sm bg-white opacity-50 rounded-[10px] mx-auto md:mx-0 text-center flex flex-row justify-between gap-3 w-40 ">
<span>Lihat Detail</span> <x-lucide-arrow-right width="20" class="text-black text-right"/>
</a>
</div>
</div>
@endforeach
</div>
</div>
</section>
<div id="myModal" class="fixed inset-0 z-50 hidden bg-black/50 flex items-center justify-center">
<div class="bg-white rounded-lg shadow-lg w-1/2 p-6 relative">
<div id="carousel" class="relative w-full flex transition-transform duration-500">
<img id="image" src="" alt="" class="w-full rounded">
<!-- tombol navigasi -->
<button id="prev" class="absolute left-0 top-1/2 transform -translate-y-1/2 bg-gray-800 text-white px-3 py-1 rounded"></button>
<button id="next" class="absolute right-0 top-1/2 transform -translate-y-1/2 bg-gray-800 text-white px-3 py-1 rounded"></button>
</div>
<div class="flex justify-end space-x-2 mt-1">
<button onclick="closeModal()" class="bg-gray-300 text-gray-700 px-4 py-2 cursor-pointer rounded">Tutup</button>
</div>
</div>
</div>
@endsection
@section('js')
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script>
let slides = [];
let currentIndex = 0;
$('.btnmodal').on('click', function(e){
e.preventDefault();
$('#myModal').removeClass('hidden');
$('#judul').html($(this).data('judul'));
// ambil data-images dan parse JSON
slides = $(this).data('url');
if (!Array.isArray(slides)) {
slides = JSON.parse(slides);
}
console.log(slides);
currentIndex = 0;
$('#image').attr('src', "{{ asset('/') }}"+slides[currentIndex]);
});
// tombol navigasi
$('#next').on('click', function(){
if(slides.length > 0){
currentIndex = (currentIndex + 1) % slides.length;
$('#image').attr('src', "{{ asset('/') }}"+slides[currentIndex]);
}
});
$('#prev').on('click', function(){
if(slides.length > 0){
currentIndex = (currentIndex - 1 + slides.length) % slides.length;
$('#image').attr('src', "{{ asset('/') }}"+slides[currentIndex]);
}
});
function closeModal(){
$('#myModal').addClass('hidden');
}
</script>
@endsection