</div>
@endif
- {{-- CHAPTERS --}}
- @foreach ($resources['chapters'] as $chapter)
- <div class="mt-15">
- <h3 class="text-4xl">{{ $chapter['chapter_title'] }}</h3>
-
- {{-- SUB-CHAPTERS --}}
- @foreach ($chapter['subchapters'] as $subchapter)
- <h4 class="mt-8 text-2xl">{{ $subchapter['subchapter_title'] }}</h4>
- <p class="mt-2.5 max-w-[500px]">{{ $subchapter['subchapter_subtitle'] }}</p>
-
- {{-- MEMOS --}}
- <div class="grid grid-cols-2 gap-5 mt-8">
- @foreach ($subchapter['subchapter_memos'] as $memo)
- @if (!$memo['memo_pdf'] || !isset($resources_pdf[$memo['memo_pdf']]))
- @continue
- @endif
- @php
- /** @var \Cubist\Backpack\Magic\PageData $pdf */
- $pdf = $resources_pdf[$memo['memo_pdf']];
- $pdfurl = $pdf->getImageURLbyCollection($pdf->get('file_upload'));
- $thumb = !$pdf->get('file_thumb') || !$pdf->getImageURLbyCollection($pdf->get('file_thumb'))
- ? $pdf->getImageURLbyCollection($pdf->get('file_upload'),'poster')
- : $pdf->getImageURLbyCollection($pdf->get('file_thumb'));
- @endphp
-
- {{--<a href="{{ $memo['memo_pdf'] }}" @click.prevent="openPDF($el.attributes.href.value)" class="group">--}}
- <a href="{{ $pdfurl }}"
- @click.prevent="openPDF($el.attributes.href.value)"
- class="group">
- <div class="bg-grey-50 flex items-start h-full p-[1.875rem] rounded-md">
- <img class="w-1/4 mr-5 shadow-sm"
- style="min-width: 105px; box-shadow: 2px 3px 3px 0 rgb(0 0 0 / 15%);"
- src="{{ $thumb }}"
- alt="{{ $memo['memo_title'] }}">
- <div class="space-y-2.5 pt-4">
- @if ($memo['memo_number'])
- <h3 class="text-lg font-semibold">{{ $memo['memo_number'] }}</h3>
+ {{-- MEMOS TITLE --}}
+ <p class="my-15">
+ <span class="inline-block p-2.5
+ font-secondary font-bold uppercase text-xs leading-none
+ border border-current">
+ Les mémos
+ </span>
+ </p>
+
+ {{-- MAIN SECTION WITH SIDEBAR --}}
+ <div class="flex">
+ {{-- SIDEBAR --}}
+ <div class="flex-shrink-0 w-1/4 mr-10" style="max-width: 265px">
+ <ol class="sticky top-6 list-decimal space-y-8 pl-4">
+ @foreach ($resources['chapters'] as $index => $chapter)
+ <li class="font-semibold text-lg leading-snug">
+ <a href="#ch-{{ $index + 1 }}" class="block hover:text-blue">
+ {{ $chapter['chapter_title'] }}
+ </a>
+ </li>
+ @endforeach
+ </ol>
+ </div>
+
+ {{-- CHAPTERS --}}
+ <div class="space-y-20">
+ @foreach ($resources['chapters'] as $index => $chapter)
+ {{-- CHAPTER BLOCK --}}
+ <div class="chapter">
+ {{--
+ Opposing top padding (pt-4) + negative top margin (-mt-4) gives
+ space above scroll anchor position without misaligning anything
+ --}}
+ <h3 class="text-4xl pt-4 -mt-4" id="ch-{{ $index + 1 }}">
+ {{ $index + 1 }}. {{ $chapter['chapter_title'] }}
+ </h3>
+
+ {{-- SUB-CHAPTERS --}}
+ @foreach ($chapter['subchapters'] as $subchapter_index => $subchapter)
+ @if (empty($subchapter['subchapter_title']))
+ @continue
+ @endif
+
+ <h4 class="mt-8 text-2xl">{{ $index + 1 }}.{{ $subchapter_index + 1 }} {{ $subchapter['subchapter_title'] }}</h4>
+ <p class="mt-2.5 max-w-[500px]">{{ $subchapter['subchapter_subtitle'] }}</p>
+
+ {{-- MEMOS --}}
+ <div class="grid grid-cols-2 gap-5 mt-8">
+ @foreach ($subchapter['subchapter_memos'] as $memo)
+ @if (!$memo['memo_pdf'] || !isset($resources_pdf[$memo['memo_pdf']]))
+ @continue
@endif
- <h4 class="text-base font-semibold">{{ $memo['memo_title'] }}</h4>
- <h5 class="text-base">{{ $memo['memo_subtitle'] }}</h5>
- <span
- class="circle-arrow transform transition group-hover:scale-110"></span>
- </div>
+ @php
+ /** @var \Cubist\Backpack\Magic\PageData $pdf */
+ $pdf = $resources_pdf[$memo['memo_pdf']];
+ $pdfurl = $pdf->getImageURLbyCollection($pdf->get('file_upload'));
+ $thumb = !$pdf->get('file_thumb') || !$pdf->getImageURLbyCollection($pdf->get('file_thumb'))
+ ? $pdf->getImageURLbyCollection($pdf->get('file_upload'),'poster')
+ : $pdf->getImageURLbyCollection($pdf->get('file_thumb'));
+ @endphp
+
+ {{--<a href="{{ $memo['memo_pdf'] }}" @click.prevent="openPDF($el.attributes.href.value)" class="group">--}}
+ <a href="{{ $pdfurl }}"
+ @click.prevent="openPDF($el.attributes.href.value)"
+ class="group">
+ <div class="bg-grey-50 flex items-start h-full p-[1.875rem] rounded-md">
+ <img class="w-1/4 mr-5 shadow-sm"
+ style="min-width: 105px; box-shadow: 2px 3px 3px 0 rgb(0 0 0 / 15%);"
+ src="{{ $thumb }}"
+ alt="{{ $memo['memo_title'] }}">
+ <div class="space-y-2.5 pt-4">
+ @if ($memo['memo_number'])
+ <h3 class="text-lg font-semibold">{{ $memo['memo_number'] }}</h3>
+ @endif
+ <h4 class="text-base font-semibold">{{ $memo['memo_title'] }}</h4>
+ <h5 class="text-base">{{ $memo['memo_subtitle'] }}</h5>
+ <span
+ class="circle-arrow transform transition group-hover:scale-110"></span>
+ </div>
+ </div>
+ </a>
+ @endforeach
</div>
- </a>
- @endforeach
+ @endforeach
</div>
@endforeach
</div>
- @endforeach
+ </div>
</div>
{{-- PDF Viewer Overlay --}}