-
-
-
- @php
-
- $fileExtension = pathinfo($daftarPustaka->attachment, PATHINFO_EXTENSION);
- // cek extension
- $isPdf = $fileExtension == 'pdf';
- $imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp'];
- $isImage = in_array(strtolower($fileExtension), $imageExtensions);
- $fileUrl = asset('storage/' . $daftarPustaka->attachment);
- @endphp
-
- @if ($isPdf)
-
- @elseif ($isImage)
-

- @else
-
File tidak bisa ditampilkan, silakan unduh di sini.
- @endif
-
-
-
-
-
-
-
-
- {{ $daftarPustaka->deskripsi ?? '' }}
-
+
+
+
@endsection
-{{-- @push('scripts')
-
+@push('scripts')
+
+
+
-@endpush --}}
+
+ canvas.addEventListener('touchend', function (e) {
+ touchEndX = e.changedTouches[0].screenX;
+ handleSwipe();
+ });
+
+ function handleSwipe() {
+ const swipeThreshold = 50; // min distance for swipe
+ if (touchEndX < touchStartX - swipeThreshold) {
+ onNextPage();
+ } else if (touchEndX > touchStartX + swipeThreshold) {
+ onPrevPage();
+ }
+ }
+
+ pdfjsLib.getDocument(url).promise.then(function (pdfDoc_) {
+ pdfDoc = pdfDoc_;
+ document.getElementById('pageCount').textContent = pdfDoc.numPages;
+ renderPage(pageNum);
+ });
+ }
+});
+
+@endpush